* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #070b13;
    --sidebar: #0a0f1a;
    --card: #0b1220;
    --card-border: rgba(255,255,255,0.06);
    --text: #f4f6fb;
    --muted: #8a93a6;
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --green: #22c55e;
    --orange: #f97316;
    --red: #ef4444;
}

body {
    font-family: 'Inter', system-ui, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 100px;
    background: var(--sidebar);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 20px;
    gap: 4px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 10;
    overflow-y: auto;
    scrollbar-width: none;
    transition: width 0.25s ease;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 84px;
    z-index: 20;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: left 0.25s ease, transform 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}
.sidebar-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.sidebar-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Collapsed = compact icon-only rail, not fully hidden */
html.sidebar-collapsed .sidebar { width: 64px; }
html.sidebar-collapsed .main { margin-left: 64px; }
html.sidebar-collapsed .sidebar-toggle { left: 48px; transform: rotate(180deg); }
.brand-mark-mini {
    display: none;
    font-family: 'Inter', system-ui, Arial, sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    background: linear-gradient(180deg, #fdf3cf, #f2d27a 30%, #c9962e 55%, #8a6a1f 78%, #e9c463);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
html.sidebar-collapsed .brand-mark-full { display: none; }
html.sidebar-collapsed .brand-mark-mini { display: block; }
html.sidebar-collapsed .nav-item {
    width: 44px;
    padding: 10px 2px;
    gap: 0;
    font-size: 0;
}
html.sidebar-collapsed .nav-item svg { margin: 0 auto; }

@media (max-width: 768px) {
    .sidebar-toggle { display: none; }
    html.sidebar-collapsed .sidebar { width: 100%; }
}

.sidebar .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 6px 0;
    text-align: center;
}
.sidebar .logo .brand-mark {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(212,175,55,0.45));
}
.sidebar .logo .brand-text {
    font-family: 'Inter', system-ui, Arial, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 3px;
    line-height: 1.1;
    background: linear-gradient(180deg, #fdf3cf, #f2d27a 30%, #c9962e 55%, #8a6a1f 78%, #e9c463);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.sidebar .logo .brand-tour { display: block; }
.sidebar .logo .brand-tour::after {
    content: "";
    display: block;
    width: 100%;
    height: 2.5px;
    margin-top: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(212,175,55,0), #d4af37 30%, #f2d27a 50%, #d4af37 70%, rgba(212,175,55,0));
    box-shadow: 0 0 10px rgba(212,175,55,0.6);
}

.nav-item {
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 6px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    transition: all 0.2s ease;
    text-align: center;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }

.nav-item.active {
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(59,130,246,0.18));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(139,92,246,0.35);
}

.nav-item.nav-expense {
    color: var(--orange);
    background: linear-gradient(135deg, rgba(249,115,22,0.14), rgba(249,115,22,0.03));
    box-shadow: inset 0 0 0 1px rgba(249,115,22,0.35);
}

.nav-item.nav-expense:hover {
    color: #ffb37a;
    box-shadow: inset 0 0 0 1px rgba(249,115,22,0.6), 0 0 16px rgba(249,115,22,0.22);
}

.nav-item.nav-ai {
    color: var(--purple);
    background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(139,92,246,0.03));
    box-shadow: inset 0 0 0 1px rgba(139,92,246,0.35);
}

.nav-item.nav-ai:hover {
    color: #c4b5fd;
    box-shadow: inset 0 0 0 1px rgba(139,92,246,0.6), 0 0 16px rgba(139,92,246,0.22);
}

/* AI FLOATING BUTTON */
.ai-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8, #0ea5e9);
    box-shadow: 0 10px 28px rgba(29,78,216,0.45), 0 0 0 1px rgba(255,255,255,0.1) inset;
    z-index: 60;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: ai-fab-pulse 2.6s ease-in-out infinite;
}

.ai-fab:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 14px 36px rgba(29,78,216,0.6), 0 0 0 1px rgba(255,255,255,0.16) inset;
    animation-play-state: paused;
}

.ai-fab svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

.ai-fab-sparkle {
    position: absolute;
    color: #fde047;
    text-shadow: 0 0 6px rgba(253,224,71,0.8);
    pointer-events: none;
    animation: ai-fab-twinkle 1.8s ease-in-out infinite;
}

.ai-fab-sparkle-1 { top: -8px; right: -6px; font-size: 16px; animation-delay: 0s; }
.ai-fab-sparkle-2 { bottom: 0; left: -12px; font-size: 11px; animation-delay: 0.5s; }
.ai-fab-sparkle-3 { top: 4px; left: -18px; font-size: 9px; animation-delay: 1s; }

@keyframes ai-fab-pulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(29,78,216,0.45), 0 0 0 1px rgba(255,255,255,0.1) inset; }
    50% { box-shadow: 0 10px 34px rgba(14,165,233,0.55), 0 0 0 1px rgba(255,255,255,0.14) inset; }
}

@keyframes ai-fab-twinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.75) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

@media (max-width: 768px) {
    .ai-fab { right: 20px; bottom: 92px; width: 52px; height: 52px; }
    .ai-fab svg { width: 22px; height: 22px; }
}

/* ===== MAIN ===== */
.main {
    margin-left: 100px;
    flex: 1;
    padding: 24px 28px;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

/* TOP BAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.topbar-title h1 { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.topbar-title p { font-size: 13px; color: var(--muted); margin-top: 2px; }

.search {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.search:hover { border-color: rgba(139,92,246,0.35); }

.search:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15), 0 6px 20px rgba(0,0,0,0.25);
    background: rgba(139,92,246,0.04);
}

.search .search-icon { transition: stroke 0.2s ease; }
.search:focus-within .search-icon { stroke: var(--purple); }

.search svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; flex-shrink: 0; }

.search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    width: 100%;
}

.search input::placeholder { color: var(--muted); opacity: 0.8; }

.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.icon-btn {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.icon-btn:hover { color: #fff; border-color: rgba(255,255,255,0.15); }

.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }



/* ===== NOTIFICATION CENTER ===== */
.notif-wrap { position: relative; }

.notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 370px;
    max-width: 90vw;
    background: linear-gradient(160deg, #10141f 0%, #0d1120 100%);
    border: 1px solid rgba(139,92,246,0.18);
    border-radius: 18px;
    box-shadow:
        0 24px 60px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.03),
        0 0 40px rgba(139,92,246,0.08);
    z-index: 60;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity .22s cubic-bezier(.4,0,.2,1), transform .22s cubic-bezier(.4,0,.2,1);
}
.notif-wrap.open .notif-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(59,130,246,0.08));
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.notif-badge {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    padding: 3px 10px;
    box-shadow: 0 2px 8px rgba(249,115,22,0.35);
    animation: notif-pulse 2s ease-in-out infinite;
}
@keyframes notif-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(249,115,22,0.35); }
    50%      { box-shadow: 0 2px 16px rgba(249,115,22,0.55); }
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.25) transparent;
}
.notif-list::-webkit-scrollbar { width: 5px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb {
    background: rgba(139,92,246,0.25);
    border-radius: 10px;
}
.notif-list::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.45); }

.notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    border-left: 3px solid transparent;
    transition: all .2s ease;
    cursor: default;
}
.notif-item:hover {
    background: rgba(139,92,246,0.08);
    border-left-color: var(--purple);
}

.notif-qty {
    flex: 0 0 auto;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(59,130,246,0.15));
    border: 1px solid rgba(139,92,246,0.35);
    color: var(--purple);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.notif-item:hover .notif-qty {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(139,92,246,0.3);
}

.notif-info { min-width: 0; flex: 1; }
.notif-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.75;
}

.notif-empty {
    padding: 28px 18px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}
.notif-empty::before {
    content: "🔔";
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* bell dot badge */
.icon-btn .dot {
    position: absolute; top: 6px; right: 6px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--card);
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
    animation: dot-pop .3s cubic-bezier(.4,0,.2,1);
}
.icon-btn .dot.dot-hide { display: none; }
@keyframes dot-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--card);
}

.avatar {
    width: 38px; height: 38px; border-radius: 12px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 15px;
}

.user .info { line-height: 1.2; }
.user .info .name { font-size: 14px; font-weight: 600; }
.user .info .role { font-size: 12px; color: var(--muted); }

/* WELCOME */
.welcome { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.welcome h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.welcome p { color: var(--muted); font-size: 14px; }
.hero-3d {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}
.hero-3d-logo {
    width: 92px;
    height: auto;
    transform-style: preserve-3d;
    filter: drop-shadow(0 10px 22px rgba(139,92,246,0.5));
    animation: hero-logo-spin 7s linear infinite;
}
@keyframes hero-logo-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}
@media (max-width: 768px) { .hero-3d { display: none; } }

/* STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.stat-card .stat-label {
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}

.stat-card .stat-label svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.stat-card .stat-value { font-size: 32px; font-weight: 800; }
.stat-card .stat-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

.stat-purple::before { background: var(--purple); }
.stat-blue::before    { background: var(--blue); }
.stat-green::before   { background: var(--green); }
.stat-orange::before  { background: var(--orange); }

.stat-purple .stat-label { color: var(--purple); }
.stat-blue .stat-label    { color: var(--blue); }
.stat-green .stat-label   { color: var(--green); }
.stat-orange .stat-label  { color: var(--orange); }

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 26px; font-weight: 800; }
.page-header .page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* EXPENSE ACCENT */
.page-header.expense-header {
    border-left: 4px solid var(--orange);
    padding-left: 16px;
    align-items: center;
}
.page-header.expense-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header.expense-header h1 svg {
    width: 26px; height: 26px;
    stroke: var(--orange);
    fill: none;
    stroke-width: 2;
}
.btn-expense {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
}
.btn-expense:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(249,115,22,0.35); }
.tag.tag-expense {
    background: rgba(249,115,22,0.15);
    color: var(--orange);
}
.expense-summary {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.expense-summary .sum-card {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, rgba(249,115,22,0.14), rgba(249,115,22,0.03));
    border: 1px solid rgba(249,115,22,0.35);
    border-radius: 16px;
    padding: 16px 20px;
}
.expense-summary .sum-card .sum-label {
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 6px;
}
.expense-summary .sum-card .sum-value { font-size: 26px; font-weight: 800; color: var(--text); }
.expense-summary .sum-card .sum-value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.confirm-card .confirm-icon.icon-expense {
    background: rgba(249,115,22,0.12);
    color: var(--orange);
}

/* CARD */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px;
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }

/* LOWER GRID */
.lower {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

/* WAREHOUSE MAP */
.map {
    position: relative;
    height: 320px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 20% 30%, rgba(139,92,246,0.12), transparent 40%),
        radial-gradient(circle at 75% 60%, rgba(59,130,246,0.12), transparent 45%),
        var(--bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map svg.map-svg {
    width: 130%;
    height: 100%;
    transform: translateX(-14%);
}

.map .pin {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 12px currentColor;
}

.map .loc { position: absolute; font-size: 11px; color: var(--muted); }

/* SKLADI LIST */
.skladi-list {
    position: absolute;
    top: 16px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 330px;
    z-index: 5;
}
.skladi {
    position: static;
    width: 100%;
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(59,130,246,0.14));
    border: 1px solid rgba(139,92,246,0.35);
    border-left: 4px solid var(--purple);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    letter-spacing: 0.2px;
    cursor: pointer;
    text-align: left;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.skladi-main { min-width: 0; }
.skladi .skladi-city { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.skladi .skladi-addr {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.skladi .skladi-count {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
    color: var(--purple);
    background: rgba(139,92,246,0.16);
    border-radius: 8px;
    padding: 4px 10px;
}
.skladi .skladi-count small { font-size: 12px; font-weight: 600; color: var(--muted); }
.skladi-empty {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    color: var(--muted);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

/* SKLADI OVERVIEW (home, superuser) */
.skladi-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 6px;
}
.sklado {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(139,92,246,0.16), rgba(59,130,246,0.10));
    border: 1px solid rgba(139,92,246,0.28);
    border-radius: 12px;
    padding: 12px 14px;
}
.sklado-icon {
    font-size: 26px;
    line-height: 1;
}
.sklado-info { min-width: 0; flex: 1; }
.sklado-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sklado-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sklado-count {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 800;
    color: var(--purple);
    background: rgba(139,92,246,0.16);
    border-radius: 8px;
    padding: 4px 10px;
}
.sklado-count small { font-size: 12px; font-weight: 600; color: var(--muted); }
.sklado-empty {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    color: var(--muted);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

/* CLICKABLE SKLAD PIN -> opens real map modal */
.sklad-pin {
    cursor: pointer;
}
.sklad-pin .dushanbe-text {
    transition: fill .2s ease;
}
.sklad-pin:hover .dushanbe-text { fill: #ffffff; }
.sklad-pin:hover .dushanbe-dot {
    filter: drop-shadow(0 0 10px rgba(139,92,246,1));
}
.sklad-pin .dushanbe-dot {
    transform-box: fill-box;
    transform-origin: center;
}
/* click "boom" burst animation */
.sklad-pin.boom .dushanbe-dot { animation: marker-boom .6s ease; }
@keyframes marker-boom {
    0%   { transform: scale(1); }
    30%  { transform: scale(2.2); }
    100% { transform: scale(1); }
}

button.skladi {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
.skladi:hover {
    border-color: rgba(139,92,246,0.6);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}
@media (max-width: 720px) {
    .skladi-list { position: static; max-width: 100%; margin-top: 14px; }
    .skladi .skladi-addr { max-width: none; }
}

/* ===== KORVON MAP MODAL ===== */
.map-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.map-modal.open { opacity: 1; visibility: visible; }
.map-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4,6,12,0.7);
    backdrop-filter: blur(4px);
}
.map-modal-box {
    position: relative;
    width: min(900px, 100%);
    background: #10131d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    transform: translateY(10px) scale(0.98);
    transition: transform .25s ease;
}
.map-modal.open .map-modal-box { transform: translateY(0) scale(1); }
.map-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(59,130,246,0.10));
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.map-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}
.map-modal-sub {
    font-size: 13px;
    color: rgba(203,213,225,0.7);
    margin-top: 2px;
}
.map-modal-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.map-modal-close:hover { background: rgba(239,68,68,0.2); transform: rotate(90deg); }
.map-modal-body {
    height: 60vh;
    min-height: 340px;
    background: #0b0e17;
}
.map-modal-body .leaflet-container { background: #0b0e17; }

/* city -> sklad list view inside modal */
.city-sklads-list {
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.city-sklad-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
    background: #171c26;
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.city-sklad-row:hover { border-color: rgba(139,92,246,0.7); background: #1d2330; }
.city-sklad-row b { font-size: 15px; }
.city-sklad-row .city-sklad-name {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--purple, #a78bfa);
}
.city-sklad-row .city-sklad-addr { font-size: 12.5px; color: var(--muted); }
.map-view { height: 100%; }
.map-view .leaflet-container { width: 100%; height: 100%; }

.leaflet-popup-content-wrapper {
    background: #171c26;
    color: #fff;
    border: 1px solid rgba(139,92,246,0.4);
    border-radius: 10px;
}
.leaflet-popup-content { font-family: inherit; text-align: center; }
.leaflet-popup-tip { background: #171c26; border: 1px solid rgba(139,92,246,0.4); }

/* custom Korvon pin */
.korvon-marker .korvon-pin {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: 3px solid #fff;
    transform: rotate(-45deg);
    box-shadow: 0 0 16px rgba(139,92,246,0.9);
}
.korvon-marker .korvon-pin::after {
    content: '';
    position: absolute;
    top: 5px; left: 5px;
    width: 8px; height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* SALES CHART */
.chart-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; }
.chart-wrap { height: 220px; display: flex; align-items: flex-end; gap: 6px; padding-top: 10px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--purple), rgba(139,92,246,0.15)); border-radius: 6px 6px 2px 2px; }

/* BOTTOM GRID */
.bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}


/* PRODUCTS */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    transition: all 0.2s ease;
}

.product-item:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.12); }

.product-item img, .product-item .thumb {
    width: 48px; height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
    display: flex; align-items: center; justify-content: center;
}

.product-item .p-name { font-size: 13px; font-weight: 600; }
.product-item .p-qty { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* EXPENSES */
.expense-list { display: flex; flex-direction: column; }

.expense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}

.expense-row:last-child { border-bottom: none; }

.expense-row .e-name { font-size: 14px; font-weight: 500; }
.expense-row .e-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.expense-row .e-price { font-size: 14px; font-weight: 700; color: var(--orange); text-align: right; }
.expense-row .e-date { font-size: 12px; color: var(--muted); }

.empty {
    color: var(--muted);
    font-size: 14px;
    padding: 32px;
    text-align: center;
}
.empty .empty-icon { font-size: 34px; margin-bottom: 8px; }

/* AI CHAT */
.ai-chat {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    height: calc(100vh - 220px);
    min-height: 420px;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-msg { display: flex; }
.ai-msg-model { justify-content: flex-start; }
.ai-msg-user { justify-content: flex-end; }

.ai-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ai-msg-model .ai-bubble {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.ai-msg-user .ai-bubble {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-typing .ai-bubble { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }

.ai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: ai-typing 1.2s infinite ease-in-out;
}
.ai-dot:nth-child(2) { animation-delay: 0.15s; }
.ai-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.ai-chat-input {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--card-border);
}

.ai-chat-input input {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-chat-input input:focus { border-color: var(--purple); }
.ai-chat-input input::placeholder { color: var(--muted); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', system-ui, Arial, sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(139,92,246,0.3); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--card-border); }
.btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.15); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text);
    vertical-align: middle;
}
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

td .thumb-photo {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
td .muted { color: var(--muted); }
td .tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(139,92,246,0.15);
    color: var(--purple);
}
td .amount { font-weight: 700; }
td .amount.pos { color: var(--green); }
td .amount.org { color: var(--orange); }

.row-actions { display: flex; gap: 8px; }

/* FORMS */
.form-card { max-width: 560px; width: 100%; margin: 0 auto; }
.form-grid { display: grid; gap: 18px; }
.form-group { display: grid; gap: 8px; }
.form-group label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', system-ui, Arial, sans-serif;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }

.file-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-group .file-upload-input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.file-upload-preview {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
    font-weight: 700; font-size: 20px; color: var(--text);
}
.file-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-upload-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-upload-btn { cursor: pointer; }
.file-upload-name { font-size: 13px; color: var(--muted); }
.form-errors { display: grid; gap: 8px; }
.form-error {
    font-size: 13px;
    color: var(--red);
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 8px 12px;
}
.form-actions { display: flex; gap: 12px; margin-top: 22px; align-items: center; }

/* FLASH */
.flash { margin-bottom: 18px; display: grid; gap: 10px; }
.alert {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04));
    border: 1px solid rgba(34,197,94,0.3);
    border-left: 4px solid var(--green);
    color: var(--green);
    box-shadow: 0 4px 16px rgba(34,197,94,0.1);
    animation: alert-slide .3s ease;
}
.alert.error {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));
    border-color: rgba(239,68,68,0.3);
    border-left-color: var(--red);
    color: var(--red);
    box-shadow: 0 4px 16px rgba(239,68,68,0.1);
}
@keyframes alert-slide {
    0%   { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* CONFIRM */
.confirm-card { max-width: 480px; width: 100%; margin: 0 auto; text-align: center; }
.confirm-card .confirm-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: rgba(239,68,68,0.12);
    display: flex; align-items: center; justify-content: center;
    color: var(--red);
}
.confirm-card .confirm-icon svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.confirm-card h3 { font-size: 20px; font-weight: 800; }
.confirm-card p { color: var(--muted); font-size: 14px; margin: 10px 0 22px; }
.confirm-card p b { color: var(--text); }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== PRODUCT LIST ===== */
.pr-header { border-left: 4px solid #14b8a6; padding-left: 16px; align-items: center; }
.pr-header h1 { display: flex; align-items: center; gap: 10px; }
.pr-header h1 svg { width: 26px; height: 26px; stroke: #14b8a6; fill: none; stroke-width: 2; }

.pr-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.pr-summary .sum-card {
    flex: 1; min-width: 200px;
    background: linear-gradient(135deg, rgba(20,184,166,0.14), rgba(20,184,166,0.03));
    border: 1px solid rgba(20,184,166,0.3);
    border-radius: 16px; padding: 16px 20px;
}
.pr-summary .sum-card .sum-label {
    font-size: 11px; letter-spacing: 1px; font-weight: 700;
    text-transform: uppercase; color: #14b8a6; margin-bottom: 6px;
}
.pr-summary .sum-card .sum-value { font-size: 26px; font-weight: 800; color: var(--text); }
.pr-summary .sum-card .sum-value small { font-size: 13px; font-weight: 600; color: var(--muted); }

.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.pr-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pr-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.pr-card > a { display: block; cursor: pointer; text-decoration: none; }
.pr-photo {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(20,184,166,0.3), rgba(59,130,246,0.3));
    display: flex; align-items: center; justify-content: center;
    font-size: 64px;
    border-bottom: 1px solid var(--card-border);
    transition: filter 0.15s ease;
}
.pr-card > a:hover .pr-photo { filter: brightness(1.08); }
.pr-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pr-name { font-size: 17px; font-weight: 800; line-height: 1.25; }
.pr-code { font-size: 12px; color: var(--muted); }
.pr-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-badge {
    font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--muted);
    border-radius: 20px; padding: 3px 10px;
}
.pr-badge.teal { background: rgba(20,184,166,0.12); color: #2dd4bf; border-color: rgba(20,184,166,0.3); }
.pr-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.pr-price {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px; padding: 10px;
}
.pr-price .pp-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); }
.pr-price .pp-value { font-size: 17px; font-weight: 800; margin-top: 2px; }
.pr-price .pp-value.pos { color: var(--green); }
.pr-price .pp-value.org { color: var(--orange); }
.pr-actions { display: flex; gap: 8px; margin-top: 4px; }
.empty-pr { color: var(--muted); font-size: 14px; padding: 48px; text-align: center; border: 1px dashed var(--card-border); border-radius: 18px; }

/* ===== PRODUCT DETAIL ===== */
.pd-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pd-layout { display: grid; grid-template-columns: 420px 1fr; gap: 22px; align-items: start; }
.pd-photo-wrap {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
}
.pd-photo {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: flex; align-items: center; justify-content: center;
    font-size: 96px;
    background: linear-gradient(135deg, rgba(20,184,166,0.3), rgba(59,130,246,0.3));
}
.pd-info {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.pd-code { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; color: #2dd4bf; }
.pd-name { font-size: 30px; font-weight: 800; line-height: 1.2; }
.pd-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-badge {
    font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--muted);
    border-radius: 20px; padding: 5px 12px;
}
.pd-badge.teal { background: rgba(20,184,166,0.12); color: #2dd4bf; border-color: rgba(20,184,166,0.3); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pd-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 14px; padding: 14px;
}
.pd-box .pm-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); }
.pd-box .pm-value { font-size: 20px; font-weight: 800; margin-top: 4px; }
.pd-box .pm-value.pos { color: var(--green); }
.pd-box .pm-value.org { color: var(--orange); }
.pd-desc-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); }
.pd-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }
.pd-dates { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--card-border); padding-top: 14px; }

/* ===== CATEGORY LIST ===== */
.cat-header { border-left: 4px solid var(--purple); padding-left: 16px; align-items: center; }
.cat-header h1 { display: flex; align-items: center; gap: 10px; }
.cat-header h1 svg { width: 26px; height: 26px; stroke: var(--purple); fill: none; stroke-width: 2; }

.cat-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-summary .sum-card {
    flex: 1; min-width: 200px;
    background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(59,130,246,0.04));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 16px; padding: 16px 20px;
}
.cat-summary .sum-card .sum-label {
    font-size: 11px; letter-spacing: 1px; font-weight: 700;
    text-transform: uppercase; color: var(--purple); margin-bottom: 6px;
}
.cat-summary .sum-card .sum-value { font-size: 26px; font-weight: 800; color: var(--text); }
.cat-summary .sum-card .sum-value small { font-size: 13px; font-weight: 600; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.cat-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--purple), var(--blue));
}
.cat-top { display: flex; align-items: center; gap: 13px; }
.cat-avatar {
    width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px;
    background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(59,130,246,0.35));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.cat-name { font-size: 17px; font-weight: 800; line-height: 1.2; }
.cat-count { font-size: 12px; font-weight: 700; color: var(--purple); }
.cat-desc {
    font-size: 13px; color: var(--muted); line-height: 1.5;
    border-top: 1px dashed var(--card-border); padding-top: 12px;
    flex: 1;
}
.cat-actions { display: flex; gap: 8px; }
.empty-cat { color: var(--muted); font-size: 14px; padding: 48px; text-align: center; border: 1px dashed var(--card-border); border-radius: 18px; }

/* ===== CATEGORY DETAIL ===== */
.cd-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cd-layout { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.cd-side {
    background: linear-gradient(160deg, rgba(139,92,246,0.16), rgba(59,130,246,0.06));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 18px; padding: 24px; text-align: center;
    position: sticky; top: 24px;
}
.cd-icon {
    width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(59,130,246,0.35));
    display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.cd-side h1 { font-size: 24px; font-weight: 800; }
.cd-side .cd-count { font-size: 13px; color: var(--purple); font-weight: 700; margin-top: 4px; }
.cd-desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 16px; border-top: 1px dashed rgba(139,92,246,0.3); padding-top: 16px; }
.cd-main { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 22px; }
.cd-main h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.cd-list { display: grid; gap: 12px; }
.cd-item {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--card-border);
    border-radius: 14px; padding: 12px; text-decoration: none; color: inherit;
    transition: all 0.2s ease;
}
.cd-item:hover { transform: translateY(-2px); border-color: rgba(139,92,246,0.4); }
.cd-item img, .cd-item .thumb {
    width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; object-fit: cover;
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cd-item .ci-name { font-size: 14px; font-weight: 700; }
.cd-item .ci-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cd-item .ci-price { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--orange); text-align: right; }
.cd-item .ci-price small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.empty-cd { color: var(--muted); font-size: 14px; padding: 40px; text-align: center; border: 1px dashed var(--card-border); border-radius: 14px; }

/* ===== COUNTRY / SUPPLIER LIST ===== */
.sup-header { border-left: 4px solid var(--blue); padding-left: 16px; align-items: center; }
.sup-header h1 { display: flex; align-items: center; gap: 10px; }
.sup-header h1 svg { width: 26px; height: 26px; stroke: var(--blue); fill: none; stroke-width: 2; }

.sup-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.sup-summary .sum-card {
    flex: 1; min-width: 200px;
    background: linear-gradient(135deg, rgba(59,130,246,0.14), rgba(59,130,246,0.03));
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 16px; padding: 16px 20px;
}
.sup-summary .sum-card .sum-label {
    font-size: 11px; letter-spacing: 1px; font-weight: 700;
    text-transform: uppercase; color: var(--blue); margin-bottom: 6px;
}
.sup-summary .sum-card .sum-value { font-size: 26px; font-weight: 800; color: var(--text); }
.sup-summary .sum-card .sum-value small { font-size: 13px; font-weight: 600; color: var(--muted); }

.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.sup-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sup-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.sup-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--blue), #38bdf8);
}
.sup-top { display: flex; align-items: center; gap: 13px; }
.sup-avatar {
    width: 50px; height: 50px; flex-shrink: 0; border-radius: 14px;
    background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(34,211,238,0.3));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.sup-name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.sup-shop { font-size: 13px; font-weight: 700; color: var(--blue); margin-top: 2px; }
.sup-details { display: grid; gap: 10px; }
.sup-detail { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sup-detail svg { width: 16px; height: 16px; stroke: var(--blue); fill: none; stroke-width: 2; flex-shrink: 0; }
.sup-detail b { color: var(--text); font-weight: 600; }
.sup-products {
    font-size: 12px; font-weight: 700; color: var(--blue);
    background: rgba(59,130,246,0.1); border-radius: 8px; padding: 4px 10px; align-self: flex-start;
}
.sup-desc {
    font-size: 13px; color: var(--muted); line-height: 1.5;
    border-top: 1px dashed var(--card-border); padding-top: 12px;
    flex: 1;
}
.sup-actions { display: flex; gap: 8px; }
.empty-sup { color: var(--muted); font-size: 14px; padding: 48px; text-align: center; border: 1px dashed var(--card-border); border-radius: 18px; }

/* ===== COUNTRY / SUPPLIER DETAIL ===== */
.sd-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sd-layout { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.sd-side {
    background: linear-gradient(160deg, rgba(59,130,246,0.16), rgba(34,211,238,0.06));
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 18px; padding: 24px;
    position: sticky; top: 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.sd-icon {
    width: 72px; height: 72px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(34,211,238,0.3));
    display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.sd-side h1 { font-size: 24px; font-weight: 800; line-height: 1.2; }
.sd-shop { font-size: 14px; font-weight: 700; color: var(--blue); }
.sd-detail { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sd-detail svg { width: 16px; height: 16px; stroke: var(--blue); fill: none; stroke-width: 2; flex-shrink: 0; }
.sd-detail b { color: var(--text); font-weight: 600; }
.sd-desc { font-size: 13px; color: var(--muted); line-height: 1.6; border-top: 1px dashed rgba(59,130,246,0.3); padding-top: 14px; }
.sd-count { font-size: 12px; font-weight: 700; color: var(--blue); background: rgba(59,130,246,0.1); border-radius: 8px; padding: 5px 10px; align-self: flex-start; }
.sd-main { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 22px; }
.sd-main h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.sd-list { display: grid; gap: 12px; }
.sd-item {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--card-border);
    border-radius: 14px; padding: 12px; text-decoration: none; color: inherit;
    transition: all 0.2s ease;
}
.sd-item:hover { transform: translateY(-2px); border-color: rgba(59,130,246,0.4); }
.sd-item img, .sd-item .thumb {
    width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; object-fit: cover;
    background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(34,211,238,0.3));
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.sd-item .si-name { font-size: 14px; font-weight: 700; }
.sd-item .si-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sd-item .si-price { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--orange); text-align: right; }
.sd-item .si-price small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.empty-sd { color: var(--muted); font-size: 14px; padding: 40px; text-align: center; border: 1px dashed var(--card-border); border-radius: 14px; }

/* ===== EXPENSE DETAIL ===== */
.ed-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ed-layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.ed-side {
    background: linear-gradient(160deg, rgba(249,115,22,0.16), rgba(249,115,22,0.04));
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 18px; padding: 26px; text-align: center;
    position: sticky; top: 24px;
}
.ed-icon {
    width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(249,115,22,0.35), rgba(245,158,11,0.3));
    display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.ed-type {
    display: inline-block; font-size: 12px; font-weight: 700;
    background: rgba(249,115,22,0.15); color: var(--orange);
    border-radius: 20px; padding: 5px 14px; margin-bottom: 10px;
}
.ed-side h1 { font-size: 22px; font-weight: 800; line-height: 1.25; }
.ed-total-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-top: 18px; }
.ed-total { font-size: 38px; font-weight: 800; color: var(--orange); margin-top: 4px; }
.ed-total small { font-size: 16px; font-weight: 600; color: var(--muted); }
.ed-dates { font-size: 12px; color: var(--muted); border-top: 1px dashed rgba(249,115,22,0.3); padding-top: 14px; margin-top: 18px; }
.ed-main { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 22px; }
.ed-main h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ed-box { background: rgba(255,255,255,0.02); border: 1px solid var(--card-border); border-radius: 14px; padding: 14px; }
.ed-box .pm-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); }
.ed-box .pm-value { font-size: 20px; font-weight: 800; margin-top: 4px; }
.ed-box .pm-value.org { color: var(--orange); }
.ed-desc-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; }
.ed-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }
.ed-product {
    margin-top: 18px; display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 12px; text-decoration: none; color: inherit;
}
.ed-product:hover { border-color: rgba(249,115,22,0.4); }
.ed-product img, .ed-product .thumb {
    width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
    background: linear-gradient(135deg, rgba(249,115,22,0.3), rgba(245,158,11,0.3));
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.ed-product .ep-name { font-size: 14px; font-weight: 700; }
.ed-product .ep-meta { font-size: 12px; color: var(--muted); }
.ed-product .ep-go { margin-left: auto; color: var(--orange); font-weight: 700; font-size: 13px; }

/* ===== EMPLOYEES LIST ===== */
.emp-header { border-left: 4px solid var(--green); padding-left: 16px; align-items: center; }
.emp-header h1 { display: flex; align-items: center; gap: 10px; }
.emp-header h1 svg { width: 26px; height: 26px; stroke: var(--green); fill: none; stroke-width: 2; }
.ai-header h1 svg { width: 26px; height: 26px; stroke: var(--purple); fill: none; stroke-width: 2; }

.emp-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.emp-summary .sum-card {
    flex: 1; min-width: 200px;
    background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.02));
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 16px; padding: 16px 20px;
}
.emp-summary .sum-card .sum-label {
    font-size: 11px; letter-spacing: 1px; font-weight: 700;
    text-transform: uppercase; color: var(--green); margin-bottom: 6px;
}
.emp-summary .sum-card .sum-value { font-size: 26px; font-weight: 800; color: var(--text); }
.emp-summary .sum-card .sum-value small { font-size: 13px; font-weight: 600; color: var(--muted); }

.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.emp-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.emp-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.emp-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--green), #34d399);
}
.emp-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.emp-avatar {
    width: 54px; height: 54px; flex-shrink: 0; border-radius: 16px;
    background: linear-gradient(135deg, rgba(34,197,94,0.35), rgba(59,130,246,0.35));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.emp-name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.emp-shop { font-size: 13px; color: var(--green); font-weight: 600; margin-top: 3px; }
.emp-details { display: grid; gap: 10px; }
.emp-detail { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.emp-detail svg { width: 16px; height: 16px; stroke: var(--green); fill: none; stroke-width: 2; flex-shrink: 0; }
.emp-detail b { color: var(--text); font-weight: 600; }
.emp-desc {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px dashed var(--card-border);
    font-size: 13px; color: var(--muted); line-height: 1.5;
}
.empty-emp { color: var(--muted); font-size: 14px; padding: 48px; text-align: center; border: 1px dashed var(--card-border); border-radius: 18px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .lower { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .bottom { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .pd-layout { grid-template-columns: 1fr; }
    .cd-layout { grid-template-columns: 1fr; }
    .cd-side { position: static; }
    .sd-layout { grid-template-columns: 1fr; }
    .sd-side { position: static; }
    .ed-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main { margin-left: 0; padding: 16px 14px 92px; }
    html.sidebar-collapsed .main { margin-left: 0; }
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0; top: auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 8px;
        gap: 4px;
        border-top: 1px solid var(--card-border);
        border-right: none;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .sidebar .logo { display: none; }
    .nav-item {
        width: auto;
        min-width: 64px;
        flex: 0 0 auto;
        padding: 8px 6px;
        font-size: 9px;
        gap: 4px;
        border-radius: 10px;
    }
    .nav-item svg { width: 18px; height: 18px; }
    .search { max-width: none; }
    .topbar { flex-wrap: wrap; margin-bottom: 20px; }
    .stats { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .map { height: auto; background: none; overflow: visible; }
    .map-svg, .map .pin, .map .loc { display: none; }
    .skladi-list {
        position: static;
        max-width: 100%;
        margin-top: 4px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .ai-chat { height: calc(100vh - 312px); min-height: 320px; }
    .ai-bubble { max-width: 85%; }
}

/* ==== PHONE (small screens) ==== */
@media (max-width: 480px) {
    .topbar { gap: 10px; }
    .topbar-right { gap: 8px; }
    .user { gap: 8px; padding: 4px 8px 4px 4px; }
    .user .info { display: none; }
    .user .avatar { width: 34px; height: 34px; font-size: 14px; }
    .theme-btn, .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
    .theme-btn svg, .icon-btn svg { width: 18px; height: 18px; }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }
    .page-header .btn { width: 100%; justify-content: center; }

    .welcome h1 { font-size: 22px; }
    .welcome p { font-size: 13px; }

    .stat-card { padding: 18px; }
    .stat-card .stat-value { font-size: 26px; }

    .card { padding: 16px; }
    .form-card { max-width: 100%; }

    .pr-photo { height: 180px; font-size: 48px; }
    .pr-prices { grid-template-columns: 1fr 1fr; }
    .empty, .empty-pr, .empty-cat, .empty-sup, .empty-emp, .empty-cd, .empty-sd { padding: 32px 18px; }

    .pd-photo { height: 260px; font-size: 64px; }
    .pd-layout, .cd-layout, .sd-layout, .ed-layout { gap: 14px; }
    .pd-header, .cd-header, .sd-header, .ed-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .pd-header > div:last-child,
    .cd-header > div:last-child,
    .sd-header > div:last-child,
    .ed-header > div:last-child { flex-wrap: wrap; }
    .pd-header .btn, .cd-header .btn, .sd-header .btn, .ed-header .btn { flex: 1; justify-content: center; }
    .pd-info { padding: 20px 16px; }
    .pd-name { font-size: 24px; }
    .pd-grid { grid-template-columns: 1fr 1fr; }

    .auth-card { padding: 28px 20px 24px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1; justify-content: center; }

    .map { height: auto; }
    .skladi-list { grid-template-columns: 1fr; }
    .map-modal-box { max-height: 92vh; }
    .map-modal-body { height: 60vh; }

    .analytics-card { padding: 18px 16px; }
    .topbar { position: relative; }
    .notif-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        top: 56px;
        max-height: 70vh;
        border-radius: 16px;
    }
    .notif-panel .notif-list { max-height: 62vh; overflow-y: auto; }
}

@media (max-width: 360px) {
    .search { padding: 8px 12px; }
    .topbar-right .auth-btn span,
    .btn-sm { white-space: nowrap; }
    .pd-name { font-size: 22px; }
}

/* ===== AUTH (login / register) ===== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, rgba(139,92,246,0.18), transparent 60%),
                radial-gradient(900px 500px at 110% 110%, rgba(59,130,246,0.12), transparent 60%),
                var(--bg);
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 36px 34px 30px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}
.auth-logo img {
    width: 110px;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(212,175,55,0.45));
}
.auth-title {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.3px;
}
.auth-sub {
    margin: 8px 0 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.auth-card .form-group { margin-bottom: 16px; }
.auth-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
}
.btn-block {
    width: 100%;
    justify-content: center;
    padding: 13px;
    margin-top: 6px;
    font-size: 15px;
}
.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}
.auth-switch a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* AUTH button in topbar */
.topbar-right .auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}


/* REPORT DONUT CHART */
/* ===== PREMIUM ANALYTICS DONUT CARD ===== */
.analytics-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(139,92,246,0.12), transparent 45%),
        radial-gradient(120% 140% at 100% 100%, rgba(59,130,246,0.10), transparent 45%),
        #0b0e17;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 26px 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}
.analytics-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.analytics-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(236,72,153,0.18));
    border: 1px solid rgba(139,92,246,0.35);
    box-shadow: 0 8px 20px rgba(139,92,246,0.25);
}
.analytics-icon svg {
    width: 24px;
    height: 24px;
    stroke: #a78bfa;
    fill: none;
    stroke-width: 2;
}
.analytics-head-text h3 {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    letter-spacing: -0.2px;
}
.analytics-sub {
    margin: 0;
    font-size: 13px;
    color: rgba(203,213,225,0.7);
}

.analytics-body {
    display: grid;
    grid-template-columns: minmax(0, 300px) 1fr;
    gap: 34px;
    align-items: center;
}
.analytics-donut {
    position: relative;
    display: flex;
    justify-content: center;
    overflow: visible;
}
.analytics-donut .chart-box {
    width: 260px;
    height: 260px;
    max-width: 260px;
    margin: 0;
    overflow: visible;
}
.analytics-users {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.legend-row:hover,
.legend-row.active {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.legend-row.top {
    background: linear-gradient(90deg, rgba(139,92,246,0.16), rgba(139,92,246,0.04));
    border-color: rgba(139,92,246,0.35);
}
.a-swatch {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 4px;
}
.a-info {
    flex: 1 1 auto;
    min-width: 0;
}
.a-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.a-name {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.a-pct-badge {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: -0.2px;
}
.a-amount {
    font-size: 13px;
    color: rgba(203,213,225,0.85);
    margin: 3px 0 8px;
    font-weight: 600;
}
.a-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}
.a-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.legend-row.top .a-name { color: #c4b5fd; }

.chart-box {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 200px;
    margin: 0 auto;
    overflow: visible;
}
.chart-box canvas { width: 100% !important; height: 100% !important; overflow: visible; }
.chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #171c26;
    border: 1px solid rgba(139,92,246,0.4);
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.03);
    pointer-events: none;
    opacity: 0;
    transform: translateY(0);
    transition: opacity .14s ease;
    z-index: 50;
}
.chart-tooltip .t-swatch {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.chart-tooltip .t-name {
    color: #fff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-tooltip .t-amount {
    color: #e5e7eb;
}
.chart-tooltip .t-pct {
    color: #a78bfa;
    font-weight: 800;
}
html.light .chart-tooltip {
    background: #ffffff;
    border-color: rgba(139,92,246,0.5);
    color: #0f172a;
    box-shadow: 0 10px 26px rgba(15,23,42,0.18);
}
html.light .chart-tooltip .t-name { color: #0f172a; }
html.light .chart-tooltip .t-amount { color: #334155; }
html.light .chart-tooltip .t-pct { color: var(--purple); }
.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.chart-center-label {
    font-size: 10px;
    color: rgba(203,213,225,0.6);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
}
.chart-center-value {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin: 2px 0 1px;
    letter-spacing: -0.3px;
}
.chart-center-sub {
    font-size: 9.5px;
    color: rgba(148,163,184,0.75);
}
.chart-center-icon {
    width: 20px;
    height: 20px;
    margin-top: 6px;
    stroke: rgba(167,139,250,0.9);
    fill: none;
    stroke-width: 2;
}

.analytics-insight {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139,92,246,0.16), rgba(59,130,246,0.10));
    border: 1px solid rgba(139,92,246,0.28);
}
.insight-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    stroke: #a78bfa;
    fill: none;
    stroke-width: 2;
}
.insight-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.insight-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #a78bfa;
}
.insight-desc {
    font-size: 14px;
    color: rgba(226,232,240,0.9);
    line-height: 1.4;
}
.insight-desc b { color: #fff; }

@media (max-width: 1080px) {
    .analytics-body { grid-template-columns: 1fr; gap: 22px; }
    .analytics-donut .chart-box { width: 240px; height: 240px; margin: 0 auto; }
}
@media (max-width: 480px) {
    .analytics-card { padding: 20px; }
    .analytics-donut .chart-box { width: 200px; height: 200px; }
    .analytics-sub { font-size: 12px; }
}

/* HOME PAGE SUPERUSER: compact 6 stat cards */
.stats-6 {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stats-6 .stat-card {
    padding: 14px 16px;
    border-radius: 14px;
}
.stats-6 .stat-card .stat-label { font-size: 10px; margin-bottom: 8px; }
.stats-6 .stat-card .stat-label svg { width: 13px; height: 13px; }
.stats-6 .stat-card .stat-value { font-size: 20px; }
.stats-6 .stat-card .stat-sub { font-size: 11px; }

/* HOME PAGE SUPERUSER: stats row + donut chart together */
.stats-donut {
    display: block;
    margin-bottom: 24px;
}
.stats-donut .stats.stats-6 { margin-bottom: 24px; }
.analytics-card { margin-top: 0; }
@media (max-width: 560px) {
    .stats-6 { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats-donut .stats.stats-6 { margin-bottom: 18px; }
}

/* ===== THEME TOGGLE ===== */
.theme-btn {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.theme-btn:hover { color: #fff; border-color: rgba(255,255,255,0.15); transform: translateY(-1px); }
.theme-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.theme-btn .icon-sun { display: none; }

html.light .theme-btn .icon-moon { display: none; }
html.light .theme-btn .icon-sun { display: block; }

/* ===== LIGHT THEME ===== */
html.light {
    --bg: #f1f5f9;
    --sidebar: #ffffff;
    --card: #ffffff;
    --card-border: rgba(15,23,42,0.08);
    --text: #0f172a;
    --muted: #64748b;
    --purple: #2563eb;
}
html.light .search:focus-within { background: #ffffff; }
html.light .theme-btn:hover,
html.light .icon-btn:hover,
html.light .btn-ghost:hover { color: var(--text); border-color: rgba(15,23,42,0.2); background: rgba(15,23,42,0.04); }
html.light .nav-item:hover { background: rgba(15,23,42,0.05); color: var(--text); }
html.light .nav-item.active { color: #fff; }
html.light .card,
html.light .pr-card,
html.light .cat-card,
html.light .sup-card,
html.light .emp-card,
html.light .stat-card,
html.light .pd-photo-wrap,
html.light .pd-info,
html.light .cd-main,
html.light .sd-main,
html.light .ed-main,
html.light .auth-card,
html.light .user,
html.light .search,
html.light .icon-btn,
html.light .theme-btn { background: #ffffff; }

html.light .notif-panel {
    background: #ffffff;
    border-color: rgba(15,23,42,0.1);
    box-shadow: 0 24px 60px rgba(15,23,42,0.18), 0 0 0 1px rgba(15,23,42,0.03);
}
html.light .notif-head { background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(8,145,178,0.05)); border-bottom-color: rgba(15,23,42,0.08); }
html.light .notif-item:hover { background: rgba(37,99,235,0.08); }
html.light .icon-btn .dot { border-color: #fff; }
html.light .icon-btn .dot,
html.light .notif-badge { border-color: #fff; }

html.light .product-item,
html.light .cd-item,
html.light .sd-item,
html.light .ed-product,
html.light .pd-box,
html.light .ed-box,
html.light .pr-price { background: rgba(15,23,42,0.02); }

html.light tbody tr:hover { background: rgba(15,23,42,0.02); }

/* hardcoded dark surfaces */
html.light .map-modal-box { background: #ffffff; border-color: rgba(15,23,42,0.1); }
html.light .map-modal-head { background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(8,145,178,0.06)); border-bottom-color: rgba(15,23,42,0.08); }
html.light .map-modal-title { color: var(--text); }
html.light .map-modal-sub { color: var(--muted); }
html.light .map-modal-body,
html.light .map-modal-body .leaflet-container { background: #e8edf4; }
html.light .leaflet-popup-content-wrapper { background: #fff; color: var(--text); }
html.light .leaflet-popup-tip { background: #fff; }
html.light .map { background:
    radial-gradient(circle at 20% 30%, rgba(37,99,235,0.12), transparent 40%),
    radial-gradient(circle at 75% 60%, rgba(8,145,178,0.12), transparent 45%),
    #e8edf4; }

html.light .analytics-card { background:
    radial-gradient(120% 140% at 0% 0%, rgba(37,99,235,0.10), transparent 45%),
    radial-gradient(120% 140% at 100% 100%, rgba(8,145,178,0.08), transparent 45%),
    #ffffff;
    border-color: rgba(15,23,42,0.08);
    box-shadow: 0 20px 50px rgba(15,23,42,0.12), inset 0 1px 0 rgba(255,255,255,0.5);
}
html.light .analytics-head-text h3,
html.light .a-name,
html.light .chart-center-value,
html.light .insight-desc b { color: var(--text); }
html.light .analytics-sub,
html.light .a-amount,
html.light .insight-desc { color: var(--muted); }
html.light .legend-row { background: rgba(15,23,42,0.03); border-color: rgba(15,23,42,0.08); }
html.light .legend-row:hover,
html.light .legend-row.active { box-shadow: 0 8px 20px rgba(15,23,42,0.15); }
html.light .a-bar { background: rgba(15,23,42,0.1); }
html.light .chart-center-label { color: var(--muted); }
html.light .chart-center-sub { color: var(--muted); }

html.light .auth-body { background:
    radial-gradient(1200px 600px at 50% -10%, rgba(37,99,235,0.12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(8,145,178,0.10), transparent 60%),
    #eef2f7; }

/* form inputs on light */
html.light .form-group input,
html.light .form-group select,
html.light .form-group textarea { background: #ffffff; color: var(--text); }

/* ---- light theme logo + readability tweaks ---- */
html.light .sidebar .logo .brand-mark {
    filter: invert(0.82) sepia(0.6) saturate(1.8) hue-rotate(-15deg) brightness(0.72) drop-shadow(0 0 6px rgba(180,140,40,0.25));
}

html.light .nav-item svg,
html.light .icon-btn svg,
html.light .theme-btn svg,
html.light .sidebar .logo .brand-tour::after { color: inherit; }

html.light .btn-primary { color: #fff; }
html.light .btn-danger:hover { color: #fff; }
html.light .btn-expense { color: #fff; }
html.light .icon-btn .dot,
html.light .notif-badge { border-color: #fff; }

/* darker hover for ghost buttons so they stay visible on white */
html.light .btn-ghost:hover { color: var(--text); }

/* stat-card top accent bars remain colorful - fine */

/* sklav/sklado colored gradients get a white card base so text stays readable */
html.light .sklado { background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(8,145,178,0.06)); }
html.light .skladi { box-shadow: 0 8px 24px rgba(15,23,42,0.12); }

/* welcome heading */
html.light .welcome h1,
html.light .page-header h1,
html.light .pd-name,
html.light .cd-side h1,
html.light .sd-side h1,
html.light .ed-side h1,
html.light .emp-name,
html.light .sup-name,
html.light .cat-name,
html.light .pr-name { color: var(--text); }

/* ===== FULL LIGHT MODE FIXES ===== */

/* summary cards: lighter tinted gradients */
html.light .expense-summary .sum-card {
    background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(249,115,22,0.01));
    border-color: rgba(249,115,22,0.18);
}
html.light .pr-summary .sum-card {
    background: linear-gradient(135deg, rgba(20,184,166,0.06), rgba(20,184,166,0.01));
    border-color: rgba(20,184,166,0.18);
}
html.light .cat-summary .sum-card {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(37,99,235,0.01));
    border-color: rgba(37,99,235,0.18);
}
html.light .sup-summary .sum-card {
    background: linear-gradient(135deg, rgba(8,145,178,0.06), rgba(8,145,178,0.01));
    border-color: rgba(8,145,178,0.18);
}
html.light .emp-summary .sum-card {
    background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.01));
    border-color: rgba(34,197,94,0.18);
}

/* map area */
html.light .map {
    background: radial-gradient(circle at 20% 30%, rgba(37,99,235,0.08), transparent 40%),
        radial-gradient(circle at 75% 60%, rgba(8,145,178,0.08), transparent 45%),
        #e8edf4;
}

/* skladi floating list items */
html.light .skladi {
    background: linear-gradient(135deg, rgba(37,99,235,0.07), rgba(8,145,178,0.04));
    border-color: rgba(37,99,235,0.18);
    box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
html.light .skladi .skladi-count {
    background: rgba(37,99,235,0.08);
    color: var(--purple);
}
html.light .skladi-empty,
html.light .sklado-empty {
    background: rgba(15,23,42,0.03);
    border-color: rgba(15,23,42,0.12);
    color: var(--muted);
}

/* sklado overview cards */
html.light .sklado {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(8,145,178,0.03));
    border-color: rgba(37,99,235,0.15);
}
html.light .sklado-count {
    background: rgba(37,99,235,0.08);
}

/* city sklad modal rows */
html.light .city-sklad-row {
    background: rgba(15,23,42,0.02);
    border-color: rgba(37,99,235,0.12);
}
html.light .city-sklad-row:hover {
    background: rgba(37,99,235,0.05);
    border-color: rgba(37,99,235,0.35);
}
html.light .city-sklad-row .city-sklad-name { color: var(--purple); }

/* notification panel */
html.light .notif-panel {
    background: #ffffff;
    border-color: rgba(15,23,42,0.1);
    box-shadow: 0 24px 60px rgba(15,23,42,0.15), 0 0 0 1px rgba(15,23,42,0.04);
}
html.light .notif-head {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(8,145,178,0.03));
    border-bottom-color: rgba(15,23,42,0.06);
    color: var(--text);
}
html.light .notif-qty {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.18);
    color: var(--purple);
}

/* product items (inside lists) */
html.light .product-item {
    background: rgba(15,23,42,0.015);
    border-color: var(--card-border);
}
html.light .product-item:hover {
    border-color: rgba(15,23,42,0.12);
}

/* category / country / expense list items */
html.light .cd-item,
html.light .sd-item,
html.light .ed-product {
    background: rgba(15,23,42,0.015);
    border-color: var(--card-border);
}

/* product card badges */
html.light .pr-badge {
    background: rgba(15,23,42,0.04);
    border-color: rgba(15,23,42,0.1);
    color: var(--muted);
}

/* expense summary card */
html.light .confirm-card .confirm-icon.icon-expense {
    background: rgba(249,115,22,0.08);
}

/* product detail boxes */
html.light .pd-box,
html.light .ed-box {
    background: rgba(15,23,42,0.02);
    border-color: var(--card-border);
}

/* product prices */
html.light .pr-price {
    background: rgba(15,23,42,0.02);
    border-color: var(--card-border);
}

/* product detail photo background */
html.light .pr-photo {
    background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(8,145,178,0.10));
}
html.light .pd-photo {
    background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(8,145,178,0.10));
}

/* AI chat */
html.light .ai-msg-model .ai-bubble {
    background: rgba(15,23,42,0.04);
    border-color: rgba(15,23,42,0.08);
    color: var(--text);
}
html.light .ai-chat-input input {
    background: rgba(15,23,42,0.02);
    border-color: rgba(15,23,42,0.1);
    color: var(--text);
}
html.light .ai-dot {
    background: var(--muted);
}

/* chart / analytics */
html.light .analytics-card {
    background: radial-gradient(120% 140% at 0% 0%, rgba(37,99,235,0.06), transparent 45%),
        radial-gradient(120% 140% at 100% 100%, rgba(8,145,178,0.05), transparent 45%),
        #ffffff;
    border-color: rgba(15,23,42,0.08);
    box-shadow: 0 20px 50px rgba(15,23,42,0.1);
}
html.light .analytics-head-text h3,
html.light .a-name { color: var(--text); }
html.light .analytics-sub,
html.light .a-amount { color: var(--muted); }
html.light .chart-center-value { color: var(--text); }
html.light .chart-center-label,
html.light .chart-center-sub { color: var(--muted); }
html.light .legend-row {
    background: rgba(15,23,42,0.03);
    border-color: rgba(15,23,42,0.08);
}
html.light .legend-row:hover,
html.light .legend-row.active {
    background: rgba(37,99,235,0.06);
    border-color: rgba(37,99,235,0.3);
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}
html.light .legend-row.top {
    background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(37,99,235,0.02));
    border-color: rgba(37,99,235,0.2);
}
html.light .legend-row.top .a-name { color: var(--purple); }
html.light .a-bar { background: rgba(15,23,42,0.08); }

/* analytics insight box */
html.light .analytics-insight {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(8,145,178,0.03));
    border-color: rgba(37,99,235,0.15);
}
html.light .insight-title { color: var(--purple); }
html.light .insight-desc { color: var(--muted); }
html.light .insight-desc b { color: var(--text); }

/* category detail side panel */
html.light .cd-side {
    background: linear-gradient(160deg, rgba(37,99,235,0.06), rgba(8,145,178,0.02));
    border-color: rgba(37,99,235,0.15);
}
html.light .cd-icon {
    background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(8,145,178,0.12));
}

/* country/supplier detail side panel */
html.light .sd-side {
    background: linear-gradient(160deg, rgba(8,145,178,0.06), rgba(34,211,238,0.02));
    border-color: rgba(8,145,178,0.15);
}
html.light .sd-icon {
    background: linear-gradient(135deg, rgba(8,145,178,0.15), rgba(34,211,238,0.12));
}

/* expense detail side panel */
html.light .ed-side {
    background: linear-gradient(160deg, rgba(249,115,22,0.06), rgba(249,115,22,0.01));
    border-color: rgba(249,115,22,0.15);
}
html.light .ed-icon {
    background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(245,158,11,0.12));
}

/* table borders */
html.light thead th { border-bottom-color: rgba(15,23,42,0.08); }
html.light tbody td { border-bottom-color: rgba(15,23,42,0.06); }

/* form errors */
html.light .form-error {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.18);
    color: var(--red);
}

/* confirm card */
html.light .confirm-card .confirm-icon {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.15);
}

/* button adjustments for light */
html.light .btn-ghost {
    background: rgba(15,23,42,0.03);
    border-color: rgba(15,23,42,0.1);
    color: var(--muted);
}
html.light .btn-ghost:hover {
    background: rgba(15,23,42,0.06);
    color: var(--text);
}
html.light .btn-danger {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.18);
    color: var(--red);
}

/* sidebar active nav on light */
html.light .nav-item.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(8,145,178,0.10));
    box-shadow: inset 0 0 0 1px rgba(37,99,235,0.25);
}

/* nav item expense / ai on light */
html.light .nav-item.nav-expense {
    background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(249,115,22,0.01));
    border-color: rgba(249,115,22,0.15);
}
html.light .nav-item.nav-ai {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(37,99,235,0.01));
    border-color: rgba(37,99,235,0.15);
}

/* stat card hover lighter shadow */
html.light .stat-card:hover,
html.light .pr-card:hover,
html.light .cat-card:hover,
html.light .sup-card:hover,
html.light .emp-card:hover {
    box-shadow: 0 12px 30px rgba(15,23,42,0.1);
}

/* search focus glow on light */
html.light .search:focus-within {
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1), 0 6px 20px rgba(15,23,42,0.06);
    background: #ffffff;
}

/* alert / flash on light */
html.light .alert {
    background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.01));
    border-color: rgba(34,197,94,0.18);
    border-left-color: var(--green);
    color: var(--green);
    box-shadow: 0 4px 16px rgba(34,197,94,0.06);
}
html.light .alert.error {
    background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(239,68,68,0.01));
    border-color: rgba(239,68,68,0.18);
    border-left-color: var(--red);
    color: var(--red);
    box-shadow: 0 4px 16px rgba(239,68,68,0.06);
}

/* map modal close button on light */
html.light .map-modal-close {
    border-color: rgba(15,23,42,0.1);
    background: rgba(15,23,42,0.04);
    color: var(--text);
}

/* tag colors on light */
html.light .tag {
    background: rgba(37,99,235,0.08);
    color: var(--purple);
}
html.light .tag.tag-expense {
    background: rgba(249,115,22,0.08);
    color: var(--orange);
}

/* thumb photo placeholders */
html.light td .thumb-photo {
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(8,145,178,0.10));
}

/* sidebar scrollbar when collapsed */
html.light .sidebar { scrollbar-color: rgba(15,23,42,0.1) transparent; }

/* auth card shadow on light */
html.light .auth-card {
    box-shadow: 0 24px 60px rgba(15,23,42,0.12);
}

/* expense row border */
html.light .expense-row { border-bottom-color: rgba(15,23,42,0.06); }

/* product grid items inside detail page */
html.light .product-grid .product-item {
    background: rgba(15,23,42,0.015);
}

/* chart labels */
html.light .chart-labels { color: var(--muted); }

/* cd-item / sd-item backgrounds */
html.light .cd-list .cd-item,
html.light .sd-list .sd-item {
    background: rgba(15,23,42,0.015);
}
html.light .cd-item:hover,
html.light .sd-item:hover {
    border-color: rgba(37,99,235,0.25);
}
html.light .sd-item:hover {
    border-color: rgba(8,145,178,0.25);
}

/* empty states */
html.light .empty,
html.light .empty-pr,
html.light .empty-cat,
html.light .empty-sup,
html.light .empty-emp,
html.light .empty-cd,
html.light .empty-sd {
    color: var(--muted);
    border-color: rgba(15,23,42,0.1);
}

/* tooltip on chart for light */
html.light .chart-tooltip {
    background: #ffffff;
    border-color: rgba(15,23,42,0.12);
    color: var(--text);
    box-shadow: 0 10px 26px rgba(15,23,42,0.12);
}
html.light .chart-tooltip .t-name { color: var(--text); }
html.light .chart-tooltip .t-amount { color: var(--muted); }

/* form input focus on light */
html.light .form-group input:focus,
html.light .form-group select:focus,
html.light .form-group textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #ffffff;
}

/* light-mode friendly accent text colors (darker teal/purple for contrast) */
html.light .pr-badge.teal,
html.light .pd-badge.teal {
    background: rgba(20,184,166,0.08);
    border-color: rgba(20,184,166,0.2);
    color: #0d9488;
}
html.light .pd-code { color: #0d9488; }
html.light .pr-header h1 svg { stroke: #0d9488; }

/* swap any remaining purple accents to blue/cyan in light mode */
html.light .nav-item.nav-ai,
html.light .nav-item.nav-ai:hover { color: var(--purple); box-shadow: inset 0 0 0 1px rgba(37,99,235,0.35); }
html.light .nav-item.nav-expense:hover { color: var(--orange); box-shadow: inset 0 0 0 1px rgba(249,115,22,0.5); }
html.light .analytics-icon svg,
html.light .insight-icon { stroke: var(--purple); }
html.light .korvon-marker .korvon-pin {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 0 16px rgba(37,99,235,0.6);
}
html.light .ai-fab {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6, #06b6d4);
}

/* stat card accent circles/bars in light mode: purple->blue, blue->cyan */
html.light .stat-purple::before { background: var(--purple); }
html.light .stat-purple .stat-label { color: var(--purple); }
html.light .stat-blue::before { background: #0891b2; }
html.light .stat-blue .stat-label { color: #0891b2; }
html.light .stat-orange::before { background: var(--orange); }
html.light .stat-orange .stat-label { color: var(--orange); }
html.light .stat-green::before { background: var(--green); }
html.light .stat-green .stat-label { color: var(--green); }

/* light mode: SVG map markers & region purple -> blue */
html.light .dushanbe-region { fill: rgba(37,99,235,0.20) !important; stroke: rgba(37,99,235,0.5) !important; }
html.light .dushanbe-halo { fill: rgba(37,99,235,0.22) !important; }
html.light .dushanbe-dot { fill: #2563eb !important; }
html.light .dushanbe-text { fill: #2563eb !important; }
html.light .sklad-pin:hover .dushanbe-text { fill: #0f172a !important; }
html.light .sklad-pin:hover .dushanbe-dot { filter: drop-shadow(0 0 8px rgba(37,99,235,0.7)); }
