/* ═══════════════════════════════════════════════
   OmborPro v3.8 — Design System (High Contrast)
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   ANIMATIONS & TRANSITIONS
   ═══════════════════════════════════════════════ */
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        /* Emil Kowalski: nothing in the real world appears from nothing — 0.9 is too dramatic */
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
    }
}

:root {
    /* Dark Theme — yumshoq qora: yuzalar fondan aniq ajralib turadi */
    --bg-primary: #101216;
    --bg-secondary: #181b21;
    --bg-card: #1c1f26;
    --bg-card-hover: #252932;
    --bg-glass: rgba(24, 27, 33, 0.88);
    --bg-input: rgba(255, 255, 255, 0.08);
    --bg-sidebar: #14161b;

    --accent: #6366f1;
    --accent-light: #a5b4fc;
    --accent-dim: rgba(99, 102, 241, 0.16);
    --accent-glow: rgba(99, 102, 241, 0.45);
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);

    --green: #10b981;
    --green-light: #34d399;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-light: #f87171;
    --red-dim: rgba(239, 68, 68, 0.15);
    --orange: #f59e0b;
    --orange-dim: rgba(245, 158, 11, 0.15);
    --cyan: #06b6d4;
    --cyan-dim: rgba(6, 182, 212, 0.15);
    --pink: #ec4899;
    --pink-dim: rgba(236, 72, 153, 0.15);

    /* Matn ranglari - Yorqin */
    --text: #fafafa;
    --text-secondary: #a8a8b3;
    --text-muted: #82828f;

    /* Border - aniq ko'rinadigan chiziqlar (qora fon ustida) */
    --border: rgba(255, 255, 255, 0.14);
    --border-light: rgba(255, 255, 255, 0.24);

    --radius-sm: 7px;
    --radius-md: 9px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 8px 40px var(--accent-glow);

    --sidebar-width: 264px;
    --sidebar-collapsed: 76px;
    --header-height: 70px;

    /* Emil Kowalski: custom easing curves — never use generic built-ins */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

    /* Emil Kowalski: never use `transition: all` — specify exact properties */
    --transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1),
                  opacity 180ms ease-out,
                  border-color 150ms ease,
                  box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1),
                  background-color 150ms ease,
                  color 120ms ease;
    --transition-fast: transform 140ms cubic-bezier(0.23, 1, 0.32, 1),
                       opacity 120ms ease-out,
                       background-color 100ms ease,
                       color 100ms ease,
                       border-color 120ms ease,
                       box-shadow 140ms ease;
    --transition-slow: transform 350ms cubic-bezier(0.23, 1, 0.32, 1),
                       opacity 300ms ease-out;
}

:root[data-theme="light"] {
    /* Light Theme — Minimalizm, iliq oq (3% sariq tint, ko'z charchamasligi uchun) */
    --bg-primary: #faf9f3;
    --bg-secondary: #f3f2ea;
    --bg-card: #fffefa;
    --bg-card-hover: #f6f5ee;
    --bg-glass: rgba(255, 254, 250, 0.96);
    --bg-input: #faf9f3;
    --bg-sidebar: #fffefa;

    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-dim: rgba(79, 70, 229, 0.08);
    --accent-glow: rgba(79, 70, 229, 0.15);
    --accent-gradient: linear-gradient(135deg, #4f46e5, #6366f1);

    --green: #059669;
    --green-light: #10b981;
    --green-dim: rgba(5, 150, 105, 0.09);
    --red: #dc2626;
    --red-light: #ef4444;
    --red-dim: rgba(220, 38, 38, 0.08);
    --orange: #d97706;
    --orange-dim: rgba(217, 119, 6, 0.09);
    --cyan: #0891b2;
    --cyan-dim: rgba(8, 145, 178, 0.09);
    --pink: #be185d;
    --pink-dim: rgba(190, 24, 93, 0.09);

    /* Matn - Quyuq (zinc shkala) */
    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;

    /* Border - nozik, aniq, iliq ton */
    --border: #e5e3da;
    --border-light: #d5d2c7;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

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

/* Global focus-visible — accessible, elegant */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ═══════════════════════════════════════════════
   ANIMATION CLASSES
   ═══════════════════════════════════════════════ */
/* Emil Kowalski: UI animations should stay under 300ms for responsiveness */
.animate-fadeIn {
    animation: fadeIn 0.25s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Staggered animations */
.stagger-1 {
    animation-delay: 0.05s;
    opacity: 0;
}

.stagger-2 {
    animation-delay: 0.1s;
    opacity: 0;
}

.stagger-3 {
    animation-delay: 0.15s;
    opacity: 0;
}

.stagger-4 {
    animation-delay: 0.2s;
    opacity: 0;
}

.stagger-5 {
    animation-delay: 0.25s;
    opacity: 0;
}

.stagger-6 {
    animation-delay: 0.3s;
    opacity: 0;
}

/* Smooth transitions */
.smooth-hover {
    transition: var(--transition);
}

.smooth-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.smooth-scale {
    transition: transform 0.2s ease;
}

.smooth-scale:hover {
    transform: scale(1.02);
}

.smooth-scale:active {
    transform: scale(0.98);
}

/* Tab panel transitions */
.tab-panel {
    animation: fadeIn 0.3s ease;
}

/* Card hover effects */
.card {
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* impeccable: side-stripe ban — no left/right border accent on list items */
/* Active state uses background tint only — cleaner, more premium */
.nav-item {
    transition: var(--transition-fast);
    position: relative;
}

/* Emil Kowalski: nav items used constantly — no transform, only color/bg change */
.nav-item:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-dim);
}

/* Button animations */
.btn {
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn:active {
    transform: scale(0.97);
}

/* Input animations */
.f-input,
.f-select {
    transition: var(--transition-fast);
    border: 1px solid var(--border);
}

.f-input:focus,
.f-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    outline: none;
}

/* Dynamic row animations */
.dynamic-row {
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dynamic-row.removing {
    animation: fadeIn 0.2s ease reverse forwards;
}

/* Modal/Form animations — occasional, standard 250ms is right */
.form-card,
.modal-content {
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Table row animations - Removed global animation to prevent flickering on refreshes */
.table-wrap tbody tr {
    opacity: 1;
    /* Default to visible */
}

/* Specific class if animation is desired on first load only */
.animate-rows tbody tr {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.animate-rows tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-rows tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-rows tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-rows tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-rows tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.animate-rows tbody tr:nth-child(6) {
    animation-delay: 0.3s;
}

.animate-rows tbody tr:nth-child(7) {
    animation-delay: 0.35s;
}

.animate-rows tbody tr:nth-child(8) {
    animation-delay: 0.4s;
}

/* Jurnal expandable rows - smooth accordion */
.jurnal-group {
    background: transparent !important;
    transition: background 0.2s ease;
}

.jurnal-group:hover {
    background: var(--bg-card-hover) !important;
}

.jurnal-group.expanded {
    background: rgba(99, 102, 241, 0.1) !important;
    border-left: 3px solid var(--accent);
}

.jurnal-group.expanded td {
    font-weight: 500;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 10px;
}

.toggle-icon.open {
    transform: rotate(90deg);
    display: inline-block;
}

.jurnal-detail {
    animation: slideDown 0.3s ease forwards;
    background: rgba(0, 0, 0, 0.03) !important;
    border-left: 2px solid var(--accent-dim);
}

.jurnal-detail:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Emil Kowalski: sidebar shows on every page — no entrance animation needed */
/* .sidebar { animation: slideInLeft ... } — removed */

/* Success/Error messages */
.success-msg,
.error-msg {
    animation: fadeInUp 0.3s ease forwards;
}

/* Badge animations */
.badge {
    transition: var(--transition-fast);
}

.badge:hover {
    transform: scale(1.05);
}

/* Emil Kowalski: stat cards are seen dozens of times/day — no entrance animation */
.stat-card {
    transition: var(--transition);
}

/* Emil Kowalski: reduced hover — translateY(-4px) scale(1.02) was too much */
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Chart animations */
.chart-container {
    animation: fadeIn 0.8s ease forwards;
}

/* Timeline animations */
.timeline-item {
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.15s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.25s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(6) {
    animation-delay: 0.35s;
}

.timeline-item:nth-child(7) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(8) {
    animation-delay: 0.45s;
}

/* Emil Kowalski: qoldiq items used constantly — no transform on hover, only bg change */
.qoldiq-side-item {
    transition: var(--transition-fast);
}

.qoldiq-side-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

/* Search results animation */
.search-result-item {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Pulse animation for notifications */
.pulse-dot {
    position: relative;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--red);
    animation: pulse 2s infinite;
}

body {
    background: var(--bg-primary);
    color: var(--text);
    font-family: 'Inter', -apple-system, 'Segoe UI', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Aurora glow + nozik grid mesh — qora fon ustida grafik chuqurlik */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 12% 8%, rgba(99, 102, 241, 0.10), transparent 60%),
        radial-gradient(ellipse 600px 400px at 88% 92%, rgba(139, 92, 246, 0.07), transparent 60%),
        radial-gradient(ellipse 500px 500px at 50% 120%, rgba(99, 102, 241, 0.05), transparent 55%),
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 56px 56px, 56px 56px;
    background-attachment: fixed;
    pointer-events: none;
    z-index: 0;
}

/* Light rejimda grid/aurora yumshoqroq */
[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 700px 500px at 12% 8%, rgba(99, 102, 241, 0.05), transparent 60%),
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: 100% 100%, 56px 56px, 56px 56px;
}

/* Nozik film-grain — premium tekstura (performans uchun blend-mode'siz) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* Light rejimda grain va grid ko'rinmasin */
[data-theme="light"] body::after { opacity: 0.02; }

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

/* LOADER */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(ellipse 600px 400px at 50% 35%, rgba(99, 102, 241, 0.14), transparent 60%),
        radial-gradient(ellipse 500px 300px at 50% 80%, rgba(139, 92, 246, 0.08), transparent 60%),
        var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
}

/* impeccable: gradient text ban — solid color is more premium */
.loader-logo {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    animation: loaderPulse 1.5s ease-in-out infinite;
}

.loader-logo-img {
    width: 200px;
    height: 155px;
}

/* ── OmborPro logo yig'ilish animatsiyasi (inline SVG, .op-logo) ──
   Bitta umumiy 2.5s sikl: yig'ilish ~1.6s, tayyor logo ~0.9s turadi, keyin qaytadan.
   Har bo'lakning kechikishi keyframe foizlariga kiritilgan (delay+loop birga ishlamagani uchun);
   tashqi timing linear — his-tuyg'u har segmentning o'z bezier'ida. */
.op-logo .op-left-face,
.op-logo .op-left-panel,
.op-logo .op-inner-panel,
.op-logo .op-roof,
.op-logo .op-right-face,
.op-logo .op-arrow,
.op-logo .op-top-overlay,
.op-logo .op-checkbox,
.op-logo .op-check-window {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.op-logo .op-left-face   { animation: opLoopLeftFace 2.5s linear infinite; }
.op-logo .op-right-face  { animation: opLoopRightFace 2.5s linear infinite; }
.op-logo .op-roof        { animation: opLoopRoof 2.5s linear infinite; }
.op-logo .op-left-panel  { animation: opLoopLeftPanel 2.5s linear infinite; }
.op-logo .op-inner-panel { animation: opLoopInnerPanel 2.5s linear infinite; }
.op-logo .op-top-overlay { animation: opLoopTopOverlay 2.5s linear infinite; }
.op-logo .op-arrow       { animation: opLoopArrow 2.5s linear infinite; }
.op-logo .op-checkbox    { animation: opLoopCheckbox 2.5s linear infinite; }
.op-logo .op-check-window{ animation: opLoopWindow 2.5s linear infinite; }

.op-logo .op-root {
    transform-box: fill-box;
    transform-origin: center;
    animation: opLoopSettle 2.5s linear infinite;
}

@keyframes opLoopLeftFace {
    0%          { opacity: 0; transform: scale(.93); animation-timing-function: cubic-bezier(.3,1.04,.2,1); }
    14.4%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes opLoopRightFace {
    0%, 4.8%    { opacity: 0; transform: scale(.93); animation-timing-function: cubic-bezier(.3,1.04,.2,1); }
    19.2%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes opLoopRoof {
    0%, 9.6%    { opacity: 0; transform: translateY(-18px); animation-timing-function: cubic-bezier(.23,1,.32,1); }
    25.6%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes opLoopLeftPanel {
    0%, 16.8%   { opacity: 0; transform: scale(.96); animation-timing-function: cubic-bezier(0,0,.2,1); }
    29.6%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes opLoopInnerPanel {
    0%, 19.2%   { opacity: 0; transform: scale(.96); animation-timing-function: cubic-bezier(0,0,.2,1); }
    32%, 100%   { opacity: 1; transform: scale(1); }
}
@keyframes opLoopTopOverlay {
    0%, 21.2%   { opacity: 0; transform: translateY(-8px); animation-timing-function: cubic-bezier(.23,1,.32,1); }
    33.2%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes opLoopArrow {
    0%, 25.6%   { opacity: 0; transform: translate(14px, -8px); animation-timing-function: cubic-bezier(.23,1,.32,1); }
    38.4%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes opLoopCheckbox {
    0%, 35.2%   { opacity: 0; transform: scale(.9); animation-timing-function: cubic-bezier(.3,1.06,.2,1); }
    48.8%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes opLoopWindow {
    0%, 40%     { opacity: 0; animation-timing-function: cubic-bezier(0,0,.2,1); }
    46%, 100%   { opacity: 1; }
}
@keyframes opLoopSettle {
    0%, 48.8%   { transform: scale(1); animation-timing-function: cubic-bezier(.37,0,.63,1); }
    57%         { transform: scale(1.012); animation-timing-function: cubic-bezier(.37,0,.63,1); }
    65.6%, 100% { transform: scale(1); }
}

.loader-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.loader-bar-wrap {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    animation: loaderFill 1.4s ease-in-out forwards;
    box-shadow: 0 0 15px var(--accent-glow);
}

@keyframes loaderPulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.5
    }
}

@keyframes loaderFill {
    0% {
        width: 0
    }

    100% {
        width: 100%
    }
}

/* LOGIN */
#login-page {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    overflow: hidden;
    align-items: stretch;
    justify-content: center;
    background: #fffefa;
}

/* Chap tomon — Lottie animatsiya */
.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background:
        radial-gradient(ellipse 600px 500px at 30% 30%, rgba(99, 102, 241, 0.07), transparent 60%),
        radial-gradient(circle, rgba(15, 23, 42, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
        #f7f8fc;
    min-width: 0;
}

.login-lottie {
    width: 700px;
    height: 700px;
    max-width: 92%;
}

/* O'ng tomon — Login forma */
/* Kirish paneli. DOM da BIRINCHI (chapda) turadi — o'ngga ko'chirish
   transform bilan bo'ladi, shunda logotip foni ham birga siljiydi.
   Yon chiziq ikkala chekkaga ham qo'yiladi: qaysi tomonda tursa,
   tashqi chekkasidagisi ko'rinmaydi, ichkarisi ko'rinadi. */
.login-right {
    flex: 0 0 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    background: #fffefa;
    position: relative;
    z-index: 2;
    box-shadow: -1px 0 0 #e8e6dd, 1px 0 0 #e8e6dd;
}

/* Tugma bosilgach 0.2 s dan keyin ikkala panel joyini almashadi */
.login-right,
.login-left {
    transition: transform 560ms cubic-bezier(0.5, 0, 0.2, 1) 160ms;
}
#login-page.ongda .login-right { transform: translateX(calc(var(--login-w, 100vw) - 460px)); }
#login-page.ongda .login-left  { transform: translateX(-460px); }

/* Kichik ekranlar uchun responsive */
@media (max-width: 768px) {
    #login-page {
        flex-direction: column;
        overflow-y: auto;
    }
    .login-left {
        flex: 0 0 auto;
        padding: 32px 20px 0;
        background: #fffefa;
        border-left: none;
    }
    .login-lottie {
        width: 240px;
        height: 240px;
    }
    .login-right {
        order: 1;
        flex: 0 0 auto;
        width: 100%;
        box-shadow: none;
        padding: 24px 20px 40px;
    }
    .login-left { order: 0; }
    #login-page.ongda .login-right,
    #login-page.ongda .login-left { transform: none; }
}

/* impeccable: glassmorphism/orb decoration removed — clean background is stronger */
.login-orb1,
.login-orb2 {
    display: none;
}

/* The Control Room login — structured, grounded, confident */
.login-card {
    position: relative;
    z-index: 1;
    width: 400px;
    max-width: 100%;
    padding: 48px 44px;
    background: #fffefa;
    border: 1px solid #e8e6dd;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    animation: loginReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid #eaecf0;
}

/* impeccable: gradient text ban — clean wordmark */
.login-brand h1 {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.login-brand p {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.login-tier-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 10px;
    background: transparent;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

.field-group {
    margin-bottom: 20px;
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.field-input {
    width: 100%;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.field-input:focus {
    border-color: var(--accent);
    background: #fffefa;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.field-input::placeholder {
    color: #9ca3af;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms ease;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Emil Kowalski: every pressable element must have tactile :active feedback */
.login-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

.login-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 12px;
    text-align: center;
    display: none;
    padding: 10px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
}

/* Login divider + free trial button */
.login-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 16px 0 12px;
    font-size: 11px; color: #9ca3af;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1;
    border-top: 1px solid #e5e7eb;
}
.login-free-btn {
    width: 100%; padding: 12px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    color: #374151; font-size: 14px; font-weight: 500;
    cursor: pointer; font-family: inherit;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.login-free-btn:hover {
    border-color: #d1d5db;
    color: #111827;
    background: #f9fafb;
}

/* SIDEBAR */
/* ====== ICON-RAIL SIDEBAR (hover-expand) ====== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-collapsed);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 60;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s ease;
    will-change: width;
}

.sidebar:hover,
.sidebar.pinned {
    width: var(--sidebar-width);
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.28);
}

/* Pinned (qadalgan) holatda soyani yumshatamiz — doimiy ochiq menyu */
.sidebar.pinned {
    box-shadow: none;
}

.sidebar-brand {
    padding: 18px 0 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    overflow: hidden;
}

.sidebar-logo {
    width: var(--sidebar-collapsed);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    padding: 6px;
    background: var(--accent-dim);
    box-shadow: 0 0 0 1px var(--border);
}

/* Text wrapper — fades/slides in only when expanded */
.sidebar-brand-text {
    min-width: 0;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease 0.06s, transform 0.26s ease 0.06s;
}

.sidebar:hover .sidebar-brand-text,
.sidebar.pinned .sidebar-brand-text {
    opacity: 1;
    transform: translateX(0);
}

/* Pin (qadash) tugmasi — faqat menyu ochilganda ko'rinadi */
.sidebar-pin {
    margin-left: auto;
    margin-right: 14px;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease 0.06s, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.sidebar:hover .sidebar-pin,
.sidebar.pinned .sidebar-pin { opacity: 1; }
.sidebar-pin:hover { background: var(--accent-dim); color: var(--text); }
.sidebar.pinned .sidebar-pin {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* impeccable: gradient text ban — solid wordmark */
.sidebar-brand h2 {
    font-size: 21px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.sidebar-brand .version {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    counter-reset: nav-counter;
}
/* Collapsed rail: hide scrollbar so icons stay centered */
.sidebar:not(:hover):not(.pinned) .sidebar-nav { scrollbar-width: none; }
.sidebar:not(:hover):not(.pinned) .sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 14px 12px 4px;
    opacity: 0.6;
    white-space: nowrap;
    transition: opacity 0.18s ease, height 0.2s ease, padding 0.2s ease;
}
/* Collapsed: section labels shrink into thin separators */
.sidebar:not(:hover):not(.pinned) .nav-section-label {
    opacity: 0;
    height: 10px;
    padding: 0;
    overflow: hidden;
}

/* Icon-rail nav — collapsed shows centered icon, expand reveals label */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-radius: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
}

/* Active = filled rounded tile (square when collapsed, pill when expanded) */
.nav-item.active {
    background: var(--accent);
    color: #ffffff;
}

.nav-item .nav-icon {
    width: 48px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.nav-item .nav-icon img {
    width: 23px;
    height: 23px;
    object-fit: contain;
    display: block;
    transition: transform 0.18s ease;
    /* gradient PNG icons read well on dark rail; lift slightly on light theme */
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.nav-item:hover .nav-icon img { transform: scale(1.08); }
.nav-item.active .nav-icon img { transform: scale(1.05); }

/* Labels + badges fade in on expand */
.nav-item > span:not(.nav-icon),
.nav-item .nav-badge {
    opacity: 0;
    transition: opacity 0.18s ease 0.04s;
}
.sidebar:hover .nav-item > span:not(.nav-icon),
.sidebar:hover .nav-item .nav-badge,
.sidebar.pinned .nav-item > span:not(.nav-icon),
.sidebar.pinned .nav-item .nav-badge {
    opacity: 1;
}

.nav-item .nav-badge {
    margin-left: auto;
    margin-right: 12px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 700;
}

.nav-item .nav-badge.pro {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.nav-item .nav-badge.proplus {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.sidebar-user {
    padding: 12px 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    margin: 0 18px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.18s ease 0.04s;
}
.sidebar:hover .sidebar-user-info,
.sidebar:hover .sidebar-logout,
.sidebar.pinned .sidebar-user-info,
.sidebar.pinned .sidebar-logout { opacity: 1; }
.sidebar-logout { opacity: 0; transition: opacity 0.18s ease 0.04s; }

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.role-admin {
    color: #a5b4fc;
}

.role-pro\+ {
    color: #f472b6;
}

.role-pro {
    color: #fbbf24;
}

.role-free {
    color: #94a3b8;
}

.sidebar-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.sidebar-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

.sidebar-home-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    height: 44px;
    border-radius: 13px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
    margin: 4px 14px 8px;
    overflow: hidden;
    white-space: nowrap;
    /* leading emoji acts as the rail icon — pad it into the icon zone */
    text-indent: 16px;
}
.sidebar-home-btn:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.login-home-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #9ca3af;
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}
.login-home-link:hover {
    color: var(--accent);
}

/* MAIN */
#dashboard-page {
    position: relative;
    z-index: 1;
}

.main-content {
    margin-left: var(--sidebar-collapsed);
    min-height: 100vh;
    transition: margin-left 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Menyu qadalganda (pinned) — kontent to'liq menyu kengligiga moslashadi */
.sidebar.pinned ~ .main-content {
    margin-left: var(--sidebar-width);
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-title {
    font-size: 20px;
    font-weight: 700;
}

/* Mobil menyu tugmasi — faqat kichik ekranda ko'rinadi (768px va past).
   top-header'dan tashqarida, position:fixed — Jurnal kabi top-header
   yashiriladigan sahifalarda ham doim bosish mumkin bo'lib qoladi. */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-menu-btn:active { background: var(--accent-dim); }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge-free {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-pro {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-proplus-tag {
    background: rgba(236, 72, 153, 0.25);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-admin-tag {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.page-content {
    padding: 28px 32px 40px;
}

/* TABS */
.tab-panel {
    display: none;
}

/* Emil Kowalski: tab switches happen often — keep quick */
.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* CARDS — glass + 3D chuqurlik */
.card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .card {
    background: #fffefa;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
}

.card-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%),
        var(--bg-card);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Solid colors — cleaner than gradients for structural elements */
.stat-card.accent::after {
    background: var(--accent);
}

.stat-card.red-card::after {
    background: var(--red);
}

.stat-card.green-card::after {
    background: var(--green);
}

.stat-card.orange-card::after {
    background: var(--orange);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.accent .stat-icon {
    background: var(--accent-dim);
}

.red-card .stat-icon {
    background: var(--red-dim);
}

.green-card .stat-icon {
    background: var(--green-dim);
}

.orange-card .stat-icon {
    background: var(--orange-dim);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--text);
}

.accent .stat-value {
    color: var(--accent-light);
}

.red-card .stat-value {
    color: var(--red-light);
}

.green-card .stat-value {
    color: var(--green-light);
}

.orange-card .stat-value {
    color: var(--orange);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.stat-change.up {
    background: var(--green-dim);
    color: var(--green);
}

.stat-change.down {
    background: var(--red-dim);
    color: var(--red);
}

/* CHARTS */
.charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
/* grid item blowout'ni oldini olish — canvas konteynerdan oshmasin */
.charts-grid > .card { min-width: 0; overflow: hidden; }

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    min-width: 0;
}
.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* TABLES */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: rgba(31, 41, 55, 0.7);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

/* Light theme table header — minimal: oq-kulrang fon, kichik harflar */
[data-theme="light"] th {
    background: #fbfaf4;
    color: #a3a095;
}

/* Qoldiq Table - Sariq Border */
.qoldiq-table th {
    border-bottom: 3px solid #eab308;
}

.qoldiq-header-row th {
    background: rgba(234, 179, 8, 0.15);
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .qoldiq-header-row th {
    background: rgba(234, 179, 8, 0.2);
    color: #0f172a;
}

[data-theme="dark"] .qoldiq-header-row th {
    color: #f8fafc;
}

td {
    color: var(--text);
    font-size: 13px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tr:hover td {
    background: rgba(99, 102, 241, 0.07);
}

tr:last-child td {
    border-bottom: none;
}

/* ── Zayavka muddati ranglash (kassir hisobotidagi uslubda: ochiq fon + chap chiziq) ── */
tr.zyv-age-red td {
    background: #fff5f5 !important;
    color: #7f1d1d !important;
}
tr.zyv-age-red td:first-child {
    border-left: 4px solid #ef4444;
}
tr.zyv-age-dark td {
    background: #cbd5e1 !important;
    color: #1f2937 !important;
}
tr.zyv-age-dark td:first-child {
    border-left: 4px solid #374151;
}
/* Ochiq fonda asosiy matn to'q rangda o'qiladi (badge/select o'z stilini saqlaydi) */
tr.zyv-age-red td b, tr.zyv-age-red td > div, tr.zyv-age-red td > div div { color: #7f1d1d; }
tr.zyv-age-dark td b, tr.zyv-age-dark td > div, tr.zyv-age-dark td > div div { color: #1f2937; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.badge-kirim {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    font-weight: 700;
}

.badge-chiqim {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    font-weight: 700;
}

.mono {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.form-card.kirim-form::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.form-card.chiqim-form::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.f-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.f-input,
.f-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    margin-bottom: 16px;
    transition: var(--transition);
}

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

.f-input:focus,
.f-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.f-select {
    cursor: pointer;
    appearance: none;
}

[data-theme="light"] .f-input,
[data-theme="light"] .f-select {
    background: #fffefa;
    border-color: var(--border);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Emil Kowalski: buttons must feel responsive to press — scale gives instant tactile feedback */
.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-dim);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
}

.success-msg {
    font-size: 12px;
    font-weight: 600;
    padding: 10px 16px;
    margin-top: 12px;
    border-radius: var(--radius-sm);
    display: none;
}

.success-msg.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.success-msg.ok {
    background: var(--green-dim);
    color: var(--green);
}

.success-msg.err {
    background: var(--red-dim);
    color: var(--red);
}

/* SETTINGS */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-full {
    grid-column: 1/-1;
}

/* ADMIN */
.user-mgmt-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    grid-auto-flow: row;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    break-inside: avoid;
}

.user-card:hover {
    border-color: var(--border-light);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.user-card-name {
    font-size: 14px;
    font-weight: 600;
}

.user-card-id {
    font-size: 11px;
    color: var(--text-muted);
}

.user-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.user-role-select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

/* REPORT FILTERS */
.report-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-input {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    transition: var(--transition);
}

.filter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: var(--radius-full);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid;
}

.timeline-dot.kirim-dot {
    border-color: var(--green);
    background: var(--green-dim);
}

.timeline-dot.chiqim-dot {
    border-color: var(--red);
    background: var(--red-dim);
}

.timeline-content {
    font-size: 13px;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* DYNAMIC ROWS */
.dynamic-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1fr 1.2fr 1.2fr auto;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.dynamic-row .f-label {
    font-size: 10px;
    margin-bottom: 4px;
}

.dynamic-row .f-input {
    margin-bottom: 0;
    padding: 10px 12px;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    max-height: 180px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-md);
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.autocomplete-item:hover {
    background: var(--accent-dim);
}

.total-summary {
    font-size: 18px;
    font-weight: bold;
    text-align: right;
    margin-bottom: 16px;
}

/* PERIOD SELECTOR */
.period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.period-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.period-btn.active {
    background: var(--accent);
    color: white;
}

.period-btn:hover:not(.active) {
    color: var(--text);
}

/* UTILITY */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
    font-weight: 500;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quick-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.quick-item {
    text-align: center;
    padding: 12px;
    background: rgba(31, 41, 55, 0.3);
    border-radius: var(--radius-sm);
}

.quick-item-val {
    font-size: 20px;
    font-weight: 700;
}

.quick-item-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.export-group {
    display: flex;
    gap: 8px;
}

/* QOLDIQ SIDE ITEMS */
.qoldiq-side-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition);
}

.qoldiq-side-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.qoldiq-side-item .q-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}

.qoldiq-side-item .q-qty {
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mt-16 {
    margin-top: 16px;
}

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

    .charts-grid {
        grid-template-columns: 1fr
    }

    .user-mgmt-card {
        grid-template-columns: 1fr 1fr;
        grid-auto-flow: row
    }
}

@media (max-width:768px) {
    /* Sidebar do'kondan tortiladigan panel (drawer) sifatida ishlaydi:
       yopiq holatda ekrandan chapga chiqib turadi, tugma bosilganda kirib keladi. */
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 12px 0 48px rgba(0, 0, 0, 0.4);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Mobilda rail-holat (faqat ikon) ma'nosiz — panel ochilganda yorliqlar doim ko'rinsin */
    .sidebar-brand-text,
    .sidebar-pin,
    .nav-section-label,
    .nav-item > span:not(.nav-icon),
    .nav-item .nav-badge,
    .sidebar-user-info,
    .sidebar-logout {
        opacity: 1 !important;
        height: auto !important;
        padding-top: inherit;
    }

    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 65;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    }

    /* Drawer ochiq paytda tugma orqaga o'tib qolmasin — vaqtincha yashiramiz */
    .sidebar.mobile-open ~ .mobile-menu-btn {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-backdrop {
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 55;
    }

    /* Jurnalda top-header yashirilganda uning yopishqoq filtr paneli
       tepaga to'liq yopishib, mobil hamburger tugmasi bilan ustma-ust tushmasin */
    body.tab-jurnal-active #tab-jurnal .card > .card-header {
        top: 54px;
    }

    /* Sarlavha matni fixed hamburger tugmasi ostida qolib ketmasin */
    .top-header {
        padding-left: 64px;
    }

    .main-content {
        margin-left: 0
    }

    .stats-grid {
        grid-template-columns: 1fr
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .settings-grid {
        grid-template-columns: 1fr
    }

    .user-mgmt-card {
        grid-template-columns: 1fr;
        grid-auto-flow: row
    }

    .page-content {
        padding: 16px
    }

    .dynamic-row {
        grid-template-columns: 1fr 1fr;
        border-bottom: 1px dashed var(--border);
        padding-bottom: 16px
    }

    .dynamic-row .prod-col {
        grid-column: 1/-1
    }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b !important;
    /* <-- SHU: none qilsangiz orqasi shaffof bo'lib qoladi! Mutlaqo rang berish kerak! */
    border: 2px solid #6366f1 !important;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 999999 !important;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 1);
    margin-top: 5px;
    padding: 0;
}

.autocomplete-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    font-size: 15px;
    color: #ffffff !important;
    background: #1e293b !important;
    /* <-- SHU: Bu yerga ham qattiq rang yozish shart! */
}

.autocomplete-item:hover {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

/* Resize Handle for Inventarizatsiya */
.resize-handle {
    width: 6px;
    cursor: col-resize;
    background: var(--border);
    border-radius: 3px;
    transition: background 0.2s ease;
    flex-shrink: 0;
    position: relative;
    margin: 0 -3px;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.active {
    background: var(--accent);
    width: 8px;
    margin: 0 -4px;
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 30px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.5;
}

.resize-handle:hover::before,
.resize-handle.active::before {
    background: white;
    opacity: 1;
    width: 4px;
    height: 35px;
}

.resize-handle-h {
    height: 6px;
    cursor: row-resize;
    background: var(--border);
    border-radius: 3px;
    transition: background 0.2s ease;
    flex-shrink: 0;
    position: relative;
    margin: -3px 0;
    z-index: 10;
}

.resize-handle-h:hover,
.resize-handle-h.active {
    background: var(--accent);
    height: 8px;
    margin: -4px 0;
}

.resize-handle-h::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.5;
}

.resize-handle-h:hover::before,
.resize-handle-h.active::before {
    background: white;
    opacity: 1;
    width: 35px;
    height: 4px;
}

.inventar-resize-container {
    height: calc(100vh - 140px);
    gap: 12px;
}

.inventar-left-panel,
.inventar-right-panel {
    transition: flex 0.05s ease;
}


.autocomplete-item span {
    font-size: 11px;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════
   SETTINGS HUB CARDS
   ═══════════════════════════════════════════════ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.settings-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-width: 1200px;
}

.hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hub-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Emil Kowalski: translateY(-4px) was too much — reduced to -2px */
.hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.hub-card:hover::before {
    opacity: 0.06;
}

/* Emil Kowalski: scale(0.98) on active — good press feedback */
.hub-card:active {
    transform: scale(0.97);
}

.hub-icon {
    font-size: 44px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    /* Emil Kowalski: specify exact property, not shorthand */
    transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Emil Kowalski: scale(1.15) was too dramatic — 1.08 is subtle and tasteful */
.hub-card:hover .hub-icon {
    transform: scale(1.08);
}

.hub-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.hub-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
    z-index: 1;
}
/* ── PTO Toggle Switch ── */
.pto-toggle {
  position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0;
}
.pto-toggle input { opacity: 0; width: 0; height: 0; }
.pto-toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 26px; transition: .25s;
}
.pto-toggle-slider:before {
  content: ""; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.pto-toggle input:checked + .pto-toggle-slider { background: var(--accent); }
.pto-toggle input:checked + .pto-toggle-slider:before { transform: translateX(20px); }
.pto-toggle input:disabled + .pto-toggle-slider { opacity: .5; cursor: not-allowed; }

.pto-cascade-wrap {
  margin-left: 20px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin-top: 4px;
  overflow: hidden;
  transition: all .25s ease;
}
.pto-switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg-card);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin-bottom: 4px;
}
.pto-switch-label { font-size: 14px; font-weight: 500; color: var(--text); }
.pto-switch-desc  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Hisobotdan jurnalga o'tganda yozuvni "yondirish" — 2 marta qoraygan rangda yonadi */
@keyframes jrnFlash {
  0%   { background-color: transparent; }
  25%  { background-color: rgba(99, 102, 241, 0.45); }
  50%  { background-color: transparent; }
  75%  { background-color: rgba(99, 102, 241, 0.45); }
  100% { background-color: transparent; }
}
tr.jurnal-detail.jrn-flash,
tr.jurnal-detail.jrn-flash td {
  animation: jrnFlash 1.6s ease-in-out;
}
/* To'lov rejasiga o'tganda qatorni "yondirish" (kalendardan Amallar tabiga) */
tr.tlv-flash,
tr.tlv-flash td {
  animation: jrnFlash 1.6s ease-in-out;
}

/* ===================================================================
   DASHBOARD v2 — Obyekt konteynerlari + Yuk jarayoni (pipeline)
   =================================================================== */

/* ---- Obyekt konteyner grid ---- */
.obyekt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.obyekt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
.obyekt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120% 120% at 100% 0%, var(--accent-dim), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.obyekt-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}
.obyekt-card:hover::after { opacity: 1; }

.obyekt-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.obyekt-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    overflow: hidden;
}
.obyekt-icon.photo { background: var(--bg-input); }
.obyekt-icon.photo img,
.obyekt-detail-ico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.obyekt-detail-ico { overflow: hidden; padding: 0; }
.obyekt-photo-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
/* Sozlamalar — obyekt rasm preview */
.oc-image-preview {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}
.oc-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Zayavka — obyekt manzili bloki.
   Yonma-yon: belgi | manzil | "Xaritada". Kichik ekranda tugma pastga tushadi.
   DIQQAT: JS bu blokni ko'rsatganda display:flex qo'yishi shart (block emas). */
.zyv-manzil {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}
.zyv-manzil-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.zyv-manzil-body { flex: 1 1 220px; min-width: 0; }
.zyv-manzil-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.4;
}
.zyv-manzil-txt {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 3px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.zyv-manzil-btn {
    flex: none;
    margin-left: auto;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.zyv-manzil-btn:hover { background: var(--accent); color: #fff; }

/* Obyekt nomi yonidagi kichik avatar (🏢 o'rniga) */
.obyekt-inline-img {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    object-fit: cover;
    vertical-align: -4px;
    display: inline-block;
}
.obyekt-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 3px 9px;
    border-radius: var(--radius-full);
}
.obyekt-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.obyekt-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.obyekt-value span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.obyekt-mini {
    display: flex;
    gap: 12px;
    font-size: 11px;
    font-weight: 600;
}
.obyekt-mini .up { color: var(--green); }
.obyekt-mini .down { color: var(--red); }

/* ---- Yuk jarayoni (cargo pipeline) ---- */
.cargo-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.cargo-col {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}
.cargo-col.wait { border-top: 3px solid var(--orange); }
.cargo-col.move { border-top: 3px solid var(--accent); }
.cargo-col.done { border-top: 3px solid var(--green); }

.cargo-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 12px;
}
.cargo-col-title {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.cargo-col-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cargo-col-count {
    font-size: 13px;
    font-weight: 800;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cargo-col-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding: 2px;
}
.cargo-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.cargo-item:hover { transform: translateX(2px); border-color: var(--accent); }
.cargo-item.wait { border-left: 3px solid var(--orange); }
.cargo-item.move { border-left: 3px solid var(--accent); }
.cargo-item.done { border-left: 3px solid var(--green); }
.cargo-item-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}
.cargo-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cargo-item-qty { font-size: 12px; font-weight: 700; color: var(--accent-light); white-space: nowrap; }
.cargo-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}
.cargo-item-date { margin-top: 4px; font-size: 10px; color: var(--text-muted); }
.cargo-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 24px 0;
}

/* ---- Obyekt detail modal ---- */
.obyekt-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.obyekt-detail-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 820px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    padding: 24px;
}
.obyekt-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.obyekt-detail-title-wrap { display: flex; align-items: center; gap: 12px; }
.obyekt-detail-ico {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--accent-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
}
.obyekt-detail-header h3 { font-size: 19px; font-weight: 800; color: var(--text); }
.obyekt-detail-close {
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    width: 34px; height: 34px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition-fast);
}
.obyekt-detail-close:hover { background: var(--red); color: #fff; }
.obyekt-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.obyekt-detail-stats > div {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
}
.obyekt-detail-stats .lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.obyekt-detail-stats .val { font-size: 18px; font-weight: 800; color: var(--text); }
.obyekt-detail-cols {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}
.od-subtitle { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }

@media (max-width: 768px) {
    .cargo-board { grid-template-columns: 1fr; }
    .obyekt-detail-stats { grid-template-columns: 1fr; }
    .obyekt-detail-cols { grid-template-columns: 1fr; }
}

/* ===================================================================
   JURNAL v2 — 2-ustun layout + o'ng overview panel (jurnal.webp)
   =================================================================== */
.jurnal-layout {
    display: block;   /* jurnal to'liq kenglikda — umumiy ko'rinish endi off-canvas drawer */
}

/* ── Umumiy ko'rinish — o'ngdan chiqadigan drawer (overlay) ── */
.jurnal-overview {
    position: fixed;
    top: 78px;
    right: 0;
    width: 320px;
    max-width: 88vw;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(20px);
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    z-index: 1200;
    box-shadow: -10px 0 34px rgba(0, 0, 0, 0.38);
}
.jurnal-overview.open { transform: translateX(0); }

/* Yarim doira tutqich — o'ng chekkada, sichqoncha borganda to'liq chiqadi */
.jurnal-ov-handle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(52%);   /* yarmi ekrandan tashqarida */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient, var(--accent, #6366f1));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1201;
    opacity: 0.55;
    transition: transform .22s ease, opacity .22s ease, right .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -3px 0 14px rgba(0, 0, 0, 0.32);
}
.jurnal-ov-handle:hover { transform: translateY(-50%) translateX(0); opacity: 1; }
.jurnal-ov-handle svg { width: 22px; height: 22px; transition: transform .3s ease; }
/* Drawer ochilganda tutqich drawer chetiga suriladi va ✕ ga aylanadi */
.jurnal-overview.open ~ .jurnal-ov-handle {
    right: 320px;
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.jurnal-overview.open ~ .jurnal-ov-handle svg { transform: rotate(180deg); }
@media (max-width: 400px) {
    .jurnal-overview.open ~ .jurnal-ov-handle { right: 88vw; }
}

/* Backdrop (drawer ochiq bo'lганда) */
.jurnal-ov-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 1199;
}
.jurnal-ov-backdrop.show { opacity: 1; pointer-events: auto; }
.jrn-ov-title { font-size: 14px; font-weight: 800; color: var(--text); }
.jrn-ov-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.jrn-ov-lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.jrn-ov-val { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.jrn-ov-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jrn-ov-mini {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}
.jrn-ov-mini.up { border-left: 3px solid var(--green); }
.jrn-ov-mini.down { border-left: 3px solid var(--red); }
.jrn-ov-num { font-size: 17px; font-weight: 800; }
.jrn-ov-mini.up .jrn-ov-num { color: var(--green); }
.jrn-ov-mini.down .jrn-ov-num { color: var(--red); }
.jrn-ov-sub {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}
.jrn-ov-kat { display: flex; flex-direction: column; gap: 9px; }
.jrn-ov-bar-head {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.jrn-ov-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.jrn-ov-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.jrn-ov-obj { display: flex; flex-direction: column; gap: 6px; }
.jrn-ov-obj-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.jrn-ov-obj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.jrn-ov-obj-val { color: var(--text); font-weight: 700; flex-shrink: 0; }
.jrn-ov-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }

/* Tozaroq jurnal qatorlari */
.jurnal-group { transition: background 0.15s ease; }
.jurnal-group:hover td { background: var(--bg-card-hover); }
.jurnal-group.expanded td { background: var(--accent-dim); }
.jurnal-group .toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Yopiq holatda o'ngga qaragan, ochilganda pastga aylanadi (silliq harakat) */
    transform: rotate(-90deg);
    transition: transform 0.25s ease;
}
.jurnal-group .toggle-icon.open { transform: rotate(0deg); }
.jurnal-group .toggle-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.18s ease;
}
.jurnal-group:hover .toggle-icon svg { color: var(--accent); }

/* To'liq Jurnal — qidiruv/filtr paneli skrollda TEPADA qoladi (yopishqoq) */
#tab-jurnal .card > .card-header,
#bank-view-jurnal .card > .card-header {
    position: sticky;
    top: var(--header-height);
    z-index: 25;
    background: var(--bg-card);
    margin: -24px -24px 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 8px 16px -12px rgba(0, 0, 0, 0.5);
}

/* O'ng paneldagi ko'chish (skroll) tugmalari */
.jrn-nav {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 2px;
}
.jrn-nav-title { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.jrn-nav-btns { display: flex; gap: 8px; }
.jrn-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.jrn-nav-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.jrn-nav-btn:active { transform: translateY(0); }
.jrn-nav-btn svg { width: 22px; height: 22px; }
.jrn-nav-btn.page svg { width: 20px; height: 20px; }

@media (max-width: 1100px) {
    #tab-jurnal .card > .card-header { position: static; margin: -24px -24px 16px; }
}

/* Jurnal sahifasida ortiqcha tepadagi "Jurnal" sarlavha panelini yashirish (joy tejaladi) */
body.tab-jurnal-active .top-header { display: none; }
body.tab-jurnal-active #tab-jurnal .card > .card-header { top: 0; }

/* PTO sahifasida ham xuddi shunday — tepadagi "PTO — Texnik Nazorat" sarlavha o'rniga
   PTO'ning o'zi ichidagi tab tugmalari + Bajarilish filtr paneli (obyekt/blok/qavat/qidiruv)
   tepada yopishqoq (sticky) qoladi — pastga skroll qilganda ular ko'rinishda qolishi uchun */
body.tab-pto-active .top-header { display: none; }
@media (max-width: 1100px) {
    #pto-tabbar { position: static; }
    #baj-sticky { position: static; }
}

/* Jurnal jadvali: tartiblanadigan ustun sarlavhalari */
#tab-jurnal thead th[data-sort] { user-select: none; white-space: nowrap; transition: color .15s; }
#tab-jurnal thead th[data-sort]:hover { color: var(--accent-light, #a5b4fc); }
#tab-jurnal thead th.th-sorted { color: var(--accent-light, #a5b4fc); }
#tab-jurnal thead th .sort-arrow { font-size: 10px; font-weight: 700; }

/* ── Valyuta almashtirgich (som / $) — kirim/chiqim/vozvrat ── */
.cur-switch {
    display: inline-flex;
    background: var(--bg-input, rgba(31,41,55,0.6));
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    position: relative;
    user-select: none;
}
.cur-opt {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.cur-opt img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: grayscale(0.4);
    opacity: 0.6;
}
.cur-opt.active {
    color: #fff;
}
.cur-opt.active img { filter: none; opacity: 1; }
.cur-switch[data-cur="som"] .cur-opt[data-val="som"].active { background: var(--green, #10b981); }
.cur-switch[data-cur="usd"] .cur-opt[data-val="usd"].active { background: #2563eb; }
.cur-kurs {
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
}
.cur-kurs b { color: var(--accent-light, #a5b4fc); }

/* ═══════════════════════════════════════════════════════════
   MINIMALIZM — ZICH VA TOZA QATLAM (2026-07-30)
   Namuna-3 asosida: kam soya, kichik radius, zich joylashuv.
   Faqat ko'rinish — hech qanday funksiyaga ta'sir qilmaydi.
   ═══════════════════════════════════════════════════════════ */

body {
    font-size: 13px;
    line-height: 1.5;
}

/* Kartalar — tekis, shisha effektsiz */
.card,
.stat-card,
.form-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: var(--radius-md);
    box-shadow: none;
}

.card {
    padding: 16px;
}

.card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-light);
}

.stat-card {
    background: var(--bg-card);
    padding: 14px 16px;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: 14px;
}

.card-title {
    font-size: 14px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stats-grid {
    gap: 12px;
    margin-bottom: 16px;
}

/* Jadval — zich qatorlar, ko'proq ma'lumot sig'adi */
th {
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

td {
    padding: 8px 12px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

/* Tugmalar — ixcham */
.btn {
    padding: 9px 16px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.btn:hover {
    transform: none;
}

/* Formalar — zich */
.form-card {
    padding: 16px;
}

.f-input,
.f-select {
    padding: 8px 12px;
    font-size: 12.5px;
    margin-bottom: 12px;
}

.f-label {
    font-size: 10.5px;
}

/* Sidebar / nav */
.nav-item {
    border-radius: 8px;
}

/* Light temada barcha "glow" va gradientlar o'chadi */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .form-card {
    background: #fffefa;
    box-shadow: none;
}

[data-theme="light"] .card:hover,
[data-theme="light"] .stat-card:hover {
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .sidebar,
[data-theme="light"] .header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg-sidebar);
    border-color: var(--border);
}

[data-theme="light"] th {
    background: #fbfaf4;
    color: #a3a095;
}

[data-theme="light"] tbody tr:hover td {
    background: #f6f5ee;
}

/* Autocomplete — light temada oq, toza */
[data-theme="light"] .autocomplete-dropdown {
    background: #fffefa !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .autocomplete-item {
    background: #fffefa !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    padding: 10px 14px;
}

[data-theme="light"] .autocomplete-item:hover {
    background-color: var(--accent) !important;
    color: #ffffff !important;
}

[data-theme="light"] .quick-item {
    background: var(--bg-secondary);
}

/* Qoldiq jadval sarlavhasi — minimal sariq urg'u saqlanadi */
[data-theme="light"] .qoldiq-header-row th {
    background: #fefce8;
    color: #854d0e;
}

/* Animatsion "glow"lar o'chirilgan */
[data-theme="light"] .animate-glow {
    animation: none;
}

/* ── Dark tema kontrast kuchaytirish (2026-07-30) ──
   Boxlar va tugmalar qora fonda aniq ajralib turishi uchun */
:root:not([data-theme="light"]) th,
[data-theme="dark"] th {
    background: #20242c;
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-outline,
:root:not([data-theme="light"]) .btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-light);
    color: var(--text);
}

[data-theme="dark"] .card,
:root:not([data-theme="light"]) .card,
[data-theme="dark"] .stat-card,
:root:not([data-theme="light"]) .stat-card,
[data-theme="dark"] .form-card,
:root:not([data-theme="light"]) .form-card {
    background: var(--bg-card);
}

[data-theme="dark"] .quick-item,
:root:not([data-theme="light"]) .quick-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

/* Light tema — override qatlamidagi oq fonlar iliq tonga moslangan
   (yuqorida sed orqali #fffefa ga o'zgartirilgan) */

/* ═══════════ ADMIN PANEL — Foydalanuvchilar jadvali ═══════════ */
.admin-users-table { width: 100%; border-collapse: collapse; }
.admin-users-table thead th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}
.admin-users-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13px;
}
.admin-users-table tbody tr:last-child td { border-bottom: none; }
.admin-users-table tbody tr:hover { background: var(--bg-secondary); }

/* Login — monospace, ajralib turadi */
.ap-login {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 13px;
}
/* Lavozim — bosiq ko'k ton */
.ap-role { color: #4f6ef7; font-size: 13px; }

/* Onlayn nuqtasi */
.ap-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #16a34a; margin-right: 6px; vertical-align: middle;
}

/* Holat "tabletka"lari */
.ap-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.ap-pill-green  { background: rgba(22,163,74,.12);  color: #16a34a; border-color: rgba(22,163,74,.25); }
.ap-pill-orange { background: rgba(234,140,14,.12); color: #d97706; border-color: rgba(234,140,14,.28); }
.ap-pill-red    { background: rgba(220,38,38,.12);  color: #dc2626; border-color: rgba(220,38,38,.25); }

/* Amal tugmalari (ikonka) */
.ap-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.ap-ico {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: background .15s, border-color .15s, opacity .15s;
    color: var(--text-secondary);
}
.ap-ico:hover:not(:disabled) { background: var(--bg-secondary); border-color: var(--border); }
.ap-ico:disabled { opacity: .28; cursor: not-allowed; }
.ap-ico-key   { color: #ea8c0e; }
.ap-ico-del   { color: #dc2626; }
.ap-ico-del:hover:not(:disabled) { background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.30); }

/* ── Tahrirlash oynasi ── */
.ap-modal-bg {
    position: fixed; inset: 0; z-index: 10030;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.ap-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: min(680px, 96vw);
    max-height: 92vh;
    overflow: auto;
    padding: 24px;
}
.ap-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 18px;
}
.ap-modal-title { font-size: 18px; font-weight: 700; }
.ap-modal-sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.ap-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .ap-grid2 { grid-template-columns: 1fr; } }
.ap-sec-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
    margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--border);
}
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.ap-chip:hover { border-color: var(--accent); }
.ap-token {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px; background: var(--bg-secondary);
    padding: 4px 8px; border-radius: 6px; color: var(--text-muted);
}
.ap-modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── Jurnal jadvali: minimalist ko'rinish ──────────────────────────────
   Tur/Kategoriya ilgari dumaloq "pill" ichida edi; endi faqat rangli matn.
   Qator tugmalari (nakladnoy / mahsulot / i) firma nomidan keyin turgani
   uchun har qatorda turli joyda ko'rinardi — endi Amallar ustunida,
   strelkaning chap tomonida tekis tizilib turadi. */
.jrn-tur {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.jrn-tur-kirim  { color: var(--green); }
.jrn-tur-chiqim { color: var(--red); }
.jrn-tur-brak   { color: #dc2626; }
.jrn-cur {
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6;
  margin-left: 4px;
}
.jrn-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
/* Tugmalarning o'z chap chekinishi tekislashni buzmasin — oraliqni gap beradi */
.jrn-row-actions > button,
.jrn-row-actions > a {
  margin-left: 0 !important;
  flex: none;
}
.jrn-row-actions .toggle-icon { flex: none; cursor: pointer; }

/* ── Aks sverka: umumiy ko'rsatkich kartochkalari ──────────────────────
   Ilgari bitta kulrang chiziqda stiker + matn aralash turardi va $ qiymati
   "so'm $" bo'lib chiqardi. Endi tekis to'rt kartochka, stikersiz. */
.sv-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.sv-card {
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}
.sv-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sv-card-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sv-card-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}
.sv-card-usd {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #60a5fa;
  font-family: var(--font-mono, monospace);
}
/* Faqat raqam rangi o'zgaradi — ramka/fon bir xil qoladi (minimalizm) */
.sv-card-orange .sv-card-value { color: var(--orange); }
.sv-card-green  .sv-card-value { color: var(--green); }
.sv-card-red    .sv-card-value { color: var(--red); }

/* ── Zayavka jadvali: jurnal bilan bir xil ko'rinish ───────────────────
   Guruh qatori + ochilib ketadigan mahsulot qatorlari, minimalist holat
   matni (fon/ramkasiz), tugmalar Amallar ustunida tekislangan. */
.zyv-st {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.zyv-st-keldi   { color: var(--green); }
.zyv-st-kelmadi { color: var(--red); }
.zyv-st-pending { color: var(--orange); }
.zyv-st-aralash { color: var(--text-muted); }

/* Guruh qatori — jurnaldagi .jurnal-group kabi ajralib tursin */
tr.zyv-group > td {
  background: rgba(99, 102, 241, 0.06);
  font-weight: 500;
}
tr.zyv-group.expanded > td {
  background: rgba(99, 102, 241, 0.12);
}
tr.zyv-item > td {
  font-size: 12px;
}
/* Ochilgan guruh ostidagi qatorlar biroz ichkariroq boshlansin */
tr.zyv-item > td:first-child {
  padding-left: 22px;
}

/* Yetkazish sanasi maydoni — jadval ichida ixcham turishi uchun */
.zyv-date {
  font-size: 11px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono, monospace);
  max-width: 132px;
}
.zyv-date:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Brigadalar: obyekt bo'yicha papka ko'rinishi + sudrab tartiblash ── */
.brg-folder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.brg-folder-head:hover { background: rgba(99, 102, 241, 0.06); }
.brg-folder-name { font-weight: 700; font-size: 14px; }
.brg-folder-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
}
.brg-folder-warn .brg-folder-name { color: var(--orange); }

/* Tartib raqami — ushlab sudraladigan joy */
.brg-handle {
  cursor: grab;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1px;
}
.brg-handle:active { cursor: grabbing; }
.brg-row { transition: background .15s; }
.brg-row:hover { background: rgba(99, 102, 241, 0.05); }
.brg-row:hover .brg-handle { color: var(--accent-light, var(--accent)); }
.brg-row.brg-dragging {
  opacity: .45;
  background: rgba(99, 102, 241, 0.14);
}

/* ===================================================================
   TARIX hubi — TERMINAL ko'rinishi.
   Foydalanuvchi so'rovi: "ranglar stikerlarni olib tashlagin",
   "qora fon huddi terminaldek bo'lsin".
   Shuning uchun: qora fon, monoshrift, faqat kulrang darajalari,
   yumaloq shakl yo'q, qatorlar zich — ko'p ma'lumot bir ekranda.
   =================================================================== */
body.tab-tarix-active .top-header { display: none; }

#tab-tarix {
    --trm-bg: #000;
    --trm-line: #1e1e1e;
    --trm-text: #d4d4d4;
    --trm-dim: #6e6e6e;
    --trm-bright: #ffffff;
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Courier New", monospace;
}

#tab-tarix .trx-card {
    background: var(--trm-bg);
    border: 1px solid var(--trm-line);
    border-radius: 0;
    padding: 0;
    color: var(--trm-text);
}

#tab-tarix .card > .card-header {
    position: sticky;
    top: var(--header-height);
    z-index: 25;
    background: var(--trm-bg);
    margin: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--trm-line);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: none;
}
body.tab-tarix-active #tab-tarix .card > .card-header { top: 0; }

/* Ko'rinish almashtirgich — terminal tab: [ nom ] */
#tab-tarix .trx-tabs { display: flex; gap: 14px; }
#tab-tarix .trx-tab {
    background: none;
    border: none;
    border-radius: 0;
    padding: 4px 0;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .02em;
    color: var(--trm-dim);
    cursor: pointer;
}
#tab-tarix .trx-tab::before { content: "  "; white-space: pre; }
#tab-tarix .trx-tab:hover { color: var(--trm-text); }
#tab-tarix .trx-tab.active { color: var(--trm-bright); }
#tab-tarix .trx-tab.active::before { content: "> "; white-space: pre; }

#tab-tarix .trx-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
#tab-tarix .trx-count { font-size: 11px; color: var(--trm-dim); margin-right: 4px; }
#tab-tarix .trx-inp,
#tab-tarix .btn {
    font-family: inherit;
    font-size: 11px;
    height: 24px;
    padding: 0 8px;
    margin-bottom: 0;
    border-radius: 0;
    background: var(--trm-bg);
    border: 1px solid var(--trm-line);
    color: var(--trm-text);
    box-shadow: none;
    text-transform: none;
    font-weight: 400;
}
#tab-tarix .trx-inp { width: 128px; min-width: 0; }
#tab-tarix .trx-inp::placeholder { color: var(--trm-dim); }
#tab-tarix .trx-inp:focus,
#tab-tarix .btn:hover {
    outline: none;
    border-color: var(--trm-dim);
    background: #0c0c0c;
    color: var(--trm-bright);
}

/* Zich jadval — terminal chiqishi kabi */
#tab-tarix .table-wrap {
    border-radius: 0;
    background: var(--trm-bg);
    max-height: calc(100vh - 120px);
    overflow: auto;
}
#tab-tarix .trx-table { width: 100%; border-collapse: collapse; background: var(--trm-bg); }
#tab-tarix .trx-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--trm-bg);
    font-family: inherit;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--trm-dim);
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid var(--trm-line);
    white-space: nowrap;
}
#tab-tarix .trx-table td {
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1.4;
    padding: 3px 10px;
    border-bottom: 1px solid var(--trm-line);
    vertical-align: top;
    color: var(--trm-text);
    background: transparent;
}
#tab-tarix .trx-table tbody tr:hover td { background: #0d0d0d; }
#tab-tarix .trx-mono { font-size: 11px; }
#tab-tarix .trx-mute { color: var(--trm-dim); }
#tab-tarix .trx-strong { color: var(--trm-bright); font-weight: 400; }
#tab-tarix .trx-nowrap { white-space: nowrap; }
#tab-tarix .trx-tur { color: var(--trm-dim); font-size: 10px; letter-spacing: .06em; }

/* Rang va shakl qoldiqlari: nishon, tugma, bo'sh holat — hammasi bir xil */
#tab-tarix .badge,
#tab-tarix .trx-table .btn {
    border-radius: 0;
    background: none;
    border: 1px solid var(--trm-line);
    color: var(--trm-text);
    padding: 0 6px;
    font-size: 10px;
    font-weight: 400;
    height: 20px;
    line-height: 18px;
}
#tab-tarix .empty-state,
#tab-tarix .empty-state-text { color: var(--trm-dim); font-size: 11.5px; }
#tab-tarix .empty-state-icon { display: none; }
#tab-tarix b, #tab-tarix strong { font-weight: 400; color: var(--trm-bright); }

/* Terminal filtrlari — sana maydonlari va tor selektlar */
#tab-tarix .trx-date { width: 118px; color-scheme: dark; }
#tab-tarix select.trx-inp { width: auto; max-width: 160px; padding-right: 4px; }
#tab-tarix .trx-tools .btn { white-space: nowrap; }
@media (max-width: 900px) {
    #tab-tarix .trx-tools { justify-content: flex-start; }
    #tab-tarix .trx-inp { width: 110px; }
}

/* IP tahlili oynasi (Tarix hubi) — terminal uslubida */
#tab-tarix .trx-ip { cursor: pointer; text-decoration: underline dotted; }
#tab-tarix .trx-ip:hover { color: #fff; }
.trx-ov {
    position: fixed; inset: 0; z-index: 20050;
    background: rgba(0, 0, 0, 0.72);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow: auto;
}
.trx-ov-box {
    background: #000; border: 1px solid #2a2a2a; color: #d4d4d4;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    width: 100%; max-width: 720px; padding: 14px 16px;
}
.trx-ov-box .trx-table th { background: #000; color: #6e6e6e; }
.trx-ov-box .trx-table td { color: #d4d4d4; padding: 3px 8px; font-size: 11.5px; border-bottom: 1px solid #1e1e1e; }
.trx-ov-bosh { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.trx-ov-blok { border: 1px solid #3a3a3a; padding: 6px 8px; font-size: 11.5px; margin-bottom: 10px; }
.trx-ov-sarlavha { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #6e6e6e; margin: 14px 0 4px; }
.trx-ov-amal { display: flex; gap: 6px; margin-top: 14px; }
.trx-ov-box .btn, .trx-ov-box .f-input {
    font-family: inherit; font-size: 11px; height: 26px; padding: 0 10px;
    border-radius: 0; background: #000; border: 1px solid #2a2a2a; color: #d4d4d4;
}
.trx-ov-box .btn:hover { background: #111; color: #fff; }

/* Konsol (jonli oqim) — Tarix hubi */
#tab-tarix .knsl-wrap {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1px;
    background: #1e1e1e;
    height: calc(100vh - 110px);
}
#tab-tarix .knsl-oqim {
    background: #000;
    overflow-y: auto;
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.55;
}
#tab-tarix .knsl-qator { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
#tab-tarix .knsl-vaqt { color: #4a4a4a; }
#tab-tarix .knsl-kim { color: #fff; }
#tab-tarix .knsl-ish { color: #d4d4d4; }
#tab-tarix .knsl-qur { color: #6e6e6e; }
#tab-tarix .knsl-mute { color: #6e6e6e; }
#tab-tarix .knsl-yon { background: #000; padding: 10px; overflow-y: auto; font-size: 11.5px; }
#tab-tarix .knsl-yon-bosh {
    font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: #6e6e6e; margin: 10px 0 6px;
}
#tab-tarix .knsl-yon-bosh:first-child { margin-top: 0; }
#tab-tarix .knsl-onl { color: #d4d4d4; padding: 2px 0; }
#tab-tarix .knsl-onl::before { content: "· "; color: #6e6e6e; }
@media (max-width: 800px) {
    #tab-tarix .knsl-wrap { grid-template-columns: 1fr; height: auto; }
    #tab-tarix .knsl-oqim { height: 60vh; }
}

/* ===================================================================
   ADMIN PANEL — foydalanuvchilar ro'yxati.
   Foydalanuvchi: "yangi foydalanuvchi qo'shish ro'yxat pastida ochilyapti,
   uni box (modal) qil", "qatorlar bir-biriga yaqinroq bo'lsin",
   "minimalizm, yumaloq shakllar kerak emas".
   Faqat KO'RINISH — backend va maydonlar tegilmagan.
   =================================================================== */

/* ── Yangi foydalanuvchi modali ── */
.au-ov {
    position: fixed;
    inset: 0;
    z-index: 20010;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    overflow: auto;
}
.au-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    width: 100%;
    max-width: 880px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.au-bosh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.au-yop {
    background: none;
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 26px;
    height: 26px;
    line-height: 1;
    font-size: 13px;
}
.au-yop:hover { color: var(--text); border-color: var(--text-muted); }
.au-ich { padding: 16px; }
.au-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
}
.au-ich .f-input, .au-ich .f-select, .au-ich .btn { border-radius: 0; }

/* ── Foydalanuvchilar jadvali: zich va burchakli ── */
#tab-admin .card { border-radius: 0; }
#tab-admin .table-wrap { border-radius: 0; }
#tab-admin table th {
    padding: 7px 10px;
    font-size: 10px;
    letter-spacing: .05em;
    white-space: nowrap;
}
#tab-admin #admin-users-rows td {
    padding: 5px 10px;          /* ilgari ~16px — ro'yxat juda uzun edi */
    font-size: 12.5px;
    line-height: 1.3;
    vertical-align: middle;
}
#tab-admin #admin-users-rows tr { border-bottom: 1px solid var(--border); }
#tab-admin #admin-users-rows tr:hover { background: var(--bg-secondary); }

/* Nishonlar (Faol/Bloklangan) — yumaloq emas, ixcham */
#tab-admin #admin-users-rows .badge,
#tab-admin #admin-users-rows .z-st {
    border-radius: 0;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
}
/* Amal tugmalari yonma-yon va tor */
#tab-admin #admin-users-rows td:last-child { white-space: nowrap; }
#tab-admin #admin-users-rows button {
    border-radius: 0;
    padding: 2px 5px;
    font-size: 13px;
    line-height: 1;
}
#tab-admin .btn, #tab-admin .f-input, #tab-admin .f-select { border-radius: 0; }

/* ══════════════════════════════════════════════════════════════════
   UCHTA TIZIM — Ombor · Sotuv · Buxgalteriya
   Kirish kartasi bosilgan tugmaga qarab almashadi: turgan tomonidan
   magnitga tortilib chiqib ketadi, qarama-qarshi tomondan kirib keladi.
   ══════════════════════════════════════════════════════════════════ */

/* Har tizimning o'z rangi — JS `--tiz` va `--tiz-2` ni almashtiradi */
#login-page {
    --tiz: #6366f1;
    --tiz-2: #8b5cf6;
    --tiz-soft: rgba(99, 102, 241, 0.12);
    --tiz-glow: rgba(99, 102, 241, 0.42);
}

.login-card::after {
    content: '';
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--tiz), var(--tiz-2));
    transition: background 500ms var(--ease-out);
}

#login-page .login-brand h1 em {
    font-style: normal;
    color: var(--tiz);
    transition: color 500ms var(--ease-out);
}

#login-page .login-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tiz);
    background: var(--tiz-soft);
    border-color: var(--tiz-soft);
    transition: color 500ms var(--ease-out), background 500ms var(--ease-out);
}
.tiz-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tiz);
    transition: background 500ms var(--ease-out);
}

#login-page .login-btn { background: linear-gradient(135deg, var(--tiz), var(--tiz-2)); }
#login-page .login-btn:hover { box-shadow: 0 8px 30px var(--tiz-glow); }
#login-page .field-input:focus { border-color: var(--tiz); box-shadow: 0 0 0 3px var(--tiz-soft); }
#login-page .login-home-link:hover { color: var(--tiz); }

/* ── Boshqa tizimlar tugmalari ─────────────────────────────────── */
.hub-wrap {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eaecf0;
}
.hub-title {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
}
#tiz-hublar { display: flex; flex-direction: column; gap: 10px; }

.hub {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    background: #fffefa;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-family: inherit;
    cursor: pointer;
    transition: transform 240ms var(--ease-out),
                border-color 240ms var(--ease-out),
                box-shadow 280ms var(--ease-out);
}
.hub:hover,
.hub:focus-visible {
    transform: translateY(-3px) scale(1.015);
    border-color: var(--hub-c);
    box-shadow: 0 10px 30px var(--hub-glow);
    outline: none;
}
.hub:active { transform: translateY(-1px) scale(0.985); }

.hub-nom {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: color 240ms var(--ease-out);
}
.hub:hover .hub-nom { color: var(--hub-c); }

/* Yorug'lik chapdan o'ngga yuguradi. Telefonda hover yo'q — shuning
   uchun o'zi ham davriy ravishda o'tib turadi. */
.hub .yorug {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(100deg,
        transparent 30%,
        var(--hub-sheen) 44%,
        var(--hub-sheen-hot) 50%,
        var(--hub-sheen) 56%,
        transparent 70%);
    transform: translateX(-120%);
    animation: hubYorug 3.4s var(--ease-out) infinite;
    animation-delay: var(--hub-kech, 0s);
}
@keyframes hubYorug {
    0%   { transform: translateX(-120%); }
    38%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}
.hub:hover .yorug,
.hub:focus-visible .yorug { animation: hubYorugTez 900ms var(--ease-out) infinite; }
@keyframes hubYorugTez {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

/* ── Almashuv: turgan tomonidan chiqadi, narigisidan kiradi ────── */
/* Silliq to'g'ri chiziq — silkinish, tebranish va burilish yo'q. */
@keyframes tizUchOng {
    from { transform: translateX(0);      opacity: 1; }
    to   { transform: translateX(100vw);  opacity: 0; }
}
@keyframes tizUchChap {
    from { transform: translateX(0);      opacity: 1; }
    to   { transform: translateX(-100vw); opacity: 0; }
}
@keyframes tizKelOng {
    from { transform: translateX(100vw);  opacity: 0; }
    to   { transform: translateX(0);      opacity: 1; }
}
@keyframes tizKelChap {
    from { transform: translateX(-100vw); opacity: 0; }
    to   { transform: translateX(0);      opacity: 1; }
}

.tiz-uch-ong  { animation: tizUchOng  380ms cubic-bezier(.5, 0, .85, .4) forwards; }
.tiz-uch-chap { animation: tizUchChap 380ms cubic-bezier(.5, 0, .85, .4) forwards; }
.tiz-kel-ong  { animation: tizKelOng  460ms cubic-bezier(.16, .7, .3, 1) forwards; }
.tiz-kel-chap { animation: tizKelChap 460ms cubic-bezier(.16, .7, .3, 1) forwards; }

/* Karta joyiga tushayotganda ichidagi qatorlar ketma-ket ko'tariladi */
@keyframes tizQator {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tiz-kel-ong .tiz-qator,
.tiz-kel-chap .tiz-qator { animation: tizQator 320ms var(--ease-out) backwards; }
.tiz-kel-ong .tiz-qator:nth-child(1), .tiz-kel-chap .tiz-qator:nth-child(1) { animation-delay: 150ms; }
.tiz-kel-ong .tiz-qator:nth-child(2), .tiz-kel-chap .tiz-qator:nth-child(2) { animation-delay: 195ms; }
.tiz-kel-ong .tiz-qator:nth-child(3), .tiz-kel-chap .tiz-qator:nth-child(3) { animation-delay: 240ms; }
.tiz-kel-ong .tiz-qator:nth-child(4), .tiz-kel-chap .tiz-qator:nth-child(4) { animation-delay: 285ms; }
.tiz-kel-ong .tiz-qator:nth-child(7), .tiz-kel-chap .tiz-qator:nth-child(7) { animation-delay: 330ms; }
.tiz-kel-ong .tiz-qator:nth-child(8), .tiz-kel-chap .tiz-qator:nth-child(8) { animation-delay: 375ms; }
.tiz-kel-ong .tiz-qator:nth-child(9), .tiz-kel-chap .tiz-qator:nth-child(9) { animation-delay: 420ms; }

/* Harakatni kamaytirish so'ralganda (Windows: Sozlamalar > Maxsus imkoniyatlar >
   Vizual effektlar > Animatsiya effektlari — o'chirilgan bo'lsa) almashuv
   BUTUNLAY to'xtab qolmaydi: qaysi tomonga o'tgani ko'rinishi kerak, aks holda
   karta "birdan paydo bo'lgandek" tuyuladi. Faqat bezak harakati olib tashlanadi:
   tinimsiz yugurib turadigan yorug'lik va qatorlarning ketma-ket ko'tarilishi. */
@media (prefers-reduced-motion: reduce) {
    .hub .yorug { animation: none; }
    .login-right, .login-left { transition-duration: 420ms; transition-delay: 120ms; }
    .tiz-kel-ong .tiz-qator, .tiz-kel-chap .tiz-qator { animation: none; }
}

/* Logotip ham joriy tizim rangiga o'tadi. Ombor holatida asl brend
   ko'kligi (#21409a / #2e3192) qoladi — faqat Sotuv va Buxgalteriyada
   o'zgaradi. SVG dagi `fill` atributi taqdimot atributi, shuning uchun
   bu qoidalar uni bosib o'tadi. */
#login-page .op-left-face,
#login-page .op-inner-panel,
#login-page .op-roof,
#login-page .op-arrow { fill: var(--logo-1, #21409a); transition: fill 600ms var(--ease-out); }

#login-page .op-right-face,
#login-page .op-check-window { fill: var(--logo-2, #2e3192); transition: fill 600ms var(--ease-out); }

/* Rasxot hubi — zich kartochka.
   Ilgari kartochkalar 28px otstup va 56px emoji bilan edi: ekranga
   3-4 tasi sig'ardi. Endi bir qatorga 4-5 tasi tushadi. */
.rxr-hub-k { transition: transform .12s, border-color .12s; }
.rxr-hub-k:hover { transform: translateY(-1px); border-color: var(--accent); }
.rxr-hub-k:active { transform: none; }

/* Guruh tahrirlash oynasidagi mahsulot qatorlari.
   Grid ustunlari INLINE emas, shu yerda: inline `style` da berilganda
   ba'zi holatlarda qo'llanmay, hamma maydon ustma-ust tushib qolardi.
   Ustunlar kengligi `--ustun` o'zgaruvchisi orqali beriladi. */
.edit-prod-row,
.edit-prod-head {
  display: grid !important;
  grid-template-columns: var(--ustun, 28px 2fr 0.8fr 1fr 1fr 32px);
  gap: 6px;
  align-items: center;
}
.edit-prod-row { padding: 2px 10px; border-bottom: 1px solid var(--border); }
/* Qidiruvda mos kelmagan qator. Yuqoridagi `display:grid !important`
   ni yengishi uchun bu ham !important va ikkita klassli. */
.edit-prod-row.qidiruvda-yoq { display: none !important; }
.edit-prod-head { padding: 0 10px 4px; border-bottom: 1px solid var(--border); }


/* ─── Snabjenec taqsimlash/nakladnoy jadvallari ───────────────────
   Kompyuter ekraniga imkon qadar KO'P ma'lumot sig'sin: qator
   balandligi kichik, raqamlar bir xil kenglikda (tabular-nums). */
.snab-guruh { padding: 0; margin-bottom: 8px; overflow: hidden; }
.snab-bosh {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; user-select: none;
  background: var(--bg-input); border-bottom: 1px solid var(--border);
}
.snab-bosh:hover { background: var(--bg-hover, var(--bg-input)); }
.snab-strelka { color: var(--text-secondary); font-size: 12px; width: 10px; }
.snab-qator {
  display: grid;
  /* Oxirgi 1fr — YIG'UVCHI ustun: ortiqcha bo'sh joy shu yerga
     to'planadi, aks holda u hamma ustunlar orasiga tarqalib,
     mahsulot nomi bilan miqdori orasida 500px bo'shliq qolardi. */
  grid-template-columns: 26px minmax(200px, 2fr) 110px minmax(120px, 1fr) minmax(140px, 1.6fr) 1fr;
  gap: 8px; align-items: center;
  padding: 4px 12px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.snab-qator:last-child { border-bottom: none; }
.snab-qator.tanlangan { background: rgba(139, 92, 246, .10); }
.snab-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snab-miq { text-align: right; font-variant-numeric: tabular-nums; }
.snab-oby, .snab-izoh {
  color: var(--text-secondary); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.snab-oyna-qator { padding: 3px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.snab-oyna-qator:last-child { border-bottom: none; }

.snab-nkl-qator {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(120px, 1.2fr) minmax(100px, 1fr) 130px 110px 92px 1fr 164px;
  gap: 8px; align-items: center;
  padding: 5px 6px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
/* Summa ustuni: sarlavha ham, raqam ham O'NGDA — bir chiziqda tursin */
.snab-nkl-qator > div:nth-child(5) { text-align: right; }
.snab-nkl-qator > div {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.snab-nkl-qator:last-child { border-bottom: none; }
.snab-nkl-bosh {
  font-size: 11px; font-weight: 700; color: var(--text-muted, var(--text-secondary));
  text-transform: uppercase; letter-spacing: .3px;
  border-bottom: 2px solid var(--border);
}
.snab-nkl-amal { display: flex; gap: 4px; justify-content: flex-end; overflow: visible !important; }
.snab-nkl-amal .btn { padding: 3px 8px; font-size: 12px; line-height: 1.4; }

/* Tor ekranda (planshet) jadval o'z ichida siljisin — sahifa emas */
@media (max-width: 1200px) {
  /* Tor ekranda yig'uvchi ustun kerak emas — joy allaqachon tor */
  .snab-qator { grid-template-columns: 26px minmax(150px, 2fr) 100px minmax(100px, 1fr) minmax(110px, 1.4fr); }
  /* Katak soni O'ZGARMAYDI (8 ta), faqat yig'uvchi ustun nolga tushadi —
     aks holda oxirgi katak pastki qatorga tushib ketardi */
  .snab-nkl-qator { grid-template-columns: minmax(130px, 1.4fr) minmax(110px, 1.2fr) minmax(90px, 1fr) 120px 100px 88px 0 150px; }
}
@media (max-width: 900px) {
  .snab-nkl-qator { grid-template-columns: 1fr; gap: 2px; padding: 8px 6px; }
  .snab-nkl-bosh { display: none; }
  .snab-nkl-amal { justify-content: flex-start; margin-top: 4px; }
}
