/* ==========================================================================
   Event Planner — design system
   Paletă: petrol închis (albastru-verde) pe neutre reci.
   ========================================================================== */

:root {
    /* Neutre, cu o tentă rece */
    --ink: #0f1c20;
    --ink-2: #2b3d43;
    --ink-3: #5b6f76;
    --ink-4: #8b9aa0;

    --paper: #f5f8f8;
    --paper-2: #e8eeee;
    --surface: #ffffff;

    --line: #dde5e6;
    --line-strong: #c4d0d2;

    /* Accentul principal */
    --accent: #15616d;
    --accent-dark: #0e4650;
    --accent-soft: #e0eef0;

    /* Evidențiere: „locul tău" pentru invitat, „rezultat căutare" pentru organizator.
       Cele două nu apar niciodată pe același ecran, deci pot împărți culoarea. */
    --highlight: #1a9d68;
    --highlight-dark: #147a51;

    /* Chrome-ul închis: bara laterală */
    --shell: #0d2126;
    --shell-2: #17353c;
    --shell-line: #22454d;

    /* Semantice */
    --green: #227e5c;
    --green-soft: #e2f0eb;
    --red: #a63f31;
    --red-soft: #f8e9e6;
    --amber: #8f6a15;
    --amber-soft: #f8efd8;
    --blue: #2f5f87;
    --blue-soft: #e6eef6;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 28, 32, .06), 0 1px 3px rgba(15, 28, 32, .04);
    --shadow: 0 2px 4px rgba(15, 28, 32, .05), 0 8px 20px rgba(15, 28, 32, .07);
    --shadow-lg: 0 12px 40px rgba(15, 28, 32, .18);

    --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

    --sidebar-w: 236px;
    --topbar-h: 57px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
img, svg { max-width: 100%; }

.serif { font-family: var(--font-display); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

.row { display: flex; align-items: center; gap: 10px; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }

/* ---------- App shell ---------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.mobile-bar { display: none; }
.nav-backdrop { display: none; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--shell);
    color: #c6d1d2;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 60;
}

.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--shell-line);
}
.sidebar-brand .mark {
    font-family: var(--font-display);
    font-size: 19px;
    color: #f1f5f5;
    letter-spacing: -.02em;
    display: block;
}
.sidebar-brand .sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .13em;
    color: #63a3ab;
    margin-top: 3px;
}

.sidebar-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6b8085;
    padding: 14px 8px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: #c6d1d2;
    font-size: 13.5px;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--shell-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--shell-2); color: #fff; box-shadow: inset 2px 0 0 #4fb3a5; }
.nav-item .ico { width: 16px; text-align: center; opacity: .85; font-size: 14px; }
.nav-item .count { margin-left: auto; font-size: 11px; color: #7c9195; }

.sidebar-foot { border-top: 1px solid var(--shell-line); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar { background: var(--accent); color: #eaf5f6; }
.user-chip .name { font-size: 13px; color: #eaf0f0; }
.user-chip .role { font-size: 11px; color: #7c9195; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 26px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar h1 { font-size: 18px; }
.topbar .crumbs { font-size: 12px; color: var(--ink-4); margin-bottom: 1px; }
.topbar .crumbs a { color: var(--ink-3); }

.content { padding: 26px; flex: 1; min-width: 0; }
.content.flush { padding: 0; display: flex; flex-direction: column; }
.container-narrow { max-width: 780px; }
.container-mid { max-width: 1080px; }

/* Conținut principal + coloană laterală, care se suprapun pe ecrane mici. */
.split-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 16px;
}
@media (max-width: 900px) {
    .split-main { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Buttons ------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { background: var(--paper-2); border-color: var(--ink-4); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }

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

.btn-dark { background: var(--shell); border-color: var(--shell); color: #eef3f3; }
.btn-dark:hover { background: #17353c; border-color: #17353c; color: #fff; }

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

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--paper-2); border-color: transparent; }

.btn-sm { padding: 4px 9px; font-size: 12px; gap: 5px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 8px; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--shell); border-color: var(--shell); color: #fff; z-index: 1; }

/* ---------- Forms -------------------------------------------------------- */

.field { margin-bottom: 14px; min-width: 0; }
.field > label, .label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 5px;
    letter-spacing: .01em;
    /* Ține eticheta pe un rând, ca perechile din grilă să pornească la aceeași înălțime. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hint { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }

.input, .select, .textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(21, 97, 109, .14);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.textarea { min-height: 80px; resize: vertical; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%235b6f76' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
}
.input-sm { padding: 5px 8px; font-size: 13px; }
.select.input-sm { padding-right: 26px; background-position: right 8px center; }

.input-error { border-color: var(--red); }
.error { color: var(--red); font-size: 12px; margin-top: 4px; }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; }
.check input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 16px; }
.check .check-body { font-size: 13px; }
.check .check-body .sub { display: block; font-size: 11.5px; color: var(--ink-4); line-height: 1.4; }

/* Grilele de formular: coloanele se aliniază pe rânduri, câmpurile își împart
   rândul în mod egal și cad una sub alta pe ecrane mici. */
.grid-2, .grid-3 {
    display: grid;
    gap: 0 16px;
    align-items: start;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 14px;
    align-items: end;
}
.form-row .field { margin-bottom: 12px; }
.form-row .form-row-action { margin-bottom: 12px; }

.search-wrap { position: relative; min-width: 0; }
.search-wrap .input { padding-left: 30px; }
.search-wrap::before {
    content: "";
    position: absolute; left: 10px; top: 50%;
    width: 12px; height: 12px; margin-top: -6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235b6f76' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E") no-repeat center / contain;
    pointer-events: none;
}

/* ---------- Cards, panels ------------------------------------------------ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-4); }
.empty .glyph { font-size: 30px; opacity: .5; display: block; margin-bottom: 10px; }
.empty .title { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }

/* ---------- Stats -------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); }
.stat .v { font-family: var(--font-display); font-size: 26px; line-height: 1.15; margin-top: 4px; }
.stat .d { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.meter { height: 5px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin-top: 9px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.meter.green > span { background: var(--green); }

/* ---------- Badges ------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--paper-2);
    color: var(--ink-3);
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.warning { background: var(--amber-soft); color: var(--amber); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.accent { background: var(--accent-soft); color: var(--accent-dark); }
.badge.muted { background: var(--paper-2); color: var(--ink-4); }
.badge.neutral { background: var(--paper-2); color: var(--ink-3); }
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.avatar {
    width: 30px; height: 30px;
    flex: 0 0 30px;
    border-radius: 99px;
    background: var(--paper-2);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 600;
}
.avatar.sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }

/* ---------- Tables ------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--ink-4);
    font-weight: 600;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfdfd; }
.table .actions { text-align: right; white-space: nowrap; }
.table-fixed { table-layout: fixed; }

/* ---------- Toast / flash ------------------------------------------------ */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--shell);
    color: #eef3f3;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 380px;
    animation: toast-in .22s ease-out;
}
.toast.ok { box-shadow: var(--shadow-lg), inset 3px 0 0 var(--highlight); }
.toast.err { box-shadow: var(--shadow-lg), inset 3px 0 0 var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid;
    display: flex;
    gap: 9px;
    align-items: flex-start;
}
.alert-info { background: var(--blue-soft); border-color: #cfdcea; color: #2a5578; }
.alert-warn { background: var(--amber-soft); border-color: #ebdcb3; color: #7a5a11; }
.alert-danger { background: var(--red-soft); border-color: #ecd2cc; color: var(--red); }
.alert-ok { background: var(--green-soft); border-color: #c6e0d6; color: var(--green); }

/* ---------- Modal -------------------------------------------------------- */

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 28, 32, .45);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 20px;
    overflow-y: auto;
    animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    animation: pop .18s cubic-bezier(.2,.9,.3,1.1);
}
.modal.wide { max-width: 780px; }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.985); } }
.modal-head { padding: 18px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: var(--paper); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-close { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-4); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--ink); }

/* ---------- Dropdown ----------------------------------------------------- */

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 5px;
    z-index: 60;
    animation: pop .12s ease-out;
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
}
.dropdown-item:hover { background: var(--paper-2); text-decoration: none; color: var(--ink); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-soft); }
.dropdown-sep { height: 1px; background: var(--line); margin: 5px 0; }
.dropdown-head { padding: 7px 10px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); }

/* ---------- Auth screens ------------------------------------------------- */

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
    background: var(--shell);
    color: #cdd8d9;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-image: radial-gradient(circle at 80% 10%, rgba(79, 179, 165, .16), transparent 55%);
}
.auth-aside .mark { font-family: var(--font-display); font-size: 26px; color: #fff; }
.auth-aside .sub { color: #63a3ab; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; }
.auth-aside .pitch { font-family: var(--font-display); font-size: 26px; line-height: 1.35; color: #eef3f3; max-width: 420px; }
.auth-aside .feat { display: flex; gap: 10px; font-size: 13px; color: #93a5a8; margin-top: 8px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-family: var(--font-display); font-size: 26px; margin-bottom: 6px; }

/* ---------- Plan editor -------------------------------------------------- */

.planner {
    display: flex;
    flex: 1;
    min-height: 0;
    height: calc(100vh - var(--topbar-h));
}

.plan-side {
    width: 278px;
    flex: 0 0 278px;
    border-right: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
    text-align: left;
}
.plan-side.pane-right { border-right: 0; border-left: 1px solid var(--line); width: 300px; flex-basis: 300px; }
@media (max-width: 1280px) {
    .plan-side { width: 240px; flex-basis: 240px; }
    .plan-side.pane-right { width: 260px; flex-basis: 260px; }
}
.plan-side-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.plan-side-body { flex: 1; overflow-y: auto; min-height: 0; }
.plan-side-foot { border-top: 1px solid var(--line); padding: 10px 14px; background: var(--paper); }
.plan-side-close { display: none; }

.plan-canvas-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    background: var(--paper-2);
    overflow: hidden;
}
.plan-toolbar {
    position: absolute;
    top: 12px; left: 12px; right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: none;
}
.plan-toolbar > * { pointer-events: auto; }
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 3px;
    box-shadow: var(--shadow-sm);
}
.toolbar-group .btn { border: 0; background: none; }
.toolbar-group .btn:hover { background: var(--paper-2); }
.toolbar-group .btn.active { background: var(--shell); color: #fff; }
.toolbar-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 3px; }
.toolbar-mobile { display: none; }

.plan-status {
    position: absolute;
    bottom: 12px; left: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5px 10px;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    color: var(--ink-3);
}
.plan-legend {
    position: absolute;
    bottom: 12px; right: 12px;
    z-index: 10;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 11px;
    box-shadow: var(--shadow-sm);
    font-size: 11.5px;
    color: var(--ink-3);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.plan-legend .li { display: flex; align-items: center; gap: 7px; }
.plan-legend .sw { width: 11px; height: 11px; border-radius: 99px; border: 1.5px solid var(--line-strong); background: #fff; }
.plan-legend .sw.taken { background: var(--accent); border-color: var(--accent-dark); }
.plan-legend .sw.mine { background: var(--highlight); border-color: var(--highlight-dark); }
.plan-legend .sw.blocked { background: repeating-linear-gradient(45deg, #dde4e4, #dde4e4 2px, #fff 2px, #fff 4px); }

/* Poziționare absolută, nu height:100%: într-o coloană flexibilă înălțimea
   procentuală nu se rezolvă și SVG-ul cade pe cei 150px impliciți. */
svg.plan {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}
svg.plan.panning { cursor: grabbing; }
svg.plan.armed { cursor: copy; }

.tbl-shape { fill: #fff; stroke: #b9c6c8; stroke-width: 1.5; transition: stroke .12s, fill .12s; }
.tbl-group.selected .tbl-shape { stroke: var(--accent); stroke-width: 2.5; }
.tbl-group.dragging { opacity: .85; }
.tbl-group.edit .tbl-shape { cursor: move; }
.tbl-label { font-family: var(--font-display); font-size: 17px; font-weight: 600; fill: var(--ink); text-anchor: middle; pointer-events: none; }
.tbl-meta { font-size: 10.5px; fill: var(--ink-4); text-anchor: middle; pointer-events: none; letter-spacing: .04em; }

.seat-hit { cursor: pointer; }
.seat-shape { fill: #fff; stroke: #b9c6c8; stroke-width: 1.5; transition: fill .1s, stroke .1s; }
.seat.taken .seat-shape { fill: var(--accent); stroke: var(--accent-dark); }
.seat.blocked .seat-shape { fill: #dde4e4; stroke: #c3cfd0; stroke-dasharray: 3 2; }
.seat.mine .seat-shape { fill: var(--highlight); stroke: var(--highlight-dark); }
.seat.match .seat-shape { fill: var(--highlight); stroke: var(--highlight-dark); }
.seat-hit:hover .seat-shape { stroke: var(--ink); stroke-width: 2.5; }
.seat.drop-ok .seat-shape { stroke: var(--highlight); stroke-width: 3; }
.seat-num { font-size: 9.5px; fill: var(--ink-4); text-anchor: middle; pointer-events: none; }
.seat.taken .seat-num, .seat.mine .seat-num, .seat.match .seat-num { fill: rgba(255,255,255,.85); }
.seat-initials { font-size: 10px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; }
.seat-name { font-size: 9.5px; fill: var(--ink-2); text-anchor: middle; pointer-events: none; }

.vo-shape { fill: #e7edee; stroke: #ccd8d9; stroke-width: 1.5; transition: stroke .12s; }
.vo-shape.dancefloor { fill: #dfeaea; }
.vo-shape.stage { fill: #e2e9e9; }
.vo-shape.wall { fill: #9dadaf; stroke: #7d9092; }
.vo-group.edit { cursor: move; }
.vo-group.selected .vo-shape { stroke: var(--accent); stroke-width: 2.5; }
.vo-label { font-size: 12px; fill: var(--ink-3); text-anchor: middle; text-transform: uppercase; letter-spacing: .12em; pointer-events: none; }

.guest-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--paper-2);
    cursor: pointer;
    transition: background .1s;
    user-select: none;
}
.guest-row:hover { background: var(--paper); }
.guest-row.armed { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.guest-row.seated { opacity: .62; }
.guest-row .nm { font-size: 13px; line-height: 1.25; }
.guest-row .sub { font-size: 11px; color: var(--ink-4); }
.guest-row .where { font-size: 11px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.guest-row[draggable="true"] { cursor: grab; }

.seat-list { display: flex; flex-direction: column; }
.seat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--paper-2);
    font-size: 13px;
}
.seat-item .no {
    width: 22px; height: 22px; flex: 0 0 22px;
    border-radius: 99px;
    border: 1.5px solid var(--line-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 600; color: var(--ink-4);
}
.seat-item.taken .no { background: var(--accent); border-color: var(--accent); color: #fff; }
.seat-item.blocked { opacity: .6; }
.seat-item:hover { background: var(--paper); }
.seat-item .drop { flex: 1; min-width: 0; }
.seat-item.drop-active { background: var(--green-soft); }

.chip-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.chip {
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-size: 11.5px;
    color: var(--ink-3);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.chip:hover { background: var(--paper-2); }
.chip.active { background: var(--shell); border-color: var(--shell); color: #fff; }

.kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    background: var(--paper);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-3);
}

/* ---------- Guest-facing seat picker ------------------------------------- */

.guest-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.guest-head {
    background: var(--shell);
    color: #eaf0f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.guest-head .mark { font-family: var(--font-display); font-size: 18px; }
.guest-head .ev { font-size: 12px; color: #93a5a8; }
.guest-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 22px 24px; }
.guest-hero h1 { font-family: var(--font-display); font-size: 27px; }
.my-seat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--green-soft);
    border: 1px solid #c6e0d6;
    border-radius: var(--radius);
    padding: 12px 16px;
}
.my-seat .big { font-family: var(--font-display); font-size: 21px; color: var(--green); }

.tablemates { display: flex; flex-wrap: wrap; gap: 6px; }
.mate { display: flex; align-items: center; gap: 6px; background: var(--paper-2); border-radius: 99px; padding: 3px 10px 3px 3px; font-size: 12.5px; }

/* ---------- Print / export view ------------------------------------------ */

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .sheet { box-shadow: none; margin: 0; border: 0; page-break-after: always; }
    .sheet:last-child { page-break-after: auto; }
    @page { size: A4; margin: 14mm; }
}

.print-bar {
    position: sticky; top: 0; z-index: 20;
    background: var(--shell); color: #eef3f3;
    padding: 10px 20px;
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}
.sheet {
    background: #fff;
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 20px auto;
    padding: 16mm;
    box-shadow: var(--shadow);
}
.sheet-head { border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sheet-head h1 { font-family: var(--font-display); font-size: 24px; }
.table-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; break-inside: avoid; margin-bottom: 12px; }
.table-card h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.table-card ol { margin: 0; padding-left: 20px; font-size: 13px; }
.table-card ol li { padding: 2px 0; }
.cards-2 { columns: 2; column-gap: 14px; }

/* ---------- Misc --------------------------------------------------------- */

.scroll-y { overflow-y: auto; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--paper-2); font-size: 12.5px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .ic { width: 20px; text-align: center; opacity: .7; }
.timeline .when { margin-left: auto; color: var(--ink-4); font-size: 11px; white-space: nowrap; }

.spinner {
    width: 13px; height: 13px;
    border: 2px solid rgba(0,0,0,.14);
    border-top-color: var(--accent);
    border-radius: 99px;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd8d9; border-radius: 99px; border: 3px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: #b4c3c5; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Ecrane medii: bara laterală se subțiază, tabelele pierd coloanele secundare. */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
    .content { padding: 20px; }
    .topbar { padding: 12px 20px; }
    .hide-md { display: none !important; }
    .cards-2 { columns: 1; }
}

/* Telefon și tabletă îngustă */
@media (max-width: 820px) {
    :root { --topbar-h: 53px; }

    .hide-sm { display: none !important; }

    /* Bara laterală devine sertar peste conținut (e position:fixed, deci iese
       din flux și coloana rămâne exact cât ecranul). */
    .app { display: flex; flex-direction: column; min-height: 100vh; }
    .main { flex: 1; min-height: 0; }

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: var(--shell);
        color: #eef3f3;
        position: sticky;
        top: 0;
        z-index: 70;
    }
    .mobile-bar .mark { font-family: var(--font-display); font-size: 17px; color: #fff; }
    .mobile-bar .burger {
        border: 1px solid var(--shell-line);
        background: transparent;
        color: #eef3f3;
        border-radius: var(--radius-sm);
        width: 36px; height: 36px;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 36px;
    }

    .sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 264px;
        flex-basis: 264px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 28, 32, .5);
        z-index: 55;
    }

    .topbar {
        top: 53px;
        padding: 12px 16px;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .topbar h1 { font-size: 17px; }
    .topbar .crumbs { display: none; }
    .topbar .row-tight { flex-wrap: wrap; }

    .content { padding: 16px; }
    .content.flush { padding: 0; }

    /* Tabelele: rânduri pe două niveluri în loc de derulare pe orizontală */
    .table { font-size: 13px; }
    .table th, .table td { padding: 9px 10px; }
    /* Lăsăm textul să curgă, altfel tabelul iese din card. */
    .table .nowrap, .table th { white-space: normal; }

    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 12px 13px; }
    .stat .v { font-size: 22px; }

    .card-head { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .card-foot { padding: 12px 14px; }

    .modal-backdrop { padding: 12px; align-items: flex-end; }
    .modal, .modal.wide { max-width: 100%; border-radius: var(--radius-lg); }
    .modal-head { padding: 16px 16px 0; }
    .modal-body { padding: 14px 16px; }
    .modal-foot { padding: 12px 16px; }
    .modal-foot .btn { flex: 1; }

    .toasts { left: 12px; right: 12px; bottom: 12px; }
    .toast { max-width: none; }

    .dropdown-menu { min-width: 190px; }

    .auth-main { padding: 28px 18px; }
    .auth-card h1 { font-size: 23px; }

    .guest-head { padding: 12px 16px; }
    .guest-hero { padding: 18px 16px; }
    .guest-hero h1 { font-size: 22px; }

    .print-bar { padding: 10px 14px; }
    .sheet { padding: 14px; margin: 12px auto; min-height: 0; }

    /* --- Planul sălii pe telefon ---------------------------------------
       Pânza ocupă tot ecranul; cele două panouri devin sertare peste ea. */
    /* Pânza umple exact ce rămâne din ecran sub bară și antet. */
    .planner {
        flex-direction: column;
        flex: 1;
        height: auto;
        min-height: 340px;
        position: relative;
    }

    .plan-side {
        position: absolute;
        top: 0; bottom: 0; left: 0;
        width: min(88vw, 330px);
        flex-basis: auto;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
        border-right: 1px solid var(--line);
    }
    .plan-side.pane-right {
        left: auto; right: 0;
        width: min(88vw, 330px);
        flex-basis: auto;
        transform: translateX(100%);
        border-left: 1px solid var(--line);
        border-right: 0;
    }
    .plan-side.open { transform: none; }

    .plan-side-close {
        display: inline-flex;
        position: absolute;
        top: 8px; right: 8px;
        z-index: 2;
    }

    .toolbar-mobile { display: flex; }
    .plan-toolbar { top: 8px; left: 8px; right: 8px; gap: 6px; }
    .plan-toolbar .btn { padding: 6px 8px; }
    .plan-legend { display: none; }
    .plan-status { bottom: 8px; left: 8px; font-size: 11px; padding: 4px 8px; }
    .plan-legend { bottom: 8px; right: 8px; padding: 6px 9px; font-size: 11px; }

    /* Pagina invitatului: pânza sus, lista locurilor dedesubt, fără sertare. */
    .planner.stacked { flex-direction: column; height: auto; }
    .planner.stacked .plan-canvas-wrap { height: 58vh; min-height: 320px; flex: none; }
    .planner.stacked .plan-side.pane-right {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        border-left: 0;
        border-top: 1px solid var(--line);
        max-height: none;
    }
    .planner.stacked .plan-side-close { display: none; }
}

@media (max-width: 460px) {
    .stats { grid-template-columns: 1fr; }
    .btn-group { width: 100%; }
    .btn-group .btn { flex: 1; }
    .topbar .row-tight { width: 100%; }
    .topbar .row-tight .btn { flex: 1; }
}
