/* ═══════════════════════════════════════════════════════
   styles.css — Design System Vellovy
   v4.0: CSS separado, SLC compliant
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    --noir:          #2C1654;
    --plum:          #7B4F8E;
    --plum-light:    #9B6FAE;
    --plum-medium:   #8B5F9E;
    --rose:          #C4879A;
    --rose-light:    #F4D7E0;
    --ivory:         #FFFDF7;
    --mauve:         #E8E0F0;
    --lavender:      #F5F0FF;
    --success:       #4CAF50;
    --danger:        #f44336;
    --warning:       #ff9800;
    --info:          #2196F3;
    --txt-dark:      #2C1654;
    --txt-muted:     #6B5B7A;
    --txt-green:     #2E7D32;
    --txt-red:       #C62828;
    --bg:            linear-gradient(135deg, #f5f0ff 0%, #fff0f5 100%);
    --bg-card:       #ffffff;
    --bg-soft:       #faf8ff;
    --radius:        12px;
    --shadow:        0 4px 20px rgba(44, 22, 84, 0.15);
    --shadow-sm:     0 2px 8px rgba(44, 22, 84, 0.08);
    --sidebar-width:     280px;
    --sidebar-collapsed: 72px;
    --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg:       linear-gradient(135deg, #1a1225 0%, #2d1b2e 100%);
    --bg-card:  #2d1b3e;
    --bg-soft:  #251636;
    --ivory:    #1e1030;
    --mauve:    #4a3560;
    --txt-dark: #f5f0ff;
    --txt-muted:#b8a8c8;
    --noir:     #f5f0ff;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--txt-dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Boot Loader ── */
#boot-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 16px;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--mauve);
    border-top-color: var(--plum);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Shell ── */
#app-shell { display: none; min-height: 100vh; }
.app-container { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--noir) 0%, var(--plum) 100%);
    color: white;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); padding: 2rem 0.5rem; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label { display: none; }

.logo {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center; gap: 12px;
}

.logo-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2rem;
}

.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.nav-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem;
    color: rgba(255,255,255,0.9);
    background: transparent; border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem; width: 100%; text-align: left;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.15);
    transform: translateX(4px);
    color: white;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
    max-width: calc(100% - var(--sidebar-collapsed));
}

/* ── Header ── */
.header {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius); border: none;
    font-size: 0.95rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary {
    background: linear-gradient(135deg, var(--plum) 0%, var(--rose) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(123, 79, 142, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 79, 142, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent; color: var(--plum);
    border: 2px solid var(--plum);
}
.btn-secondary:hover { background: var(--plum); color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #d32f2f; }

.btn-ghost {
    background: transparent; color: var(--txt-muted);
    border: none; padding: 0.5rem;
}
.btn-ghost:hover { color: var(--txt-dark); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.83rem; }
.btn-xs { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 0.85rem;
    color: var(--txt-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* ── Grid ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ── KPI Cards ── */
.kpi-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--ivory) 100%);
    border-left: 4px solid var(--plum);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--txt-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-value {
    font-size: 1.8rem; font-weight: 700;
    color: var(--txt-dark);
    margin: 0.5rem 0 0.25rem;
    line-height: 1;
}

.kpi-sub {
    font-size: 0.78rem;
    color: var(--txt-muted);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; }

thead {
    background: linear-gradient(135deg, var(--noir) 0%, var(--plum) 100%);
    color: white;
}

th, td { padding: 0.9rem 1rem; text-align: left; font-size: 0.9rem; }

.td-center { text-align: center; }
.td-right  { text-align: right; }

tbody tr { border-bottom: 1px solid var(--mauve); transition: background 0.15s; }
tbody tr:hover { background: var(--bg-soft); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
    display: block; margin-bottom: 0.4rem;
    color: var(--txt-dark); font-weight: 500; font-size: 0.88rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--mauve);
    border-radius: 8px; font-size: 0.95rem;
    transition: all 0.2s;
    background: var(--ivory); color: var(--txt-dark);
    font-family: var(--font);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--plum);
    box-shadow: 0 0 0 3px rgba(123, 79, 142, 0.1);
}

input.error, select.error { border-color: var(--danger); }
.field-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; display: block; }

.input-prefix {
    position: relative;
}
.input-prefix span {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--txt-muted); font-size: 0.9rem; pointer-events: none;
}
.input-prefix input { padding-left: 28px; }

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(44, 22, 84, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center; align-items: center; padding: 2rem;
}
.modal-overlay.open { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.28s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, var(--noir) 0%, var(--plum) 100%);
    color: white; padding: 1.25rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h3 { font-size: 1rem; font-weight: 600; }

.modal-close {
    background: none; border: none; color: white;
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

.modal-body { padding: 1.5rem 2rem; }

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--mauve);
    display: flex; justify-content: flex-end; gap: 0.75rem;
    background: var(--bg-soft);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Bottom Sheet (mobile) ── */
.sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1050; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }

.sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    z-index: 1051;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90dvh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 max(20px, env(safe-area-inset-bottom));
}
.sheet.open { transform: translateY(0); }

.sheet-handle {
    width: 36px; height: 4px;
    background: var(--mauve); border-radius: 2px;
    margin: 12px auto 0;
}

.sheet-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--mauve);
}

.sheet-title { font-size: 1rem; font-weight: 600; color: var(--txt-dark); }

.sheet-body { padding: 16px 20px; }

.sheet-close {
    background: none; border: none; cursor: pointer;
    color: var(--txt-muted); padding: 4px;
    border-radius: 8px; display: flex; align-items: center;
}

/* ── Confirm Dialog ── */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }

.confirm-box {
    background: var(--bg-card);
    border-radius: var(--radius); padding: 24px;
    max-width: 360px; width: 100%; box-shadow: var(--shadow);
    transform: scale(0.95); transition: transform 0.2s;
}
.confirm-overlay.open .confirm-box { transform: scale(1); }

.confirm-title { font-size: 1rem; font-weight: 600; color: var(--txt-dark); margin-bottom: 8px; }
.confirm-msg { font-size: 0.88rem; color: var(--txt-muted); margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Badge / Tags ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.28rem 0.75rem;
    border-radius: 20px; font-size: 0.78rem; font-weight: 600;
    background: var(--mauve); color: var(--plum);
}

.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-danger  { background: #FFEBEE; color: #C62828; }
.badge-warning { background: #FFF8E1; color: #E65100; }
.badge-info    { background: #E3F2FD; color: #1565C0; }

/* ── Status badges (agenda) ── */
.status-badge { font-size: 0.72rem; padding: 3px 10px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.status-agendado  { background: #E3F2FD; color: #1565C0; }
.status-confirmado{ background: #E8F5E9; color: #2E7D32; }
.status-realizado { background: #F3E5F5; color: #6A1B9A; }
.status-cancelado { background: #FFEBEE; color: #C62828; }

/* ── Agenda Cards ── */
.agenda-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--plum);
    display: flex; align-items: center; gap: 16px;
    transition: box-shadow 0.2s, transform 0.15s;
    margin-bottom: 10px;
}
.agenda-card:hover { box-shadow: var(--shadow); transform: translateX(2px); }
.agenda-card.status-confirmado { border-left-color: var(--success); }
.agenda-card.status-realizado  { border-left-color: var(--txt-muted); }
.agenda-card.status-cancelado  { border-left-color: var(--danger); opacity: 0.6; }

.agenda-card-time  { font-size: 1.1rem; font-weight: 700; color: var(--plum); min-width: 52px; text-align: center; }
.agenda-card-info  { flex: 1; min-width: 0; }
.agenda-card-cliente { font-weight: 600; font-size: 0.93rem; }
.agenda-card-servico { font-size: 0.8rem; color: var(--txt-muted); margin-top: 2px; }
.agenda-card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── WA Link ── */
.wa-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: #25D366; color: white;
    border-radius: 50%; text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.wa-link:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(37,211,102,0.4); }

/* ── Page Tabs ── */
.page-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--mauve);
    margin-bottom: 20px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.page-tab {
    padding: 10px 20px; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    cursor: pointer; font-size: 0.88rem; color: var(--txt-muted);
    white-space: nowrap; transition: all 0.2s; font-family: var(--font);
}
.page-tab.active { color: var(--plum); border-bottom-color: var(--plum); font-weight: 600; }

/* ── Skeleton ── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.skeleton-line, .skeleton-block {
    background: var(--mauve); border-radius: 6px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-block { border-radius: var(--radius); }
.skeleton-wrap { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }

/* ── Empty State ── */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 24px; text-align: center; color: var(--txt-muted); gap: 12px;
}
.empty-state svg { opacity: 0.35; margin-bottom: 4px; }
.empty-state h3 { font-size: 1.05rem; font-weight: 600; color: var(--txt-dark); opacity: 0.7; }
.empty-state p { font-size: 0.85rem; max-width: 280px; line-height: 1.5; }

/* ── Onboarding Banner ── */
.onboarding-banner {
    background: linear-gradient(135deg, var(--lavender) 0%, #fff0f5 100%);
    border: 1px solid var(--mauve); border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 24px; position: relative;
}
.onboarding-banner h3 { color: var(--plum); margin-bottom: 4px; font-size: 1rem; }
.onboarding-banner p  { color: var(--txt-muted); font-size: 0.83rem; margin-bottom: 16px; }

.onboarding-steps { display: flex; flex-direction: column; gap: 8px; }

.onboarding-step {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.88rem; color: var(--txt-dark);
    cursor: pointer; padding: 8px 12px;
    border-radius: 8px; transition: background 0.15s;
}
.onboarding-step:hover { background: rgba(123, 79, 142, 0.05); }
.onboarding-step.done { color: var(--txt-muted); text-decoration: line-through; }

.onboarding-step-icon {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--mauve);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 0.72rem; font-weight: 700; color: var(--txt-muted);
}
.onboarding-step.done .onboarding-step-icon { background: var(--success); border-color: var(--success); color: white; }

.onboarding-dismiss {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none; cursor: pointer;
    color: var(--txt-muted); font-size: 1rem; line-height: 1;
}

.onboarding-progress { display: flex; gap: 4px; margin-bottom: 12px; }
.onboarding-progress-bar {
    height: 4px; border-radius: 2px; background: var(--mauve); flex: 1; transition: background 0.3s;
}
.onboarding-progress-bar.done { background: var(--success); }

/* ── Offline Banner ── */
.offline-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
    background: #E65100; color: white; text-align: center;
    padding: 8px 16px; font-size: 0.83rem; font-weight: 500;
    transform: translateY(-100%); transition: transform 0.3s ease;
}
.offline-banner.visible   { transform: translateY(0); }
.offline-banner.reconnected { background: var(--success); }

/* ── Bottom Nav Mobile ── */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1000; background: var(--bg-card);
    border-top: 1px solid var(--mauve);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(44, 22, 84, 0.08);
}

.bottom-nav-items {
    display: flex; justify-content: space-around; align-items: center;
    list-style: none; max-width: 480px; margin: 0 auto;
}

.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 12px; background: none; border: none; cursor: pointer;
    color: var(--txt-muted); font-size: 0.63rem; font-weight: 500;
    transition: color 0.2s; min-width: 52px; border-radius: 8px;
    font-family: var(--font);
}
.bottom-nav-item.active { color: var(--plum); }
.bottom-nav-item svg { width: 22px; height: 22px; transition: transform 0.2s; }
.bottom-nav-item.active svg { transform: translateY(-1px); }

/* ── FAB ── */
.fab {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom)); right: 20px;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--plum) 0%, var(--rose) 100%);
    color: white; border: none; cursor: pointer;
    box-shadow: 0 4px 20px rgba(123, 79, 142, 0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 900; transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover   { transform: scale(1.08); box-shadow: 0 6px 24px rgba(123, 79, 142, 0.5); }
.fab:active  { transform: scale(0.95); }

/* ── Login ── */
#page-login { display: none; min-height: 100vh; }

.login-split { display: flex; min-height: 100vh; background: var(--bg-card); }

.login-marketing {
    flex: 1; min-width: 0;
    background: linear-gradient(135deg, var(--noir) 0%, var(--plum) 100%);
    color: white;
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px; position: relative;
}

.login-form-side {
    flex: 0 0 auto; width: 480px; max-width: 100%;
    background: var(--bg-card);
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 40px; overflow-y: auto;
}

.login-tab-bar {
    display: flex; border-bottom: 2px solid var(--mauve); margin-bottom: 24px;
}
.login-tab {
    flex: 1; padding: 12px; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    cursor: pointer; font-weight: 500; color: var(--txt-muted);
    transition: all 0.2s; font-family: var(--font); font-size: 0.95rem;
}
.login-tab.active { color: var(--plum); border-bottom-color: var(--plum); font-weight: 600; }

/* ── Summary Row (Diário) ── */
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--mauve); font-size: 0.9rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--txt-muted); }
.summary-row .value { font-weight: 600; }

/* ── Profit Indicator ── */
.profit-positive { color: var(--success); }
.profit-negative { color: var(--danger); }

/* ── Report Table ── */
.report-total {
    background: linear-gradient(135deg, var(--lavender), #fff0f5);
    border-radius: var(--radius); padding: 1rem 1.5rem;
    margin-top: 1rem; display: flex; justify-content: space-between;
}

/* ── Animations ── */
.fade-in { animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Utilities ── */
.hidden { display: none !important; }
.text-muted  { color: var(--txt-muted); }
.text-green  { color: var(--txt-green); }
.text-red    { color: var(--txt-red); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-auto { margin-top: auto; }
.gap-8 { gap: 8px; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet */
@media (min-width: 769px) and (max-width: 1200px) {
    .sidebar:not(:hover) {
        width: var(--sidebar-collapsed) !important;
        padding: 2rem 0.5rem !important;
    }
    .sidebar:not(:hover) .logo-text,
    .sidebar:not(:hover) .nav-label { opacity: 0; pointer-events: none; }
    .sidebar:not(:hover) ~ .main-content {
        margin-left: var(--sidebar-collapsed) !important;
        max-width: calc(100% - var(--sidebar-collapsed)) !important;
    }
    .sidebar { transition: width 0.25s ease, padding 0.25s ease !important; }
    .logo-text, .nav-label { transition: opacity 0.2s ease; }

    .login-marketing { padding: 40px; }
    .login-form-side { width: 420px; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }

    .fab { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); width: 280px; }

    .main-content {
        margin-left: 0 !important; max-width: 100% !important; padding: 1rem;
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }

    .login-split { flex-direction: column; }
    .login-marketing { display: none; }
    .login-form-side { width: 100%; flex: 1; padding: 32px 24px; }

    .header { padding: 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .kpi-value { font-size: 1.4rem; }
    table { font-size: 0.82rem; }
    th, td { padding: 0.5rem 0.6rem; }

    .bottom-nav { display: block; }
    #btn-menu { display: none !important; }
}

@media (max-width: 400px) {
    .login-form-side { padding: 24px 16px; }
    .btn { font-size: 0.875rem; padding: 0.6rem 1rem; }
}

/* FAB: hide on desktop */
@media (min-width: 769px) { .fab { display: none; } }

/* ── Print ── */
@media print {
    .sidebar, .bottom-nav, .header, .fab,
    #btn-menu, .sheet-overlay, .offline-banner, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; max-width: 100% !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
