/* ============================================================
   SISTEMA SOS — Mobile-First Design System v4
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #dbeafe;
    --primary-glow:  rgba(37,99,235,0.18);
    --success:       #10b981;
    --success-light: #d1fae5;
    --success-dark:  #059669;
    --warning:       #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark:  #d97706;
    --danger:        #f43f5e;
    --danger-light:  #ffe4e6;
    --danger-dark:   #be123c;
    --info:          #3b82f6;
    --info-light:    #dbeafe;
    --grad-primary:  linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    --grad-success:  linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-danger:   linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --grad-warning:  linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-dark:     linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    --grad-purple:   linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --sb-bg:         #0d1117;
    --sb-width:      260px;
    --bg:        #eef6f5;
    --surface:   #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border:    #e2e8f0;
    --border-2:  #cbd5e1;
    --text:           #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --shadow-sm: 0 2px 8px rgba(15,23,42,0.06);
    --shadow:    0 4px 16px rgba(15,23,42,0.08);
    --shadow-md: 0 8px 24px rgba(15,23,42,0.10);
    --shadow-lg: 0 16px 48px rgba(15,23,42,0.14);
    --r-xs: 4px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;
    --bottom-nav-h: 64px;
    --topbar-h: 56px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ===== APP SHELL ===== */
.app {
    display: flex;
    height: 100dvh;
    overflow: hidden;
}

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

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 100;
    position: sticky;
    top: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.menu-toggle {
    width: 40px; height: 40px;
    border: none; background: transparent; cursor: pointer;
    font-size: 18px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s;
}
.menu-toggle:hover { background: var(--surface-2); }
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; padding: 4px 8px; border-radius: var(--r-full);
}
.topbar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--grad-primary); color: white;
    font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.topbar-user-name { font-size: 0.85rem; font-weight: 600; }
.topbar-date { font-size: 0.75rem; color: var(--text-muted); display: none; }

/* ===== CONTENT AREA ===== */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
    -webkit-overflow-scrolling: touch;
}

/* ===== SIDEBAR (Desktop) ===== */
.sidebar {
    width: var(--sb-width);
    background:
        radial-gradient(circle at top, rgba(37,99,235,0.24), transparent 30%),
        linear-gradient(180deg, #0b1220 0%, #12203a 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar-header {
    padding: 22px 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon-wrap {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.logo-text { font-size: 0.95rem; font-weight: 800; color: #f1f5f9; line-height: 1.2; }
.logo-sub { font-size: 0.65rem; color: rgba(255,255,255,0.4); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.sidebar-close {
    width: 32px; height: 32px; border: none; cursor: pointer;
    background: rgba(255,255,255,0.06); border-radius: var(--r-sm);
    color: rgba(255,255,255,0.5); font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px 12px 10px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 0; }
.sidebar-section-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.25); text-transform: uppercase;
    padding: 14px 10px 6px; margin-top: 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 14px; margin-bottom: 4px;
    text-decoration: none; color: rgba(255,255,255,0.7);
    font-size: 0.88rem; font-weight: 600;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.nav-label-row {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #eff6ff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}
.nav-item.active .nav-badge {
    background: rgba(255,255,255,0.18);
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.06); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.22), rgba(29,78,216,0.12));
    color: #eff6ff;
    border-color: rgba(96,165,250,0.35);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.nav-icon {
    width: 32px; height: 32px; border-radius: 10px;
    text-align: center; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
}
.nav-icon svg,
.nav-icon-wrap svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-item.active .nav-icon {
    background: rgba(96,165,250,0.22);
    color: #fff;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: var(--r-sm); margin-bottom: 8px;
}
.sidebar-user-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(37,99,235,0.12));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--grad-primary); color: white;
    font-size: 0.85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: #e2e8f0; }
.user-role { font-size: 0.7rem; color: rgba(255,255,255,0.35); }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-btn {
    flex: 1; padding: 8px 4px; border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.6);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-btn-danger:hover { background: rgba(244,63,94,0.2); border-color: rgba(244,63,94,0.3); color: #fca5a5; }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 24px rgba(15,23,42,0.08);
}
.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-muted); font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.15s; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .nav-icon-wrap {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.bottom-nav-item.active { color: var(--primary-dark); }
.bottom-nav-item.active .nav-icon-wrap {
    transform: scale(1.05);
    background: var(--primary-light);
    border-radius: 10px;
}
.bottom-nav-item:active .nav-icon-wrap { transform: scale(0.9); }

/* ===== FAB (Floating Action Button) ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px);
    right: 16px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white; font-size: 24px; font-weight: 300;
    border: none; cursor: pointer;
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 190;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.92); }
.fab:hover { box-shadow: 0 8px 28px rgba(99,102,241,0.5); }
.fab-label {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 74px);
    right: 16px;
    background: var(--text);
    color: white;
    font-size: 0.72rem; font-weight: 600;
    padding: 4px 10px; border-radius: var(--r-full);
    pointer-events: none; opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.fab:hover + .fab-label { opacity: 1; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    background: #0d1117;
    padding: 20px;
    position: relative; overflow: hidden;
}
.login-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
    gap: 28px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}
.login-screen::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(99,102,241,0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
.login-screen::after {
    content: '';
    position: absolute;
    top: -30%; left: -20%;
    width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-showcase {
    position: relative;
    min-height: 560px;
    border-radius: 28px;
    padding: 36px;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,0.24), transparent 34%),
        linear-gradient(180deg, rgba(9,14,20,0.92), rgba(15,27,52,0.88));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 28px 70px rgba(0,0,0,0.35);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.login-showcase-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: fit-content;
}
.login-showcase h1 {
    max-width: 580px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    font-weight: 900;
    margin-top: 22px;
}
.login-showcase > p {
    max-width: 560px;
    margin-top: 16px;
    font-size: 1rem;
    color: rgba(226,232,240,0.74);
}
.login-showcase-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}
.login-point {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}
.login-point strong {
    display: block;
    color: #f8fafc;
    font-size: 0.92rem;
}
.login-point span {
    display: block;
    margin-top: 8px;
    color: rgba(226,232,240,0.66);
    font-size: 0.82rem;
    line-height: 1.5;
}
.login-card {
    width: 100%; max-width: 380px;
    background: linear-gradient(180deg, rgba(10,15,22,0.86), rgba(16,35,37,0.82));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-xl);
    padding: 32px 28px;
    position: relative; z-index: 1;
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    justify-self: end;
    align-self: center;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo-wrap {
    width: 60px; height: 60px; border-radius: 16px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; font-weight: 900; letter-spacing: 0.14em; margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-brand h1 { font-size: 1.4rem; font-weight: 800; color: #f1f5f9; }
.login-brand p { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-card .form-group label { color: rgba(255,255,255,0.78); }
.login-card .form-control {
    background: rgba(255,255,255,0.97);
    min-height: 52px;
    font-size: 0.98rem;
}
.login-error {
    background: rgba(244,63,94,0.15); border: 1px solid rgba(244,63,94,0.3);
    color: #fca5a5; border-radius: var(--r-sm); padding: 10px 14px;
    font-size: 0.85rem;
}
.login-hint { text-align: center; margin-top: 16px; font-size: 0.75rem; color: rgba(255,255,255,0.25); }
.login-hint code { color: rgba(255,255,255,0.5); }
.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-right: 44px; }
.input-eye {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 44px; border: none; background: transparent;
    cursor: pointer; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}

/* ===== CARDS (Mobile Lists) ===== */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
}
.card:active { transform: scale(0.99); }
.card-body { padding: 14px 16px; }
.card-header-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    margin-bottom: 8px;
}
.card-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.card-meta-item { font-size: 0.75rem; color: var(--text-secondary); }
.card-actions {
    display: flex; gap: 6px; padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.card-actions .btn { flex: 1; }

/* ===== OS NUMBER BADGE ===== */
.os-number {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
    color: var(--text-muted); font-family: monospace;
}

/* ===== TABLE WRAPPER (Desktop) ===== */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 16px;
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.table-header h3 { font-size: 0.95rem; font-weight: 700; }
.table-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-search {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--r-sm); font-size: 0.85rem;
    background: var(--surface-2); width: 200px; outline: none;
    font-family: inherit; transition: border-color 0.15s;
}
.table-search:focus { border-color: var(--primary); }

table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
    padding: 10px 14px; text-align: left;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--text-muted);
    white-space: nowrap;
}
td { padding: 12px 14px; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ===== FORMS ===== */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.req { color: var(--danger); }
.form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 0.9rem; font-family: inherit; color: var(--text);
    background: var(--surface); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(244,63,94,0.14);
}

.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; min-width: 0; }
.form-actions {
    display: flex; gap: 8px;
    padding-top: 8px; justify-content: flex-end;
}
.form-actions .btn { min-width: 100px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-14 { margin-bottom: 14px; }
.w-flex-2 { flex: 2; }
.section-pad-sm { padding: 16px; }
.hidden-input-file { display: none; }
.wizard-step-pane.is-hidden { display: none; }
.print-pills-media { gap: 12px; flex-wrap: wrap; }

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: var(--r-sm); border: none;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: all 0.15s; white-space: nowrap;
    min-height: 42px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--grad-primary); color: white; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.btn-success { background: var(--grad-success); color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.btn-danger { background: var(--grad-danger); color: white; box-shadow: 0 2px 8px rgba(244,63,94,0.25); }
.btn-warning { background: var(--grad-warning); color: white; }
.btn-ghost { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; min-height: 34px; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; min-height: 28px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; min-height: 52px; border-radius: var(--r); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--r-full);
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.badge-pendente     { background: #fef3c7; color: #92400e; }
.badge-andamento    { background: #dbeafe; color: #1e40af; }
.badge-finalizado   { background: #d1fae5; color: #065f46; }
.badge-cancelado    { background: #ffe4e6; color: #9f1239; }
.badge-ativo        { background: #d1fae5; color: #065f46; }
.badge-inativo      { background: #f1f5f9; color: #64748b; }
.badge-pago         { background: #d1fae5; color: #065f46; }
.badge-pendente-com { background: #ffe4e6; color: #9f1239; }
.badge-tipo         { background: var(--primary-light); color: var(--primary-dark); }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.page-header h2 { font-size: 1rem; font-weight: 700; }

/* ===== SEARCH BAR ===== */
.search-bar-wrap { margin-bottom: 12px; }
.search-bar {
    width: 100%; padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 0.9rem; font-family: inherit; background: var(--surface);
    outline: none; transition: border-color 0.15s;
    min-height: 46px;
}
.search-bar:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-bar-wrap { position: relative; }
.search-bar-wrap::before {
    content: '🔍'; position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); font-size: 14px; pointer-events: none;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500; opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    position: fixed; z-index: 501;
    bottom: -100%; left: 0; right: 0;
    max-height: 92dvh;
    background: var(--surface);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    display: flex; flex-direction: column;
    transition: bottom 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.modal.open { bottom: 0; }
.modal.modal-lg { max-height: 96dvh; }

.modal-handle {
    width: 40px; height: 4px;
    background: var(--border-2); border-radius: var(--r-full);
    margin: 10px auto 0;
    flex-shrink: 0;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 12px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border: none; cursor: pointer;
    background: var(--surface-2); border-radius: 50%;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.15s;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body {
    flex: 1; overflow-y: auto; padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

/* ===== WIZARD (Multi-Step OS) ===== */
.wizard-overlay {
    position: fixed; inset: 0;
    z-index: 600;
    background: var(--bg);
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.wizard-overlay.open { transform: translateY(0); }

.wizard-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--surface);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.wizard-back {
    width: 40px; height: 40px; border: none; cursor: pointer;
    background: var(--surface-2); border-radius: 50%;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); flex-shrink: 0;
}
.wizard-title { font-size: 1rem; font-weight: 700; flex: 1; }
.wizard-step-indicator { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.wizard-progress {
    height: 3px; background: var(--border); flex-shrink: 0;
    position: relative; overflow: hidden;
}
.wizard-progress-fill {
    height: 100%; background: var(--grad-primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-steps { flex: 1; overflow-y: auto; position: relative; padding: 16px; }
.wizard-step-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
}
.wizard-step {
    position: absolute; inset: 0;
    overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}
.wizard-step.active { transform: translateX(0); opacity: 1; }
.wizard-step.prev { transform: translateX(-30%); opacity: 0; }

.wizard-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    background: var(--surface); border-top: 1px solid var(--border);
    display: flex; gap: 8px; flex-shrink: 0;
}
.wizard-footer .btn { flex: 1; }

.step-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px; margin-bottom: 0;
}
.step-card-title {
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--primary);
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.step-card-title::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b; color: white;
    padding: 11px 20px; border-radius: var(--r-full);
    font-size: 0.875rem; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; white-space: nowrap;
    max-width: calc(100vw - 32px);
    box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #065f46; }
.toast.error   { background: #9f1239; }
.toast.warning { background: #92400e; }

/* ===== DASHBOARD / BENTO ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}
.col-span-12 { grid-column: span 12; }
.col-span-8  { grid-column: span 12; }
.col-span-6  { grid-column: span 12; }
.col-span-4  { grid-column: span 12; }
.col-span-3  { grid-column: span 6; }

.bento-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s;
}
.bento-item.dark {
    background: var(--grad-dark); border-color: transparent;
    color: white;
}
.bento-item.glass {
    border-color: transparent;
}
.bento-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 8px; }
.bento-item.dark .bento-label { color: rgba(255,255,255,0.5); }
.bento-value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.bento-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bento-title { font-size: 0.875rem; font-weight: 700; }
.section-body { display: flex; flex-direction: column; gap: 0; }
.icon-box {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.icon-box.white { background: rgba(255,255,255,0.15); }
.icon-box.danger { background: var(--danger-light); }
.icon-box.warning { background: var(--warning-light); }
.icon-box.success { background: var(--success-light); }

.ranking-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.ranking-item:last-child { border-bottom: none; }
.ranking-pos {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-3); color: var(--text-muted);
    font-size: 0.75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ranking-pos.gold   { background: #fef3c7; color: #d97706; }
.ranking-pos.silver { background: #f1f5f9; color: #64748b; }
.ranking-pos.bronze { background: #fde8d8; color: #c2410c; }
.ranking-name { font-size: 0.875rem; font-weight: 600; }
.ranking-sub  { font-size: 0.75rem; color: var(--text-muted); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-value { font-size: 0.875rem; font-weight: 700; }
.text-gradient { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-gradient-success { background: var(--grad-success); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ===== WELCOME ===== */
.welcome-hero {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px;
    margin-bottom: 12px;
    background-image: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, transparent 60%);
}
.welcome-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.welcome-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== COMISSÃO CARDS ===== */
.comissao-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px; margin-bottom: 16px;
}
.comissao-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.comissao-card-name { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.comissao-card-pending { font-size: 1.3rem; font-weight: 800; color: var(--danger); line-height: 1.1; }
.comissao-card-pending.zero { color: var(--success-dark); }
.comissao-card-total { font-size: 0.72rem; color: var(--text-muted); }

/* ===== CHECKLIST ===== */
.checklist-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--surface-2); cursor: pointer;
    font-size: 0.83rem; font-weight: 500;
    transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.checklist-item input[type=checkbox] { display: none; }
.checklist-item .check-mark {
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border-2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.15s; font-size: 11px;
}
.checklist-item:has(input:checked) {
    background: var(--primary-light); border-color: var(--primary);
    color: var(--primary-dark);
}
.checklist-item:has(input:checked) .check-mark {
    background: var(--primary); border-color: var(--primary); color: white;
}
.checklist-item:has(input:checked) .check-mark::after { content: '✓'; }

/* ===== PECA ITEM ===== */
.peca-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--r-sm);
}
.peca-info { flex: 1; min-width: 0; }
.peca-name { font-size: 0.85rem; font-weight: 600; }
.peca-qty  { font-size: 0.75rem; color: var(--text-muted); }
.peca-actions { display: flex; align-items: center; gap: 8px; }
.peca-price { font-size: 0.9rem; font-weight: 700; color: var(--success-dark); }

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 24px; text-align: center; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 0.9rem; }
.empty-state .btn { margin-top: 16px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px; border-radius: var(--r-sm);
    font-size: 0.875rem; border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-light);  border-color: rgba(244,63,94,0.2);  color: var(--danger-dark); }
.alert-info    { background: var(--info-light);    border-color: rgba(59,130,246,0.2); color: var(--info-dark); }
.alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.2); color: var(--warning-dark); }
.alert-success { background: var(--success-light); border-color: rgba(16,185,129,0.2); color: var(--success-dark); }

/* ===== UTILITY ===== */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-green    { color: var(--success-dark); }
.text-red      { color: var(--danger); }
.text-yellow   { color: var(--warning-dark); }
.text-blue     { color: var(--info); }
.fw-semibold   { font-weight: 600; }
.fw-bold       { font-weight: 700; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.divider       { border: none; border-top: 1px solid var(--border); }
.mb-12 { margin-bottom: 12px; }
.section-title-sm {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
}

/* ===== FOTO UPLOAD ===== */
.foto-upload-area {
    border: 2px dashed var(--border-2); border-radius: var(--r);
    padding: 20px; text-align: center; cursor: pointer;
    color: var(--text-muted); font-size: 0.85rem;
    transition: all 0.15s; background: var(--surface-2);
}
.foto-upload-area:hover { border-color: var(--primary); color: var(--primary); }
.fotos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.foto-thumb {
    position: relative; border-radius: var(--r-sm); overflow: hidden;
    aspect-ratio: 1; background: var(--surface-3);
}
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.foto-thumb .foto-del {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0,0,0,0.6); border: none; cursor: pointer;
    width: 24px; height: 24px; border-radius: 50%;
    color: white; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

/* ===== OS DETAIL ===== */
.os-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.os-info-item { }
.os-info-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.os-info-value { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.os-detail-section { margin-bottom: 16px; }
.os-detail-section h4 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }

/* ===== OS PAGE HEADER ===== */
.os-header-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.os-stats-strip {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
}
.os-stat {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 10px 8px; gap: 2px;
}
.os-stat-n { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.os-stat-l { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.os-stat-and .os-stat-n { color: var(--info); }
.os-stat-pend .os-stat-n { color: var(--warning-dark); }
.os-stat-div { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ===== OS SEARCH ===== */
.os-search-wrap {
    position: relative; margin-bottom: 10px;
}
.os-search-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); font-size: 15px; pointer-events: none;
    line-height: 1;
}
.os-search {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--border); border-radius: var(--r-lg);
    font-size: 0.95rem; font-family: inherit; color: var(--text);
    background: var(--surface); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 50px;
}
.os-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.os-search::placeholder { color: var(--text-muted); }

/* ===== STATUS FILTER TABS ===== */
.status-tabs {
    display: flex; gap: 6px;
    overflow-x: auto; padding-bottom: 2px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: var(--r-full);
    font-size: 0.8rem; font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.status-tab:active { transform: scale(0.96); }
.tab-count {
    background: var(--surface-3); border-radius: 99px;
    font-size: 0.68rem; font-weight: 700; padding: 1px 7px; color: var(--text-muted);
}
.status-tab.active { color: white; border-color: transparent; background: var(--primary); }
.status-tab.active .tab-count { background: rgba(255,255,255,0.22); color: white; }
.status-tab.active.tab-andamento { background: var(--info); }
.status-tab.active.tab-pendente  { background: var(--warning-dark); }
.status-tab.active.tab-concluida { background: var(--success-dark); }
.status-tab.active.tab-cancelada { background: var(--danger-dark); }

/* ===== OS CARDS (Nova versão) ===== */
.osc-list { display: flex; flex-direction: column; gap: 10px; }

.osc {
    display: flex; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-lg);
    overflow: hidden; cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.osc:active { opacity: 0.9; }

/* Rail colorida lateral */
.osc-rail { width: 5px; flex-shrink: 0; }
.osc-rail-pendente  { background: var(--warning); }
.osc-rail-andamento { background: var(--info); }
.osc-rail-concluida,
.osc-rail-finalizado { background: var(--success); }
.osc-rail-cancelada { background: var(--danger); }
.osc-rail-urg { background: var(--danger) !important; }

.osc-body { flex: 1; padding: 13px 14px 12px; min-width: 0; }

.osc-row-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 5px;
}
.osc-num {
    font-size: 0.68rem; font-weight: 800; font-family: monospace;
    color: var(--text-muted); letter-spacing: 0.05em;
}
.osc-tempo { font-size: 0.72rem; color: var(--text-muted); }
.osc-urg-tag {
    font-size: 0.68rem; font-weight: 700;
    background: var(--danger-light); color: var(--danger-dark);
    padding: 2px 8px; border-radius: 99px;
}

.osc-name {
    font-size: 1.05rem; font-weight: 800; color: var(--text);
    line-height: 1.2; margin-bottom: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.osc-sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px;
}
.osc-cat {
    background: var(--primary-light); color: var(--primary-dark);
    padding: 1px 7px; border-radius: 99px; font-size: 0.68rem; font-weight: 700;
}
.osc-tec { color: var(--text-muted); font-size: 0.72rem; }
.osc-prob {
    font-size: 0.78rem; color: var(--text-muted); font-style: italic;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 6px;
}

.osc-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px;
}
.osc-price { font-size: 1rem; font-weight: 800; color: var(--success-dark); flex-shrink: 0; }

.osc-btns { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

/* Botões de ação no card */
.btn-osc {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 8px 12px; border-radius: var(--r-sm);
    font-size: 0.8rem; font-weight: 700; border: none; cursor: pointer;
    font-family: inherit; white-space: nowrap; min-height: 38px;
    transition: all 0.12s; -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.btn-osc:active { transform: scale(0.94); }
.btn-osc-wa   { background: #dcfce7; color: #15803d; padding: 8px 10px; }
.btn-osc-warn { background: var(--warning); color: white; }
.btn-osc-ok   { background: var(--success); color: white; }
.btn-osc-dim  { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); padding: 8px 10px; }

/* Grupos de seção */
.osc-grp-lbl {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
    padding: 10px 2px 4px; margin-top: 4px;
}
.osc-grp-lbl:first-child { margin-top: 0; padding-top: 0; }
.osc-grp-ct {
    margin-left: auto;
    background: var(--surface-3); color: var(--text-muted);
    font-size: 0.65rem; font-weight: 700; padding: 1px 8px; border-radius: 99px;
}

/* ===== OS MODAL ACTIONS ===== */
.os-modal-actions {
    display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.os-modal-actions .btn { min-width: 0; }

/* ===== BADGES ===== */
.badge-pendente  { background: #fef3c7; color: #92400e; }
.badge-andamento { background: #dbeafe; color: #1e40af; }
.badge-finalizado,
.badge-concluida { background: #d1fae5; color: #065f46; }
.badge-cancelado,
.badge-cancelada { background: #ffe4e6; color: #9f1239; }

/* ===== PRINT ===== */
.print-only { display: none; }
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body > *:not(#printArea) { display: none !important; }
    #printArea { display: block !important; }
    #printArea img { max-width: 280px !important; max-height: 200px !important; object-fit: cover; border-radius: 8px; }
}

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
    :root { --bottom-nav-h: 0px; }

    .bottom-nav { display: none; }
    .fab { display: none; }
    .fab-label { display: none; }

    .sidebar {
        position: sticky;
        transform: translateX(0);
        top: 0; height: 100dvh;
        flex-shrink: 0;
    }
    .sidebar-overlay { display: none; }
    .sidebar-close { display: none; }
    .menu-toggle { display: none; }

    .content { padding: 24px; padding-bottom: 24px; }

    .topbar-date { display: block; }

    .col-span-8  { grid-column: span 8; }
    .col-span-6  { grid-column: span 6; }
    .col-span-4  { grid-column: span 4; }
    .col-span-3  { grid-column: span 3; }

    .modal {
        inset: auto;
        top: 50%; left: 50%;
        transform: translate(-50%, -48%) scale(0.96);
        bottom: auto;
        max-width: 520px;
        width: calc(100% - 48px);
        border-radius: var(--r-xl);
        max-height: 90dvh;
        opacity: 0;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    .modal.modal-lg { max-width: 680px; }
    .modal-handle { display: none; }

    .toast {
        bottom: 24px;
        left: calc(var(--sb-width) + 50%);
        transform: translateX(-50%) translateY(20px);
    }
    .toast.show { transform: translateX(-50%) translateY(0); }

    .wizard-overlay {
        inset: auto;
        top: 0; right: 0; bottom: 0; left: var(--sb-width);
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .wizard-overlay.open { transform: translateX(0); }

    .bento-value { font-size: 2rem; }

    .card-list { display: none; }
    .osc-list { display: none !important; }
    .table-wrapper { display: block; }

    .topbar-h { --topbar-h: 60px; }

    .checklist-grid { grid-template-columns: repeat(3, 1fr); }

    .os-info-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile: hide desktop tables in pages that have card views */
@media (max-width: 767px) {
    .desktop-table { display: none !important; }
    .mobile-cards, .osc-list { display: flex !important; flex-direction: column; gap: 10px; }

    .bento-value { font-size: 1.4rem; }

    .form-row { flex-direction: column; gap: 10px; }

    .os-info-grid { grid-template-columns: 1fr 1fr; }

    .table-header-actions { width: 100%; }
    .table-header-actions .table-search { width: 100%; flex: 1; }
}

@media (max-width: 520px) {
    .modal-header,
    .modal-body,
    .wizard-topbar,
    .wizard-steps,
    .wizard-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .wizard-footer,
    .form-actions,
    .os-modal-actions {
        flex-direction: column;
    }

    .wizard-footer .btn,
    .form-actions .btn,
    .os-modal-actions .btn {
        width: 100%;
    }

    .status-mini-grid,
    .color-picker-row {
        grid-template-columns: 1fr;
    }

    .dashboard-footer-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .feed-item,
    .item-row-card,
    .service-card-top,
    .service-card-meta,
    .service-card-footer,
    .dashboard-os-top,
    .dashboard-os-meta,
    .inventory-card-top,
    .people-card-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .feed-badge-wrap,
    .item-row-side,
    .service-card-top-badges,
    .dashboard-os-badges {
        align-items: flex-start;
        width: 100%;
    }

    .service-card,
    .dashboard-os-card {
        padding: 14px;
    }

    .service-card-footer,
    .dashboard-os-meta {
        gap: 12px;
    }

    .service-card-price,
    .dashboard-os-price {
        width: 100%;
        justify-content: center;
    }

    .picker-info-line,
    .summary-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .os-detail-grid,
    .tag-check-grid,
    .status-summary-grid {
        grid-template-columns: 1fr;
    }

    .wizard-title {
        font-size: 0.92rem;
    }
}

/* ===== REFRESHED APP UI ===== */
.hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(37,99,235,0.22), transparent 30%),
        linear-gradient(145deg, #0f172a 0%, #132b57 100%);
    color: #f8fafc;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
}

.hero-kicker,
.section-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: var(--primary-dark);
}

.hero-panel .hero-kicker { color: rgba(255,255,255,0.65); }
.hero-title {
    font-size: 1.6rem;
    line-height: 1.1;
    margin-top: 6px;
    font-weight: 800;
}
.hero-copy {
    margin-top: 8px;
    color: rgba(255,255,255,0.72);
    max-width: 60ch;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.metric-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(15,23,42,0.06);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.metric-card-dark {
    background: linear-gradient(145deg, #0f172a 0%, #133336 100%);
    color: white;
}
.metric-card-highlight {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    color: white;
}
.metric-card-soft {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}
.metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.metric-card-dark .metric-label,
.metric-card-highlight .metric-label { color: rgba(255,255,255,0.72); }
.metric-value {
    display: block;
    margin-top: 8px;
    font-size: 1.4rem;
    font-weight: 800;
}

.app-section-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-grid-simple,
.config-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.color-picker-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.color-picker-input {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 4px;
    cursor: pointer;
}
.config-action-list {
    display: grid;
    gap: 12px;
}
.config-action-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.config-action-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.config-action-card strong {
    display: block;
    color: var(--text);
    font-size: 0.96rem;
}
.config-action-card span {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}
.config-action-card.danger {
    border-color: rgba(244,63,94,0.2);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,241,242,0.96));
}
.template-batch-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.template-grid {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}
.template-card {
    gap: 14px;
}
.template-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}
.template-description {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}
.template-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}
.template-toggle input {
    accent-color: var(--primary);
}
.template-variables {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.template-var-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
}
.template-editor {
    min-height: 220px;
    resize: vertical;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
}
.template-card-actions {
    display: flex;
    justify-content: flex-end;
}
.status-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.status-mini-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.status-mini-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
}
.status-mini-card strong {
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.35;
}
.status-note {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}
.dashboard-footer-note {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.96));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.dashboard-footer-note strong {
    color: var(--primary-dark);
    font-size: 0.92rem;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feed-list-spaced { margin-top: 14px; }
.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.feed-item-button {
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
}
.feed-meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.feed-side {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: right;
}
.feed-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.dashboard-os-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(15,23,42,0.06);
    background: rgba(255,255,255,0.94);
    border-radius: 20px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}
.dashboard-os-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.dashboard-os-card.pending-highlight {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 12px 30px rgba(245,158,11,0.16);
    background: linear-gradient(135deg, rgba(255,247,237,0.98), rgba(255,255,255,0.98));
    position: relative;
}
.dashboard-os-card.pending-highlight::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, #f59e0b, #f97316);
}
.dashboard-os-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.dashboard-os-id {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dashboard-os-client {
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}
.dashboard-os-top > div:first-child {
    min-width: 0;
    flex: 1;
}
.dashboard-os-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.dashboard-os-device {
    margin-top: 10px;
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.3;
}
.dashboard-os-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dashboard-os-price {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(96,165,250,0.22));
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(37,99,235,0.1);
}

.status-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.status-summary-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}
.status-summary-card span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.status-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.4rem;
}

.status-filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 2px;
}
.status-chip {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.status-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.staff-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.staff-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 700;
}
.staff-pill input {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.staff-pill.active {
    background: var(--primary-light);
    border-color: rgba(37,99,235,0.24);
    color: var(--primary-dark);
}
.staff-pill-grid.is-invalid {
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(244,63,94,0.28);
    background: rgba(255,228,230,0.38);
}

.tag-check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.tag-check {
    position: relative;
    display: block;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
}
.tag-check input {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.tag-check:has(input:checked) {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: rgba(37,99,235,0.24);
}

.photo-upload-card {
    width: 100%;
    border: 1.5px dashed rgba(37,99,235,0.3);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(96,165,250,0.12), rgba(255,255,255,0.92));
    padding: 22px;
    text-align: left;
    cursor: pointer;
}
.photo-upload-card span {
    display: block;
    font-weight: 800;
    color: var(--primary-dark);
}
.photo-upload-card small { color: var(--text-muted); }
.photo-preview-wrap { margin-top: 12px; }
.wizard-photo-preview,
.os-detail-photo,
.brand-preview,
.profile-preview {
    width: 100%;
    max-width: 180px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.profile-preview { max-width: 92px; aspect-ratio: 1; border-radius: 50%; margin-top: 10px; }
.brand-preview { margin-top: 10px; }

.item-split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.picker-card {
    padding: 16px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.picker-title {
    font-weight: 800;
    margin-bottom: 12px;
}
.picker-info-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-height: 240px;
    overflow-y: auto;
}
.search-result-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: white;
}
.search-result-main {
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.search-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-result-card.selected {
    border-color: rgba(37,99,235,0.35);
    background: linear-gradient(135deg, rgba(96,165,250,0.14), white);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.result-add-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}
.search-result-title {
    font-weight: 700;
}
.search-result-meta {
    margin-top: 3px;
    font-size: 0.76rem;
    color: var(--text-muted);
}
.search-result-price {
    font-weight: 800;
    color: var(--primary-dark);
}
.picker-empty {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--text-muted);
    text-align: center;
}

.item-row-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.item-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.item-row-main { min-width: 0; }
.item-row-title {
    font-weight: 700;
}
.item-row-meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.item-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.summary-box {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(96,165,250,0.1), rgba(255,255,255,0.96));
    border: 1px solid rgba(37,99,235,0.1);
}
.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.service-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.service-card-list-spaced { margin-top: 14px; }
.service-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(15,23,42,0.06);
    background: rgba(255,255,255,0.92);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}
.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.service-card.pending-highlight {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 12px 30px rgba(245,158,11,0.16);
    background: linear-gradient(135deg, rgba(255,247,237,0.98), rgba(255,255,255,0.98));
    position: relative;
}
.service-card.pending-highlight::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 22px 0 0 22px;
    background: linear-gradient(180deg, #f59e0b, #f97316);
}
.service-card-top,
.service-card-meta,
.service-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.service-card-top-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.service-card-id {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.service-card-name {
    font-size: 1.08rem;
    font-weight: 800;
    margin-top: 4px;
    color: var(--text);
}
.service-card-head-main {
    min-width: 0;
    flex: 1;
}
.service-card-sub {
    margin: 12px 0 10px;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.96rem;
    min-height: 0;
    line-height: 1.3;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(96,165,250,0.12);
}
.service-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-wrap: wrap;
    row-gap: 8px;
}
.service-card-meta-item {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: 100%;
}
.service-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
}
.service-card-price {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(96,165,250,0.22));
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(37,99,235,0.1);
}
.os-age-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.06);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}
.pending-highlight .os-age-badge {
    background: rgba(245,158,11,0.14);
    color: #9a3412;
}

.inventory-grid,
.people-grid,
.settings-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.grid-list-spaced { margin-top: 14px; }
.inventory-card,
.people-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.inventory-card-top,
.people-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.inventory-card-meta,
.people-card-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.inventory-card-actions,
.people-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.inventory-card-actions .btn,
.people-card-actions .btn { flex: 1; }

.service-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.service-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.detail-card {
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.detail-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.print-sheet {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px;
    background: white;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
}
.print-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #dbe4ea;
    padding-bottom: 18px;
}
.print-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.print-logo,
.print-logo-fallback {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    object-fit: cover;
}
.print-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: white;
    font-weight: 800;
}
.print-os-box {
    min-width: 180px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #dbe4ea;
    text-align: right;
}
.print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px;
}
.print-block {
    margin-top: 18px;
}
.print-block h3,
.print-grid h3 {
    margin-bottom: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
.print-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.print-pills span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75;
}
.print-device-photo {
    max-width: 240px;
    border-radius: 18px;
}
.print-table {
    width: 100%;
    border-collapse: collapse;
}
.print-table th,
.print-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 8px;
    text-align: left;
}
.print-total-box {
    margin-top: 20px;
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.print-total-box div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
}
.print-footer {
    margin-top: 28px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}
.pending-spotlight {
    border-color: rgba(245,158,11,0.25);
    background: linear-gradient(135deg, rgba(255,247,237,0.92), rgba(255,255,255,0.96));
}
.print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}
.print-signatures div {
    padding-top: 18px;
    border-top: 1px solid #94a3b8;
    text-align: center;
}

@media (min-width: 768px) {
    .login-screen {
        padding: 28px;
    }

    .hero-panel {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .metric-strip {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-grid-simple,
    .config-grid,
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .inventory-grid,
    .people-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-split-grid {
        grid-template-columns: 1fr 1fr;
    }

    .service-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .wizard-overlay {
        left: calc(var(--sb-width) + 24px);
        right: 24px;
        top: 24px;
        bottom: 24px;
        border-radius: 28px;
        overflow: hidden;
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(15,23,42,0.08);
    }

    .wizard-steps {
        padding: 20px;
    }
}

@media (max-width: 919px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .login-showcase {
        min-height: auto;
        padding: 24px;
    }

    .login-showcase h1 {
        font-size: 1.8rem;
    }

    .login-showcase-points {
        grid-template-columns: 1fr;
    }

    .login-card {
        max-width: none;
        justify-self: stretch;
    }
}

@media (min-width: 1280px) {
    .service-card-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    .print-sheet {
        padding: 0;
    }
}
