:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --line: #dbe4ee;
    --text: #17212b;
    --muted: #6b7a8c;
    --primary: #0d6efd;
    --accent: #11b981;
    --warning: #f59e0b;
    --danger: #e74c3c;
    --shadow: 0 20px 45px rgba(31, 45, 61, 0.08);
}
* { font-family: 'Public Sans', sans-serif; }
body {
    background: radial-gradient(circle at top left, rgba(13,110,253,.12), transparent 24%), radial-gradient(circle at right bottom, rgba(17,185,129,.10), transparent 22%), var(--bg);
    color: var(--text);
}
.auth-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-card { width: min(100%, 460px); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-radius: 28px; box-shadow: var(--shadow); padding: 2rem; border: 1px solid rgba(255,255,255,.6); }
.auth-icon, .brand-logo { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, #ffffff, #ffffff); color: #fff; font-size: 1.5rem; flex: 0 0 68px; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; transition: grid-template-columns .25s ease; }
.sidebar-panel { background: linear-gradient(180deg, #112030, #192c40); color: #fff; padding: 1.2rem; display: flex; flex-direction: column; justify-content: space-between; transition: width .25s ease, padding .25s ease; overflow: hidden; }
.brand-box { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.brand-title { font-weight: 800; font-size: 1.25rem; }
.sidebar-nav .nav-link { color: rgba(255,255,255,.82); border-radius: 14px; padding: .85rem 1rem; margin-bottom: .3rem; font-weight: 600; display: flex; align-items: center; gap: .65rem; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-nav .nav-link i { width: 24px; text-align: center; }
.content-panel { padding: 1rem 1.2rem; }
.topbar, .section-card, .metric-card, .filter-panel, .hero-panel { background: rgba(255,255,255,.95); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.75); }
.topbar { padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .7rem; }
.topbar-main { display: flex; align-items: center; gap: .9rem; }
.topbar-toggle { border-radius: 14px; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); }
.page-title { font-size: 1.55rem; font-weight: 800; }
.section-card { padding: .95rem 1rem; margin-bottom: .7rem; }
.metric-card { padding: 1.1rem; height: 100%; position: relative; overflow: hidden; }
.metric-card::after { content: ''; position: absolute; inset: auto -30px -30px auto; width: 100px; height: 100px; background: rgba(255,255,255,.25); border-radius: 50%; }
.metric-value { font-size: 1.9rem; font-weight: 800; }
.user-card { background: rgba(255,255,255,.1); border-radius: 18px; padding: .9rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.code-input { font-size: 1.2rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.quick-suggestion { border: 1px dashed var(--line); border-radius: 16px; padding: .75rem; background: #f8fbff; }
.table thead th { white-space: nowrap; }
.badge-soft-success { background: rgba(17,185,129,.15); color: #0c8c5c; }
.badge-soft-warning { background: rgba(245,158,11,.15); color: #b57400; }
.badge-soft-danger { background: rgba(231,76,60,.15); color: #c0392b; }
.filter-panel { padding: .85rem 1rem; }
.hero-panel { padding: 1.1rem 1.25rem; background: linear-gradient(135deg, rgba(13,110,253,.08), rgba(17,185,129,.08)); }
.chart-card { min-height: 100%; }
.accent-primary { background: linear-gradient(135deg, #ffffff, #eef5ff); }
.accent-success { background: linear-gradient(135deg, #ffffff, #eefcf7); }
.accent-warning { background: linear-gradient(135deg, #ffffff, #fff9ea); }
.accent-danger { background: linear-gradient(135deg, #ffffff, #fff0ee); }
.compact-sale-head { padding: .8rem 1rem; }
.compact-sale-card, .compact-totals-card { padding: .9rem 1rem; }
.compact-inline-grid { display: grid; gap: .65rem; }
.compact-inline-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.compact-table td, .compact-table th { font-size: .92rem; }
.compact-footer-row { display: grid; grid-template-columns: 1.2fr 1.2fr 1.2fr 1fr 1fr; gap: .7rem; align-items: end; }
.compact-footer-row-top { margin-top: 0; }
.compact-footer-actions { display: flex; align-items: end; }
.compact-section-gap { margin-bottom: .45rem; }
.topbar-summary-row { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: .7rem; min-width: min(100%, 430px); }
.topbar-summary-box { border-radius: 16px; padding: .75rem .95rem; border: 1px solid var(--line); }
.topbar-summary-box span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.topbar-summary-box strong { display: block; margin-top: .2rem; font-size: 1.15rem; }
.summary-neutral { background: linear-gradient(135deg, #f8fbff, #eef5ff); }
.summary-warning { background: linear-gradient(135deg, #fff7df, #ffe9a8); border-color: #f2d06b; }
.summary-success { background: linear-gradient(135deg, #e9fff3, #bbf7d0); border-color: #8fe0aa; }
.line-badge {
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .75rem;
    font-weight: 800;
}
.line-select {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.line-color-1 { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #93c5fd !important; }
.line-color-2 { background: #f5f3ff !important; color: #6d28d9 !important; border-color: #c4b5fd !important; }
.line-color-3 { background: #ecfdf5 !important; color: #047857 !important; border-color: #86efac !important; }
.line-color-4 { background: #fff7ed !important; color: #c2410c !important; border-color: #fdba74 !important; }
.line-color-5 { background: #fdf2f8 !important; color: #be185d !important; border-color: #f9a8d4 !important; }
.line-color-6 { background: #ecfeff !important; color: #0f766e !important; border-color: #67e8f9 !important; }
.line-color-7 { background: #fefce8 !important; color: #a16207 !important; border-color: #fde047 !important; }
.line-color-8 { background: #f3f4f6 !important; color: #374151 !important; border-color: #d1d5db !important; }
.line-color-empty { background: #f8fafc !important; color: #64748b !important; border-color: #cbd5e1 !important; }
.sidebar-collapsed .app-shell { grid-template-columns: 92px 1fr; }
.sidebar-collapsed .sidebar-panel { padding-left: .8rem; padding-right: .8rem; }
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .sidebar-nav .nav-link span,
.sidebar-collapsed .user-copy,
.sidebar-collapsed .user-card form { display: none; }
.sidebar-collapsed .brand-box,
.sidebar-collapsed .sidebar-nav .nav-link,
.sidebar-collapsed .user-card { justify-content: center; }
.sidebar-collapsed .sidebar-nav .nav-link { padding-left: .6rem; padding-right: .6rem; }
.sidebar-collapsed .sidebar-nav .nav-link i { margin: 0; width: auto; }

@media (max-width: 991.98px) {
    .app-shell, .sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
    .sidebar-panel { min-height: auto; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .topbar-summary-row { grid-template-columns: 1fr; min-width: 100%; width: 100%; }
    .compact-inline-grid-6, .compact-footer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .compact-inline-grid-6, .compact-footer-row { grid-template-columns: 1fr; }
}
.chart-wrap { position: relative; width: 100%; }
.chart-wrap-lg { min-height: 320px; }
.chart-wrap-sm { min-height: 320px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; display: block; }

.paste-card {
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fbff;
    padding: .9rem;
    min-height: 260px;
    outline: none;
}
.paste-card:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96,165,250,.16);
}
.paste-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.paste-card-body {
    min-height: 180px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: .75rem;
}
.paste-placeholder {
    color: #64748b;
    text-align: center;
    font-size: .95rem;
    line-height: 1.5;
}
.paste-preview {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 10px;
}
.sale-shot-preview {
    max-height: 320px;
    object-fit: contain;
    width: 100%;
    background: #f8fafc;
}
.badge-soft-primary { background: rgba(37,99,235,.15); color: #1d4ed8; }
.badge-soft-secondary { background: rgba(100,116,139,.15); color: #475569; }


.weekly-hero { background: linear-gradient(135deg, rgba(13,110,253,.08), rgba(245,158,11,.08)); }
.weekly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.weekly-card { padding: 1.1rem; }
.weekly-card-muted { opacity: .8; }
.weekly-card-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: .9rem; }
.weekly-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #eef5ff, #fff7df); color: #1d4ed8; font-size: 1.1rem; }
.weekly-month { font-size: .8rem; font-weight: 800; letter-spacing: .08em; color: #64748b; }
.weekly-range { font-size: 1.3rem; font-weight: 800; }
.weekly-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.weekly-metrics span { display: block; color: #64748b; font-size: .82rem; }
.weekly-metrics strong { display: block; font-size: 1.12rem; margin-top: .15rem; }

