/* ════════════════════════════════════════════════════════════════════════════
   Casa Seciu – Gestiune Saloane · style.css
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Custom properties ───────────────────────────────────────────────────── */
:root {
    --primary:       #1e3a5f;
    --primary-light: #2a5298;
    --accent:        #c9a84c;
    --accent-light:  #f5e6b8;
    --bg:            #f4f5f7;
    --surface:       #ffffff;
    --border:        #e2e8f0;
    --text:          #1a202c;
    --text-muted:    #64748b;
    --success:       #16a34a;
    --success-bg:    #f0fdf4;
    --success-border:#86efac;
    --danger:        #dc2626;
    --danger-bg:     #fef2f2;
    --danger-border: #fca5a5;
    --warning:       #d97706;
    --warning-bg:    #fffbeb;
    --warning-border:#fde68a;
    --info:          #2563eb;
    --info-bg:       #eff6ff;
    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow:        0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
    --nav-h:         60px;
    --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-right: 32px;
}
.brand-icon { font-size: 1.4rem; }
.brand-text {
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.80);
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    white-space: nowrap;
    text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }

.nav-separator { flex: 1; }

.nav-user {
    color: rgba(255,255,255,.70);
    font-size: .85rem;
    padding: 0 8px;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.85);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s;
    font-family: var(--font);
    white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,.22); color: #fff; }

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    margin-left: auto;
    padding: 4px 8px;
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main-content {
    padding: 28px 24px 60px;
    min-height: calc(100vh - var(--nav-h) - 48px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer {
    text-align: center;
    padding: 14px;
    color: var(--text-muted);
    font-size: .8rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.4px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 20px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font);
    line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn--primary:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

.btn--outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}
.btn--outline:hover { border-color: var(--primary); background: var(--info-bg); }

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    padding-left: 4px;
}
.btn--ghost:hover { color: var(--primary); background: transparent; box-shadow: none; transform: none; }

.btn--danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn--danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn--success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn--success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn--warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn--warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn--sm {
    padding: 5px 12px;
    font-size: .82rem;
    border-radius: var(--radius-sm);
}

.btn--full { width: 100%; justify-content: center; }

/* ── Alerts / Flash ──────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .9rem;
    line-height: 1.5;
    border: 1.5px solid;
}
.alert--success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #15803d;
}
.alert--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: #b91c1c;
}
.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: .6;
    flex-shrink: 0;
    padding: 0 4px;
    color: inherit;
}
.alert-close:hover { opacity: 1; }
.error-list { margin-top: 6px; padding-left: 20px; list-style: disc; }
.error-list li { margin-bottom: 2px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: #374151;
    margin-bottom: 6px;
}
.required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: .95rem;
    color: var(--text);
    background: #fafbfc;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    font-family: var(--font);
}
.form-control:focus {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control.input-error { border-color: var(--danger); }

.form-textarea { resize: vertical; min-height: 100px; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Radio group ─────────────────────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-muted);
    transition: all .15s;
    user-select: none;
}
.radio-label input[type="radio"] { accent-color: var(--primary); }
.radio-label:hover { border-color: var(--primary-light); color: var(--primary); background: var(--info-bg); }
.radio-label--active { border-color: var(--primary); color: var(--primary); background: var(--info-bg); }

/* ── Color input ─────────────────────────────────────────────────────────── */
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-picker {
    width: 48px;
    height: 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}
.color-text { flex: 1; }

/* ── Calendar ────────────────────────────────────────────────────────────── */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}
.calendar-month-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    flex: 1;
}

.calendar-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.legend-item { font-size: .82rem; color: var(--text-muted); }

.calendar-scroll-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.calendar-th-day {
    background: var(--primary);
    color: #fff;
    padding: 12px 14px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    text-align: center;
    width: 70px;
    min-width: 70px;
    position: sticky;
    left: 0;
    z-index: 5;
}

.calendar-th-salon {
    background: var(--primary);
    color: #fff;
    padding: 10px 12px;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    min-width: 160px;
    vertical-align: top;
    border-left: 1px solid rgba(255,255,255,.12);
}
.salon-header-name { display: block; }
.salon-header-cap  { display: block; font-size: .7rem; font-weight: 400; opacity: .7; margin-top: 2px; }

/* Calendar rows */
.calendar-row { border-bottom: 1px solid var(--border); transition: background .1s; }
.calendar-row:hover { background: #f8fafc; }
.calendar-row--weekend .calendar-td-day { background: #f0f4ff; }
.calendar-row--today   .calendar-td-day { background: var(--accent-light); }

.calendar-td-day {
    padding: 10px 8px;
    text-align: center;
    vertical-align: top;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    border-right: 2px solid var(--border);
    width: 70px;
    min-width: 70px;
}
.calendar-row--weekend .calendar-td-day { background: #f0f4ff; }
.calendar-row--today   .calendar-td-day { background: var(--accent-light); }
.calendar-row:hover .calendar-td-day { background: #f8fafc; }
.calendar-row--weekend:hover .calendar-td-day { background: #e8eeff; }
.calendar-row--today:hover   .calendar-td-day { background: #f0dfa0; }

.day-number {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.day-number--today {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2px;
    font-size: 1rem;
}
.day-name {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.calendar-td-cell {
    padding: 6px 8px;
    vertical-align: top;
    border-left: 1px solid var(--border);
    min-height: 48px;
    position: relative;
}

/* Booking chips inside cells */
.chip {
    display: flex;
    flex-direction: column;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: .78rem;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    overflow: hidden;
}
.chip:hover { filter: brightness(.95); transform: scale(1.02); text-decoration: none; }
.chip-name  { font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-time  { font-size: .7rem; color: #475569; }
.chip-pax   { font-size: .68rem; color: #64748b; }
.chip-badge { position: absolute; top: 4px; right: 4px; font-size: .65rem; }
.chip--free { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: .78rem; background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }

/* "+" add button shown in empty/hover cell */
.cell-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    color: #cbd5e1;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s;
    line-height: 1;
}
.calendar-td-cell:hover .cell-add-btn { background: var(--primary); color: #fff; }
.cell-add-btn:hover { text-decoration: none; }

/* ── Data tables ─────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.data-table thead tr { background: var(--primary); }
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody td { padding: 13px 16px; vertical-align: middle; color: var(--text); }
.row-inactive { opacity: .55; }
.actions-cell { white-space: nowrap; }

.text-muted { color: var(--text-muted); font-size: .85rem; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge--muted   { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }
.badge--primary { background: var(--info-bg); color: var(--info); border: 1px solid #bfdbfe; }
.badge--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* ── Color swatch (saloane list) ─────────────────────────────────────────── */
.color-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(0,0,0,.1);
    vertical-align: middle;
}

/* ── Booking detail view ─────────────────────────────────────────────────── */

.view-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.view-salon-badge {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 99px;
}
.view-date {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
}
.view-tip {
    font-size: .88rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 99px;
}
.view-tip--ferma     { background: var(--success-bg); color: var(--success); }
.view-tip--tentativa { background: var(--warning-bg); color: var(--warning); }
.view-tip--anulat    { background: #f1f5f9; color: #64748b; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.detail-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.detail-item:nth-child(odd)  { padding-right: 24px; }
.detail-item:nth-child(even) { padding-left: 24px;  border-left: 1px solid var(--border); }
.detail-item--full {
    grid-column: 1 / -1;
    padding-right: 0;
    border-left: none;
}
.detail-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
}
.detail-value { font-size: .95rem; color: var(--text); }
.detail-value--large { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.avans-value { font-size: 1.05rem; font-weight: 700; color: var(--success); }

/* ── Login page ──────────────────────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #3b6cb7 100%);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1;
}
.login-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 28px;
}

.login-card .form-group { margin-bottom: 16px; }
.login-card .btn--primary { margin-top: 8px; padding: 13px; font-size: 1rem; }

/* ── Booking form ────────────────────────────────────────────────────────── */
.booking-form .card { box-shadow: none; padding: 0; border: none; }

/* ── Misc helpers ────────────────────────────────────────────────────────── */
.hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
small { font-size: .8rem; color: var(--text-muted); font-weight: 400; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Nav mobile */
    .navbar { flex-wrap: wrap; height: auto; min-height: var(--nav-h); padding: 0 16px; gap: 0; }
    .navbar-toggle { display: flex; }
    .navbar-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 12px 0 16px;
        gap: 2px;
        border-top: 1px solid rgba(255,255,255,.12);
    }
    .navbar-menu.open { display: flex; }
    .nav-separator { display: none; }
    .nav-user { width: 100%; padding: 8px 4px 4px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 4px; }
    .btn-logout { margin-top: 4px; }

    /* Content */
    .main-content { padding: 20px 14px 48px; }
    .page-title   { font-size: 1.2rem; }
    .page-header  { margin-bottom: 16px; }

    /* Calendar */
    .calendar-nav { gap: 8px; }
    .calendar-month-title { font-size: 1.1rem; }

    /* Forms */
    .form-row, .form-row--3 { grid-template-columns: 1fr; gap: 0; }

    /* Detail view */
    .detail-grid { grid-template-columns: 1fr; }
    .detail-item:nth-child(even) { border-left: none; padding-left: 0; }
    .detail-item:nth-child(odd)  { padding-right: 0; }
    .view-header { flex-direction: column; gap: 10px; }

    /* Cards */
    .card { padding: 20px 16px; }

    /* Login */
    .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .calendar-month-title { font-size: .95rem; }
    .btn { padding: 8px 14px; font-size: .85rem; }
    .page-title { font-size: 1.05rem; }
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card, .calendar-scroll-wrapper { animation: fadeIn .25s ease; }
.alert { animation: fadeIn .2s ease; }
