/* ============================================================
   Sistem Salon — design tokens
   Paletă: cerneală aubergine + roz prăfuit + auriu vechi
   Tipografie: Fraunces (titluri) / Inter (interfață) / IBM Plex Mono (cifre)
   Semnătură vizuală: "panglica orelor" — timeline vertical 07–22
   pentru programări, ca o agendă de salon deschisă pe birou.
   ============================================================ */

:root {
    --ink:          #2C1B2E;   /* aubergine închis — text principal, header */
    --ink-soft:      #5B4A5E;
    --bloom:        #FBF7F5;   /* fundal cald */
    --paper:        #FFFFFF;
    --rose:         #B76E79;   /* accent principal */
    --rose-light:   #F3DEE1;
    --sage:         #7C9885;   /* succes / confirmat */
    --sage-light:   #E3EBE4;
    --clay:         #C1502E;   /* ocupat / anulat / alertă */
    --clay-light:   #F6DDD3;
    --gold:         #B08D57;   /* accent admin */
    --gold-light:   #F1E7D3;
    --line:         #E9DEDD;
    --shadow: 0 4px 16px rgba(44, 27, 46, 0.08);
    --shadow-lift: 0 10px 30px rgba(44, 27, 46, 0.16);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 64px;
    --topbar-h: 56px;
    font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bloom);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-h) + 12px);
    min-height: 100vh;
}

h1, h2, h3, .display {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

.mono { font-family: 'IBM Plex Mono', 'Courier New', monospace; }

p { margin: 0 0 8px; line-height: 1.5; }
a { color: var(--rose); text-decoration: none; }

/* ---------- layout de bază ---------- */
.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 16px 8px;
}

.topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--ink);
    color: var(--bloom);
    padding: 0 14px;
}
.topbar .eyebrow {
    font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--rose-light); opacity: 0.85;
}
.topbar .title { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    background: rgba(255,255,255,0.08); border: none; color: var(--bloom);
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; position: relative;
}
.icon-btn .badge-dot {
    position: absolute; top: 2px; right: 2px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--clay);
    border: 2px solid var(--ink);
}
.impersonate-bar {
    background: var(--gold); color: var(--ink); font-size: 0.82rem;
    padding: 7px 14px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: var(--topbar-h); z-index: 19;
}
.impersonate-bar a { color: var(--ink); font-weight: 600; text-decoration: underline; }

/* ---------- bottom navigation ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: var(--nav-h);
    background: var(--paper);
    border-top: 1px solid var(--line);
    display: flex;
    box-shadow: 0 -6px 20px rgba(44,27,46,0.06);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--ink-soft); font-size: 0.66rem; font-weight: 600;
    letter-spacing: 0.01em;
}
.bottom-nav a .ic { font-size: 1.25rem; line-height: 1; }
.bottom-nav a.active { color: var(--rose); }
.bottom-nav a.active .ic { transform: translateY(-1px); }

/* ---------- carduri ---------- */
.card {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
}
.card-flat { border: 1px solid var(--line); box-shadow: none; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
    background: var(--paper); border-radius: var(--radius-sm);
    padding: 14px; box-shadow: var(--shadow);
}
.stat-card .label { font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; margin-top: 2px; }
.stat-card.accent-rose { background: var(--rose-light); }
.stat-card.accent-gold { background: var(--gold-light); }
.stat-card.accent-sage { background: var(--sage-light); }

/* ---------- butoane ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
    padding: 13px 22px; cursor: pointer; width: 100%;
    font-family: inherit;
}
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:active { background: #9f5c67; }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger { background: var(--clay-light); color: var(--clay); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 0.82rem; }
.btn-block-row { display: flex; gap: 8px; }
.btn-block-row .btn { width: auto; flex: 1; }
.fab {
    position: fixed; right: 18px; bottom: calc(var(--nav-h) + 16px); z-index: 25;
    width: 58px; height: 58px; border-radius: 50%; background: var(--rose); color: #fff;
    border: none; font-size: 1.6rem; box-shadow: var(--shadow-lift); cursor: pointer;
}

/* ---------- formulare ---------- */
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin: 12px 0 6px; }
input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=time], select, textarea {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line); background: var(--paper); font-size: 0.98rem;
    font-family: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rose); border-color: var(--rose); }
.field-help { font-size: 0.76rem; color: var(--ink-soft); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }

/* ---------- badge / status ---------- */
.badge {
    display: inline-block; padding: 4px 11px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge-programata { background: var(--gold-light); color: #7a6127; }
.badge-confirmata { background: var(--sage-light); color: #4c6653; }
.badge-finalizata { background: #E1E7EF; color: #3B4A63; }
.badge-anulata { background: var(--clay-light); color: var(--clay); }
.badge-neprezentat { background: #EFE1EA; color: #7a3a5c; }

/* ---------- lista de programări (carduri, nu tabel) ---------- */
.appt-card {
    background: var(--paper); border-radius: var(--radius-sm);
    border-left: 5px solid var(--rose);
    box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px;
    display: flex; gap: 12px; align-items: flex-start;
}
.appt-card.st-anulata { border-left-color: var(--clay); background: var(--clay-light); }
.appt-card.st-finalizata { border-left-color: #8497B0; }
.appt-card.st-confirmata { border-left-color: var(--sage); background: var(--sage-light); }
.appt-card .time-col { text-align: center; min-width: 54px; }
.appt-card .time-col .h { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem; }
.appt-card .time-col .dur { font-size: 0.68rem; color: var(--ink-soft); }
.appt-card .body { flex: 1; min-width: 0; }
.appt-card .client { font-weight: 700; }
.appt-card .services { font-size: 0.82rem; color: var(--ink-soft); margin: 2px 0; }
.appt-card .price { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--rose); }

/* ---------- butoane de acțiune pe cardul de programare (se împachetează pe mobil) ---------- */
.appt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.appt-actions .btn { flex: 1 1 auto; min-width: 96px; padding: 7px 10px; font-size: 0.76rem; }

/* ---------- panglica orelor (timeline zi) — elementul semnătură ---------- */
.hour-ribbon { position: relative; padding-left: 54px; }
.hour-ribbon::before {
    content: ''; position: absolute; left: 46px; top: 0; bottom: 0; width: 2px;
    background: var(--line);
}
.hour-tick {
    position: relative; height: 64px; display: flex; align-items: flex-start;
}
.hour-tick .h-label {
    position: absolute; left: -54px; top: -8px; width: 44px; text-align: right;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--ink-soft);
}
.hour-tick::after {
    content: ''; position: absolute; left: -8px; top: -1px; width: 8px; height: 2px; background: var(--line);
}

/* ---------- căutare client / sugestii ---------- */
.suggestion-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.suggestion-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bloom);
    border: 1px solid var(--line); cursor: pointer;
}
.suggestion-item .name { font-weight: 600; }
.suggestion-item .phone { font-size: 0.8rem; color: var(--ink-soft); font-family: 'IBM Plex Mono', monospace; }
.suggestion-item.new-client { background: var(--rose-light); border-color: var(--rose); color: var(--ink); font-weight: 700; justify-content: center; }

/* ---------- servicii picker ---------- */
.service-pick {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    margin-bottom: 8px; cursor: pointer;
}
.service-pick.selected { border-color: var(--rose); background: var(--rose-light); }
.service-pick .meta { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- utilitate afișare/ascundere ---------- */
.hidden { display: none !important; }

/* ---------- modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(44,27,46,0.5); z-index: 50;
    display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-sheet {
    background: var(--bloom); width: 100%; max-width: 640px;
    max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0;
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}
.modal-sheet .handle { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
.modal-close { position: absolute; right: 16px; top: 14px; background: none; border: none; font-size: 1.3rem; color: var(--ink-soft); }

/* ---------- filtre segmentate (zi/săptămână/lună) ---------- */
.segmented { display: flex; background: var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.segmented a, .segmented button {
    flex: 1; text-align: center; padding: 8px 6px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
    color: var(--ink-soft); background: none; border: none; cursor: pointer;
}
.segmented a.active, .segmented button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- tabele -> carduri pe mobil ---------- */
table.list-table { width: 100%; border-collapse: collapse; }
table.list-table th, table.list-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
table.list-table th { font-size: 0.7rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.03em; }
@media (max-width: 480px) {
    table.list-table thead { display: none; }
    table.list-table, table.list-table tbody, table.list-table tr, table.list-table td { display: block; width: 100%; }
    table.list-table tr { background: var(--paper); border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-bottom: 10px; padding: 8px 12px; }
    table.list-table td { border-bottom: none; display: flex; justify-content: space-between; padding: 6px 0; }
    table.list-table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-soft); font-size: 0.72rem; text-transform: uppercase; }
}

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .ic { font-size: 2.4rem; margin-bottom: 8px; }

/* ---------- notificări dropdown ---------- */
.notif-item { padding: 12px; border-bottom: 1px solid var(--line); }
.notif-item.unread { background: var(--rose-light); }
.notif-item .time { font-size: 0.72rem; color: var(--ink-soft); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ink); }
.login-card { background: var(--bloom); border-radius: 22px; padding: 32px 26px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lift); }
.login-card .brand { text-align: center; margin-bottom: 22px; }
.login-card .brand .mark { font-family: 'Fraunces', serif; font-size: 1.7rem; color: var(--rose); }
.login-card .brand .sub { font-size: 0.8rem; color: var(--ink-soft); }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.86rem; margin-bottom: 12px; }
.alert-error { background: var(--clay-light); color: var(--clay); }
.alert-success { background: var(--sage-light); color: #4c6653; }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.search-box { position: relative; margin-bottom: 14px; }
.search-box input { padding-left: 38px; }
.search-box .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--ink-soft); font-size: 0.85rem; }
