/* ═══════════════════════════════════════════════════════
   FlowOp — Design System v2
   Paleta: Navy dark, Blue accent, Gold highlights
   ═══════════════════════════════════════════════════════ */
:root {
    --bg:            #0b1120;
    --bg-deep:       #07090f;
    --surface:       #111827;
    --surface-2:     #1a2235;
    --surface-3:     #1f2a3f;
    --border:        rgba(148,163,184,0.12);
    --border-strong: rgba(148,163,184,0.22);
    --text:          #e2e8f4;
    --text-2:        #94a3b8;
    --text-3:        #64748b;
    --primary:       #3b82f6;
    --primary-dark:  #2563eb;
    --primary-glow:  rgba(59,130,246,0.15);
    --gold:          #f59e0b;
    --gold-light:    #fbbf24;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --danger-bg:     rgba(239,68,68,0.1);
    --success-bg:    rgba(16,185,129,0.1);
    --warning-bg:    rgba(245,158,11,0.1);
    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     14px;
    --radius-xl:     20px;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg:     0 8px 48px rgba(0,0,0,0.5);
    --sidebar-w:     240px;
    --topbar-h:      60px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

/* ── LAYOUT SHELL ── */
.app-authenticated {
    display: flex;
    min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar, .app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    z-index: 200;
    background: rgba(11,17,32,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 12px;
}

.topbar-inner, .header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ── BRAND ── */
.brand, .sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--text);
}
.brand-mark {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    display: grid; place-items: center;
    font-size: 0.78rem; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(59,130,246,0.4);
}
.brand-mark.small { width: 28px; height: 28px; font-size: 0.68rem; }

/* ── SIDEBAR ── */
.sidebar, .nav-panel {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── WORKSPACE CARD ── */
.workspace-card {
    margin: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-shrink: 0;
}
.workspace-card span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-3);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.workspace-card strong {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

/* ── NAV LINKS ── */
.nav {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group {
    margin: 12px 0 4px;
    padding: 0 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
}

.nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-2);
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav a:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.nav a.active, .nav a[class~="active"] {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: rgba(59,130,246,0.25);
    font-weight: 600;
}
.nav a .nav-icon {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ── LOGOUT LINK ── */
.logout-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    margin: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.18);
    background: rgba(239,68,68,0.05);
    transition: all 0.15s;
    cursor: pointer;
    flex-shrink: 0;
}
.logout-link:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.35);
}

/* logout also in topbar on mobile */
.topbar-logout {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.06);
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
}
.topbar-logout:hover { background: rgba(239,68,68,0.14); }

/* ── MOBILE TOPBAR ── */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--topbar-h);
    gap: 10px;
}

.mobile-toggle, .nav-toggle {
    display: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 7px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.mobile-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ── MAIN CONTENT ── */
.app-main, .main-content, .content, .page-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 28px 28px 60px;
    min-height: calc(100vh - var(--topbar-h));
    width: calc(100% - var(--sidebar-w));
    max-width: 1400px;
}

/* ── PAGE HEAD ── */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head .eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}
.page-head h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.page-head .muted { font-size: 0.82rem; color: var(--text-2); margin-top: 4px; }

/* breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-3);
    margin-bottom: 6px;
}
.breadcrumb a { color: var(--text-2); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-3); }

/* actions row */
.actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── CARDS ── */
.card, .panel, .section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 20px;
}
.card h2, .panel h2, .section h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 20px;
}

/* ── METRIC CARDS ── */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.metric, .premium-metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}
.metric::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.metric:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.metric:hover::before { opacity: 1; }

.metric-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    border: 1px solid rgba(59,130,246,0.2);
    display: grid; place-items: center;
    font-size: 0.72rem; font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
    letter-spacing: 0;
}
.metric-icon.gold { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.2); color: var(--gold); }
.metric-icon.rose { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: var(--danger); }
.metric-icon.emerald { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: var(--success); }
.metric-icon.amber { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); color: var(--warning); }
.metric-icon.steel { background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.15); color: var(--text-2); }

.metric > div { min-width: 0; }
.metric > div span {
    display: block;
    font-size: 0.73rem;
    color: var(--text-2);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric > div strong {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* ── STATUS PILL ── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.premium-pill {
    background: var(--primary-glow);
    border: 1px solid rgba(59,130,246,0.3);
    color: var(--primary);
}

/* ── TAGS ── */
.tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
    text-transform: uppercase;
}
.tag-activ, .tag[class*="ACTIV"] { background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.25); }
.tag-suspendat { background: var(--danger-bg); color: #f87171; border-color: rgba(239,68,68,0.25); }
.tag-trial { background: rgba(245,158,11,0.12); color: var(--gold-light); border-color: rgba(245,158,11,0.25); }

/* ── TABLES ── */
.table-wrap, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 4px;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}
th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
    color: var(--text);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
td[data-label] { position: relative; }

/* ── FORMS ── */
.form-grid, .feeding-form {
    display: grid;
    gap: 14px;
}
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide, .form-grid .span-2 { grid-column: 1 / -1; }

label {
    display: grid;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.02em;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"],
input[type="datetime-local"], textarea, select {
    width: 100%;
    background: var(--bg-deep, #07090f);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 12px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
input[type="file"] {
    padding: 8px 10px;
    font-size: 0.8rem;
    color: var(--text-2);
    cursor: pointer;
}
textarea { min-height: 100px; resize: vertical; }
select option { background: var(--surface); }

/* ── BUTTONS ── */
.button, .link-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.button:hover, .link-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}
.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.button.ghost { background: transparent; }
.button.danger { background: var(--danger-bg); border-color: rgba(239,68,68,0.3); color: var(--danger); }
.button.danger:hover { background: rgba(239,68,68,0.2); }
.button.compact { padding: 6px 12px; font-size: 0.76rem; }
.button.sm { padding: 5px 10px; font-size: 0.72rem; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button.is-loading { opacity: 0.7; }

/* BACK BUTTON */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.15s;
    cursor: pointer;
}
.btn-back:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn-back::before { content: '←'; font-size: 0.85rem; }

/* ── FLASH MESSAGES ── */
.flash, .alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}
.flash.success, .alert.success {
    background: var(--success-bg);
    border-color: rgba(16,185,129,0.3);
    color: #34d399;
}
.flash.error, .alert.error {
    background: var(--danger-bg);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}
.flash.info, .alert.info {
    background: var(--primary-glow);
    border-color: rgba(59,130,246,0.3);
    color: var(--primary);
}

/* ── GRID HELPERS ── */
.grid { display: grid; gap: 20px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid.two-cols { grid-template-columns: 1fr 1fr; }
.grid.three-cols { grid-template-columns: 1fr 1fr 1fr; }

/* ── OPS COMMAND ── */
.ops-command {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.ops-command h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.ops-command .muted { font-size: 0.82rem; color: var(--text-2); max-width: 480px; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

/* ── ACTIVITY LIST ── */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-list > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.activity-list > div:last-child { border-bottom: none; }
.activity-list span { color: var(--text-3); font-size: 0.72rem; white-space: nowrap; }
.activity-list strong { color: var(--text); font-weight: 600; }
.activity-list small { color: var(--text-2); grid-column: 2; margin-top: -4px; }

/* ── CONTROL CHECKLIST ── */
.control-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.control-checklist span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.83rem;
    color: var(--text-2);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.control-checklist span:last-child { border-bottom: none; }
.control-checklist span::before {
    content: '';
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='%2310b981'%3E%3Cpath d='M14.5 4.5l-7.5 7.5-3.5-3.5 1.4-1.4 2.1 2.1 6.1-6.1z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── INLINE FORM ── */
.inline-form { display: inline; }

/* ── MUTED TEXT ── */
.muted { color: var(--text-2); }
.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}

/* ── PRODUCT LINE ── */
.product-lines { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.product-line.stock-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.product-line .span-2 { grid-column: 1 / -1; }

/* ── PHOTO LIGHTBOX ── */
.photo-thumb {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.18);
    background: #0f172a;
    cursor: zoom-in;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.photo-thumb:hover { transform: translateY(-1px); border-color: rgba(59,130,246,0.45); }
.photo-lightbox-backdrop {
    position: fixed; inset: 0; z-index: 400; display: none;
    align-items: center; justify-content: center; padding: 18px;
    background: rgba(7, 11, 19, 0.82); backdrop-filter: blur(8px);
}
.photo-lightbox-backdrop.is-open { display: flex; }
.photo-lightbox-card {
    width: min(980px, 100%); max-height: 92vh; overflow: auto;
    background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
    border: 1px solid rgba(148,163,184,0.18); border-radius: 18px; box-shadow: 0 18px 64px rgba(0,0,0,0.45);
}
.photo-lightbox-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid rgba(148,163,184,0.14);
}
.photo-lightbox-title { font-size: 0.95rem; color: #e5eefb; font-weight: 600; }
.photo-lightbox-actions { display: flex; align-items: center; gap: 8px; }
.photo-lightbox-btn {
    border: 1px solid rgba(148,163,184,0.18); border-radius: 10px; background: rgba(15,23,42,0.95); color: #e5eefb; padding: 8px 10px; cursor: pointer;
}
.photo-lightbox-btn:hover { border-color: rgba(59,130,246,0.45); color: #fff; }
.photo-lightbox-body { padding: 14px; }
.photo-lightbox-frame {
    display: grid; grid-template-columns: 1fr; gap: 12px;
}
.photo-lightbox-image {
    width: 100%; max-height: 68vh; object-fit: contain; border-radius: 14px; background: #020617;
}
.photo-lightbox-meta { color: #cbd5e1; font-size: 0.9rem; }
@media (max-width: 700px) {
    .photo-thumb { width: 74px; height: 74px; }
    .photo-lightbox-card { border-radius: 14px; }
    .photo-lightbox-header { padding: 10px; }
    .photo-lightbox-body { padding: 10px; }
    .photo-lightbox-btn { padding: 8px; font-size: 0.88rem; }
}

/* ── FOOTER ── */
.app-footer {
    position: fixed;
    bottom: 0; left: var(--sidebar-w); right: 0;
    height: 36px;
    background: var(--bg-deep, #07090f);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    color: var(--text-3);
    letter-spacing: 0.06em;
    z-index: 50;
}

/* ── LANDING / LOGIN ── */
.app-guest {
    background: var(--bg);
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(29,78,216,0.06) 0%, transparent 50%),
        var(--bg);
}

.login-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 860px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-copy {
    padding: 48px 40px;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
}

.login-copy .eyebrow { margin-bottom: 8px; }
.login-copy h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.02em;
}
.login-subtitle { font-size: 0.85rem; color: var(--text-2); line-height: 1.65; margin-top: 8px; }

.login-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}
.login-highlights span {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-glow);
    border: 1px solid rgba(59,130,246,0.25);
    color: var(--primary);
}

.login-panel {
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}
.login-panel-head h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-top: 4px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ── LANDING PAGE ── */
.landing-page, .landing-shell { background: #fff; color: #0f172a; }
body.landing-page, body.app-guest.landing-page {
    background: #fff !important;
    color: #0f172a;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .sidebar, .nav-panel {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }

    .mobile-topbar { display: flex; }
    .topbar-logout { display: flex; }
    .mobile-toggle, .nav-toggle { display: inline-flex; }

    .app-main, .main-content, .content, .page-content {
        margin-left: 0;
        width: 100%;
        padding: 80px 16px 60px;
    }

    .app-footer { left: 0; }

    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
    .grid.two-cols { grid-template-columns: 1fr; }
    .grid.three-cols { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .ops-command { flex-direction: column; align-items: flex-start; }

    .login-card { grid-template-columns: 1fr; }
    .login-copy { display: none; }
}

@media (max-width: 600px) {
    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
    .metric > div strong { font-size: 1.35rem; }
    .page-head h1 { font-size: 1.3rem; }
    .card, .panel, .section, .form-card { padding: 14px 16px; }
    .actions-row { width: 100%; }
    .actions-row .button { flex: 1; justify-content: center; }
    table { min-width: 480px; }

    /* card-stack tables on very small screens */
    .card-table thead { display: none; }
    .card-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 10px;
        background: var(--surface);
    }
    .card-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        font-size: 0.8rem;
    }
    .card-table td:last-child { border-bottom: none; }
    .card-table td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--text-3);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-right: 8px;
        flex-shrink: 0;
    }
}

/* ── PRINT (pentru PDF preview) ── */
@media print {
    .sidebar, .topbar, .mobile-topbar, .app-footer { display: none !important; }
    .app-main { margin: 0 !important; padding: 0 !important; width: 100% !important; }
}
