/* =========================================================
   Müəssisəm — Modern local visual redesign
   Bu fayl yalnız görünüşü dəyişir; mövcud funksional class-lar saxlanılır.
   ========================================================= */
:root {
    --navy-950: #041a38;
    --navy-900: #072955;
    --navy-850: #0a3264;
    --navy-800: #0d3b73;
    --navy-700: #1553a4;
    --blue-600: #1d6ee8;
    --blue-500: #2f80ed;
    --teal-600: #0aa896;
    --teal-500: #12b8a6;
    --green-500: #2ac98a;
    --purple-500: #7657e8;
    --orange-500: #f59e0b;
    --red-500: #ef5b69;
    --ink-950: #071a35;
    --ink-800: #19324f;
    --ink-700: #36506d;
    --ink-500: #71839a;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef3f9;
    --border: #e3eaf3;
    --shadow-sm: 0 4px 16px rgba(21, 50, 86, .06);
    --shadow-md: 0 12px 34px rgba(12, 42, 80, .08);
    --shadow-lg: 0 24px 64px rgba(7, 30, 62, .14);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --sidebar-w: 286px;
    --sidebar-collapsed-w: 88px;
}

html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink-950);
    background: #f5f8fc;
    font-family: "Segoe UI Variable", "Segoe UI", Inter, Arial, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.modal-open, body.nav-open { overflow: hidden; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { width: auto; margin: 0; }

/* Flash messages */
.flash-wrap { top: 22px; right: 24px; z-index: 5000; gap: 10px; }
.flash {
    max-width: min(560px, calc(100vw - 40px));
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    color: var(--ink-800);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}
.flash.success { background: #ebfff6; color: #087956; border-color: #b8f1dd; }
.flash.error { background: #fff1f3; color: #ad2034; border-color: #ffd0d8; }

/* App shell */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    background: linear-gradient(90deg, #041d3f 0 var(--sidebar-w), #f5f8fc var(--sidebar-w) 100%);
    transition: grid-template-columns .24s ease;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    padding: 20px 14px 18px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
      radial-gradient(circle at 18% 0%, rgba(32,128,238,.22), transparent 31%),
      linear-gradient(180deg, #06264f 0%, #041d3f 58%, #031832 100%);
    border-right: 1px solid rgba(255,255,255,.05);
    box-shadow: 10px 0 30px rgba(4, 26, 56, .08);
    z-index: 100;
}
.side-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 6px 8px 18px;
    margin: 0 0 12px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark-wrap {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: white;
    flex: 0 0 auto;
}
.brand-mark-wrap img { width: 48px; height: 48px; filter: brightness(0) invert(1); }
.brand-text { min-width: 0; flex: 1; }
.brand-title-row { display: flex; align-items: center; gap: 8px; }
.side-brand h2 { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -.5px; color: #fff; }
.side-brand p { margin: 3px 0 0; color: #9fb8d4; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 11px;
    background: rgba(255,255,255,.08);
    color: #dceaff;
    font-size: 22px;
    line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }
.collapsed-toggle { display: none; }
.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 2px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}
.main-nav > a,
.nav-group > summary,
.nav-submenu > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 11px 13px;
    color: #d7e4f4;
    text-decoration: none;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.main-nav > a:hover,
.nav-group > summary:hover,
.nav-submenu > a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.main-nav > a.active,
.nav-group.active > summary,
.nav-submenu > a.active {
    color: #fff;
    background: linear-gradient(135deg, #0e9fb6 0%, #126bd6 100%);
    box-shadow: 0 10px 24px rgba(8, 103, 205, .26);
}
.main-nav .ui-icon { width: 21px; height: 21px; stroke-width: 1.7; }
.nav-group { margin: 0; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-arrow { margin-left: auto; font-size: 15px; color: #93aac5; transition: transform .2s ease; }
.nav-group[open] .nav-arrow { transform: rotate(180deg); }
.nav-submenu {
    display: grid;
    gap: 2px;
    padding: 3px 0 5px 34px;
}
.nav-submenu > a { min-height: 38px; padding: 8px 10px; font-size: 13px; color: #adbed2; }
.nav-sub-dot { width: 6px; height: 6px; border-radius: 50%; background: #7794b3; flex: 0 0 auto; }
.nav-submenu > a.active .nav-sub-dot { background: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.logout {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 13px;
    color: #e2ecf8;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    background: rgba(255,255,255,.04);
}
.logout:hover { background: rgba(255,255,255,.1); color: white; }
.sidebar-version { color: #6f8baa; font-size: 10px; text-align: center; letter-spacing: .04em; }

.content {
    min-width: 0;
    padding: 0 28px 18px;
    background:
      radial-gradient(circle at 90% 0%, rgba(32,128,238,.08), transparent 26%),
      #f5f8fc;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 82px;
    margin: 0 -28px 0;
    padding: 14px 30px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
    gap: 22px;
    border-radius: 0;
    border-bottom: 1px solid rgba(220,229,241,.9);
    background: rgba(255,255,255,.88);
    box-shadow: 0 8px 28px rgba(22,51,88,.035);
    backdrop-filter: blur(18px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mobile-menu-toggle { display: grid; color: var(--navy-900); background: #eef4fb; border-color: #e3eaf3; font-size: 17px; }
.page-heading { min-width: 0; }
.page-heading .eyebrow { display: block; margin-bottom: 3px; color: var(--ink-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 { margin: 0; color: var(--ink-950); font-size: 24px; line-height: 1.2; letter-spacing: -.45px; }
.topbar-search {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f9fbfd;
    color: #8ca0b7;
}
.topbar-search input { height: 100%; flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.topbar-search input:focus { box-shadow: none; }
.topbar-search kbd { padding: 3px 7px; border: 1px solid #dfe7f1; border-radius: 6px; background: #fff; color: #8a9caf; font-size: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--navy-900);
}
.icon-button:hover { background: #f4f8fd; }
.notification-button span { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border: 2px solid white; border-radius: 999px; background: var(--teal-500); color: white; font-size: 9px; font-weight: 800; }
.user-pill { min-width: 190px; height: 52px; display: grid; grid-template-columns: 36px 1fr 18px; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, var(--navy-800), var(--teal-500)); font-size: 14px; font-weight: 800; }
.user-pill strong, .user-pill small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill strong { font-size: 13px; color: var(--ink-950); }
.user-pill small { margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.user-pill > .ui-icon { width: 15px; height: 15px; color: #8da1b8; }
.page-stage { padding: 28px 0 20px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 8px 2px 0; color: #8c9db1; font-size: 11px; }
.mobile-nav-backdrop { display: none; }

/* Sidebar collapsed */
.app-shell.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-w) minmax(0,1fr);
    background: linear-gradient(90deg, #041d3f 0 var(--sidebar-collapsed-w), #f5f8fc var(--sidebar-collapsed-w) 100%);
}
.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
.sidebar-collapsed .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .brand-text, .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-arrow, .sidebar-collapsed .sidebar-version { display: none; }
.sidebar-collapsed .brand-mark-wrap { width: 48px; }
.sidebar-collapsed .main-nav > a,
.sidebar-collapsed .nav-group > summary { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .nav-submenu { display: none; }
.sidebar-collapsed .logout { justify-content: center; }

/* Overview dashboard */
.overview-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.overview-kicker { display: inline-flex; margin-bottom: 7px; color: var(--teal-600); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.overview-hero h2 { margin: 0; color: var(--ink-950); font-size: 27px; letter-spacing: -.6px; }
.overview-hero p { margin: 7px 0 0; color: var(--ink-500); }
.overview-actions { display: flex; align-items: center; gap: 10px; }
.today-chip { padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: white; color: var(--ink-700); font-size: 12px; font-weight: 650; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.kpi-card {
    min-height: 126px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; }
.kpi-icon .ui-icon { width: 25px; height: 25px; stroke-width: 1.9; }
.kpi-green .kpi-icon { color: #0c9c6a; background: #e9fbf4; }
.kpi-blue .kpi-icon { color: #1767dc; background: #edf4ff; }
.kpi-teal .kpi-icon { color: #069b90; background: #e8fbf9; }
.kpi-purple .kpi-icon { color: #6f4bd8; background: #f2edff; }
.kpi-card > div:last-child { min-width: 0; }
.kpi-card span, .kpi-card small { display: block; color: var(--ink-500); }
.kpi-card span { font-size: 12px; font-weight: 650; }
.kpi-card strong { display: block; margin: 5px 0 6px; color: var(--ink-950); font-size: 22px; line-height: 1.15; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-card strong.negative { color: var(--red-500); }
.kpi-card small { font-size: 10px; }
.dashboard-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dashboard-grid-top { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr) minmax(270px, .8fr); }
.dashboard-grid-bottom { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr) minmax(300px, .9fr); }
.dash-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: white; box-shadow: var(--shadow-sm); }
.dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dash-card-head h3 { margin: 0; color: var(--ink-950); font-size: 15px; letter-spacing: -.15px; }
.dash-card-head p { margin: 4px 0 0; color: var(--ink-500); font-size: 11px; }
.dash-card-head a { color: var(--blue-600); text-decoration: none; font-size: 11px; font-weight: 700; }
.soft-badge { padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--ink-700); background: var(--surface-2); font-size: 10px; font-weight: 700; }
.chart-legend { display: flex; gap: 18px; margin: -3px 0 10px; color: var(--ink-500); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }
.income-dot { background: var(--teal-500); }.expense-dot { background: var(--blue-600); }
.mini-bar-chart { height: 220px; display: grid; grid-template-columns: repeat(12, minmax(16px,1fr)); align-items: end; gap: 7px; padding: 18px 6px 0; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, #eef3f8 44px); }
.month-group { height: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-pair { height: calc(100% - 22px); width: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 3px; }
.bar { width: min(9px, 38%); min-height: 2px; border-radius: 5px 5px 2px 2px; transition: opacity .2s; }
.month-group:hover .bar { opacity: .75; }
.income-bar { background: linear-gradient(180deg, #2bd4be, #0cae99); }
.expense-bar { background: linear-gradient(180deg, #4f9cff, #1767df); }
.month-group > span { color: #8193a8; font-size: 9px; }
.donut-layout { display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 16px; min-height: 220px; }
.donut-chart { width: 140px; aspect-ratio: 1; position: relative; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal-500) 0 var(--incoming), var(--blue-600) var(--incoming) 360deg); }
.donut-chart::before { content: ""; width: 84px; aspect-ratio: 1; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px #eef3f8; }
.donut-chart > div { position: absolute; display: grid; text-align: center; }
.donut-chart strong { color: var(--ink-950); font-size: 20px; }
.donut-chart span { color: var(--ink-500); font-size: 10px; }
.donut-legend { display: grid; gap: 14px; }
.donut-legend > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; padding-bottom: 11px; border-bottom: 1px solid #eef2f7; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }.legend-dot.incoming { background: var(--teal-500); }.legend-dot.outgoing { background: var(--blue-600); }
.donut-legend span { color: var(--ink-500); font-size: 11px; }.donut-legend strong { font-size: 13px; }
.debt-card { display: flex; flex-direction: column; }
.debt-row { display: grid; grid-template-columns: 44px 1fr 18px; align-items: center; gap: 12px; padding: 14px 0; text-decoration: none; border-top: 1px solid #edf2f7; }
.debt-row:first-of-type { border-top: 0; }
.debt-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; }
.debt-icon.debit { color: #0d9f70; background: #e8fbf3; }.debt-icon.credit { color: #6848d7; background: #f0ecff; }
.debt-row small, .debt-row strong { display: block; }.debt-row small { color: var(--ink-500); font-size: 10px; }.debt-row strong { margin-top: 4px; color: var(--ink-950); font-size: 14px; }
.debt-row > .ui-icon { width: 15px; color: #92a4b8; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #edf2f7; }
.recent-row:first-child { border-top: 0; }
.recent-doc { width: 36px; height: 36px; display: grid; place-items: center; color: var(--blue-600); border-radius: 10px; background: #edf4ff; }
.recent-doc .ui-icon { width: 17px; }
.recent-main { min-width: 0; }
.recent-main strong, .recent-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-main strong { color: var(--ink-800); font-size: 11px; }.recent-main small { margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.recent-amount { color: var(--teal-600); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dashboard-empty { padding: 34px 10px; color: var(--ink-500); text-align: center; font-size: 12px; }
.inventory-summary-value { min-height: 112px; display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #eff6ff, #edfdf9); }
.inventory-summary-value > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, var(--blue-600), var(--teal-500)); box-shadow: 0 10px 22px rgba(30,112,220,.22); }
.inventory-summary-value strong, .inventory-summary-value small { display: block; }.inventory-summary-value strong { color: var(--ink-950); font-size: 28px; }.inventory-summary-value small { color: var(--ink-500); font-size: 11px; }
.inventory-breakdown { display: grid; gap: 10px; margin-top: 14px; }
.inventory-breakdown > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #edf2f7; color: var(--ink-500); font-size: 11px; }.inventory-breakdown strong { color: var(--ink-800); }
.quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.quick-grid a { min-height: 86px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 13px; text-align: center; text-decoration: none; background: #fbfcfe; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.quick-grid a:hover { transform: translateY(-2px); border-color: #c9d9ed; background: white; }
.quick-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.quick-icon .ui-icon { width: 18px; }
.q-yellow { color: #d28a00; background:#fff6d9; }.q-green { color:#079a67;background:#e8fbf3;}.q-blue {color:#1767df;background:#edf4ff;}.q-teal {color:#079c91;background:#e8fbf9;}.q-purple {color:#704ed8;background:#f1edff;}.q-cyan {color:#078db3;background:#e8f8fd;}
.quick-grid b { color: var(--ink-700); font-size: 10px; line-height: 1.25; }

/* General application cards, headers and forms */
.placeholder-card,
.form-card,
.info-page-card,
.profit-loss-report,
.module-card,
.invoice-choice-card,
.manual-choice-card,
.cash-receipt-choice-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.placeholder-card { padding: 24px; }
.placeholder-card.wide-card { width: 100%; max-width: none; }
.section-header { align-items: center; margin-bottom: 22px; }
.section-header h2 { margin: 0; color: var(--ink-950); font-size: 21px; letter-spacing: -.35px; }
.section-header p { color: var(--ink-500); }
.compact-header { min-height: 46px; }
.sub-title, .sub-section-title { color: var(--ink-800); }
.empty-state { min-height: 170px; padding: 34px; display: grid; place-items: center; align-content: center; gap: 6px; border: 1px dashed #cdd9e8; border-radius: 16px; background: #fafcff; color: var(--ink-500); text-align: center; }
.empty-state strong { color: var(--ink-800); }

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .small-btn, .mini-btn, .tiny-btn,
.page-action-menu > summary, .page-action-dropdown a, .page-action-dropdown button,
button[type="submit"], button[type="button"] {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary, button[type="submit"] { color: white; background: linear-gradient(135deg, var(--navy-900), #0d4b8f); box-shadow: 0 7px 18px rgba(8,42,86,.14); }
.btn-primary:hover, button[type="submit"]:hover { background: linear-gradient(135deg, #0a376e, #1460b2); transform: translateY(-1px); }
.btn-secondary, button[type="button"] { color: var(--navy-900); background: #edf3f9; border-color: #e2eaf3; box-shadow: none; }
.btn-secondary:hover, button[type="button"]:hover { background: #e3edf7; }
.btn-success { color: #fff; background: linear-gradient(135deg, #0aa17f, #0fc0a5); }
.btn-danger { color: #b42336; background: #fff0f2; border-color: #ffd4da; }
.btn-danger:hover { background: #ffe6ea; }
.inline-actions, .button-row, .form-actions, .inventory-batch-actions { gap: 10px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.page-action-menu { position: relative; }
.page-action-menu > summary { list-style: none; color: #fff; background: linear-gradient(135deg, var(--navy-900), #0d4d94); }
.page-action-menu > summary::-webkit-details-marker { display:none; }
.page-action-dropdown, .kebab-dropdown {
    z-index: 300;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: white;
    box-shadow: var(--shadow-lg);
}
.page-action-dropdown a, .page-action-dropdown button,
.kebab-dropdown a, .kebab-dropdown button { width: 100%; justify-content: flex-start; min-height: 36px; padding: 8px 10px; color: var(--ink-700); background: transparent; border: 0; box-shadow: none; }
.page-action-dropdown a:hover, .page-action-dropdown button:hover,
.kebab-dropdown a:hover, .kebab-dropdown button:hover { background: #f1f6fb; color: var(--navy-900); transform: none; }
.kebab-menu summary { width: 34px; height: 34px; display: grid; place-items:center; border-radius: 9px; color: var(--ink-700); background:#edf3f9; cursor:pointer; list-style:none; font-weight:800; }
.kebab-menu summary::-webkit-details-marker { display:none; }

/* Form controls */
label { color: var(--ink-800); font-size: 12px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 13px;
    border: 1px solid #d9e3ef;
    border-radius: 11px;
    color: var(--ink-950);
    background: #fff;
    outline: 0;
    box-shadow: 0 1px 2px rgba(12,42,80,.02);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #73a9ef; box-shadow: 0 0 0 4px rgba(47,128,237,.11); background: #fff; }
input::placeholder, textarea::placeholder { color: #9aabba; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--blue-600); box-shadow: none; }
.compact-form, .data-form, .account-form, .modal-form { gap: 12px; }
.form-card { max-width: 900px; padding: 24px; }
.info-note, .modal-note { border: 1px solid #dce9f8; border-radius: 12px; background: #f2f8ff; color: var(--ink-700); }
.filter-period-badge { display:inline-flex; align-items:center; gap:8px; padding:9px 12px; margin-bottom:16px; border:1px solid #dbe8f7; border-radius:10px; background:#f2f8ff; color:var(--ink-700); font-size:12px; }
.filter-period-badge span { color:var(--ink-500); }

/* Tables */
.table-wrap, .inventory-table-wrap, .fixed-asset-table-wrap, .cash-receipt-table-wrap, .search-results-wrap {
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
table { background: transparent; }
th, td { padding: 13px 14px; border-color: #e9eff6; }
th {
    background: #f7f9fc;
    color: #60748b;
    font-size: 11px;
    font-weight: 750;
    text-transform: none;
    letter-spacing: .01em;
}
td { color: var(--ink-700); font-size: 12px; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f9fbfe; }
td strong { color: var(--ink-950); }
.num-cell, .amount-col { font-variant-numeric: tabular-nums; }
.total-row td, .pl-bold-row td { background: #edf6ff; color: var(--ink-950); font-weight: 800; }
.badge { color: #3151a5; background: #edf2ff; border: 1px solid #dbe3ff; }

/* Module and choice cards */
.module-grid, .invoice-choice-grid, .cash-receipt-choice-grid { gap: 16px; }
.module-card, .invoice-choice-card, .manual-choice-card, .cash-receipt-choice-card {
    min-height: 170px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.module-card::after, .invoice-choice-card::after, .manual-choice-card::after, .cash-receipt-choice-card::after { content:""; position:absolute; right:-30px; bottom:-30px; width:110px; height:110px; border-radius:50%; background:linear-gradient(135deg, rgba(47,128,237,.07), rgba(18,184,166,.12)); }
.module-card:hover, .invoice-choice-card:hover, .manual-choice-card:hover, .cash-receipt-choice-card:hover { transform: translateY(-3px); border-color:#cbdcf0; box-shadow:var(--shadow-md); }
.module-icon { width: 50px; height:50px; display:grid; place-items:center; margin-bottom:16px; border-radius:14px; font-size:24px; background:linear-gradient(135deg,#edf4ff,#eafbf8); }
.module-card strong, .invoice-choice-card strong, .manual-choice-card strong, .cash-receipt-choice-card strong { color:var(--ink-950); font-size:16px; }
.module-card small, .invoice-choice-card span, .manual-choice-card span, .cash-receipt-choice-card span { color:var(--ink-500); line-height:1.55; }

/* Tabs */
.inventory-tabs, .fixed-asset-tabs { display:inline-flex; gap:4px; padding:4px; border:1px solid var(--border); border-radius:13px; background:#f1f5fa; }
.inventory-tab, .fixed-asset-tabs a { padding:9px 14px; border-radius:9px; color:var(--ink-600); text-decoration:none; font-weight:700; }
.inventory-tab.active, .fixed-asset-tabs a.active { color:#fff; background:var(--navy-900); box-shadow:0 5px 14px rgba(7,41,85,.17); }

/* Modals */
.modal-backdrop { z-index: 2500; background:rgba(3,19,40,.58); backdrop-filter:blur(6px); }
.modal-card, .wide-modal-card { border:1px solid rgba(255,255,255,.65); border-radius:20px; background:white; box-shadow:0 28px 80px rgba(4,25,53,.28); }
.modal-header { padding-bottom:14px; border-bottom:1px solid var(--border); }
.modal-header h3 { margin:0; color:var(--ink-950); }
.modal-close { width:34px!important; height:34px!important; min-height:34px!important; padding:0!important; border-radius:10px!important; }

/* File drop zones */
.file-drop-zone { border:1.5px dashed #b8c8dc; border-radius:16px; background:#f8fbff; }
.file-drop-zone.drag-over { border-color:var(--teal-500); background:#effdfa; box-shadow:0 0 0 4px rgba(18,184,166,.1); }

/* Invoice archive / grouped cards */
.archive-company-card, .archive-invoice-card, .bulk-line-invoice-card, .cash-allocation-card { border-color:var(--border); border-radius:16px; box-shadow:var(--shadow-sm); }
.archive-company-head, .archive-invoice-head, .bulk-line-invoice-head { background:#fbfcfe; }

/* Auth pages */
.auth-body { background:#eff4fa; }
.modern-auth-page {
    min-height:100vh;
    display:grid;
    grid-template-columns:minmax(520px,1.08fr) minmax(470px,.92fr);
    background:#f7f9fc;
}
.modern-brand-panel {
    position:relative;
    min-height:100vh;
    padding:38px 46px 30px;
    display:grid;
    grid-template-rows:auto auto 1fr auto auto;
    gap:16px;
    overflow:hidden;
    color:#fff;
    background:
      radial-gradient(circle at 72% 24%, rgba(27,113,230,.30), transparent 29%),
      radial-gradient(circle at 14% 82%, rgba(0,190,169,.15), transparent 24%),
      linear-gradient(145deg,#031a3a 0%,#052b5d 55%,#05244c 100%);
}
.modern-brand-panel::before { content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size:42px 42px; mask-image:linear-gradient(to bottom,transparent,black 18%,black 80%,transparent); }
.auth-brand-lockup, .auth-brand-copy, .auth-visual, .auth-feature-row, .auth-copyright, .registration-benefits { position:relative; z-index:1; }
.auth-brand-lockup { display:flex; align-items:center; gap:12px; }
.auth-brand-lockup img { width:58px; height:58px; filter:brightness(0) invert(1); }
.auth-brand-lockup strong { font-size:29px; letter-spacing:-.7px; }
.auth-brand-copy { max-width:650px; padding-top:12px; }
.auth-kicker { display:inline-flex; color:#6ce1d3; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; }
.auth-brand-copy h1 { margin:14px 0 12px; max-width:660px; color:#fff; font-size:clamp(34px,4vw,54px); line-height:1.08; letter-spacing:-1.6px; }
.auth-brand-copy p { max-width:590px; margin:0; color:#bad0e8; font-size:15px; line-height:1.7; }
.auth-visual { align-self:center; justify-self:end; width:min(70%,620px); max-height:46vh; object-fit:contain; mix-blend-mode:screen; filter:saturate(1.08) contrast(1.03); opacity:.98; }
.auth-feature-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.auth-feature-row > div { min-width:0; display:grid; grid-template-columns:38px 1fr; column-gap:10px; align-items:center; padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.045); backdrop-filter:blur(8px); }
.feature-icon { grid-row:1/3; width:38px; height:38px; display:grid; place-items:center; border-radius:12px; }.feature-icon.green{color:#63e6cc;background:rgba(18,184,166,.14)}.feature-icon.blue{color:#77aeff;background:rgba(47,128,237,.14)}.feature-icon.purple{color:#ad96ff;background:rgba(118,87,232,.14)}
.auth-feature-row strong { font-size:11px; color:#fff; }.auth-feature-row small { margin-top:3px; color:#91aac6; font-size:9px; line-height:1.35; }
.auth-copyright { color:#7894b2; font-size:10px; }
.registration-benefits { display:flex; flex-wrap:wrap; gap:10px; color:#c7d9ec; font-size:11px; }
.registration-benefits span { padding:8px 10px; border:1px solid rgba(255,255,255,.09); border-radius:9px; background:rgba(255,255,255,.045); }
.modern-auth-card { min-height:100vh; padding:32px 7vw; display:flex; flex-direction:column; justify-content:center; background:radial-gradient(circle at 50% 18%,rgba(47,128,237,.07),transparent 27%),#f8fafc; box-shadow:none; }
.auth-toolbar { position:absolute; top:28px; right:38px; display:flex; align-items:center; gap:18px; color:var(--ink-700); font-size:12px; font-weight:700; }
.auth-toolbar a { color:var(--blue-600); text-decoration:none; }
.auth-help { padding-left:16px; border-left:1px solid #dce5ef; }
.auth-card-inner { width:min(100%,510px); margin:auto; padding:34px; border:1px solid rgba(221,230,240,.9); border-radius:24px; background:rgba(255,255,255,.94); box-shadow:0 24px 70px rgba(9,37,72,.11); backdrop-filter:blur(16px); }
.auth-card-logo { width:220px; height:auto; margin-bottom:22px; }
.auth-title-block { margin-bottom:22px; }.auth-kicker.dark{color:var(--teal-600)}.auth-title-block h2{margin:8px 0 7px;color:var(--ink-950);font-size:28px;letter-spacing:-.6px}.auth-title-block p{margin:0;color:var(--ink-500);font-size:13px;line-height:1.55}
.auth-form label { margin:14px 0 7px; }
.auth-input-wrap { position:relative; }.auth-input-wrap .ui-icon { position:absolute; left:13px; top:50%; transform:translateY(-50%); width:18px; color:#8ba0b6; }.auth-input-wrap input { padding-left:42px; min-height:50px; border-radius:13px; }
.auth-submit { width:100%!important; min-height:52px!important; margin-top:20px!important; border-radius:13px!important; font-size:14px!important; }
.auth-divider { position:relative; margin:20px 0; text-align:center; }.auth-divider::before{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:#e4ebf3}.auth-divider span{position:relative;padding:0 12px;color:#93a4b7;background:#fff;font-size:11px}
.auth-register-btn { min-height:50px; display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid #9bc0f4; border-radius:13px; color:var(--blue-600); text-decoration:none; font-weight:750; }
.auth-register-btn:hover { background:#f2f7ff; }
.auth-security { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:22px; color:#8496aa; font-size:10px; }.auth-security .ui-icon{width:15px}
.register-card .auth-card-inner { width:min(100%,620px); }
.register-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }.form-field.full,.register-form-grid .full{grid-column:1/-1}.register-form-grid .auth-submit{grid-column:1/-1}

/* Responsive */
@media (max-width: 1280px) {
    .dashboard-grid-top { grid-template-columns: minmax(0,1.4fr) minmax(270px,.8fr); }
    .dashboard-grid-top .debt-card { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; column-gap:18px; }
    .dashboard-grid-top .debt-card .dash-card-head { grid-column:1/-1; }
    .dashboard-grid-bottom { grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); }
    .dashboard-grid-bottom .quick-card { grid-column:1/-1; }
    .quick-grid { grid-template-columns:repeat(6,1fr); }
}
@media (max-width: 1080px) {
    .topbar { grid-template-columns:1fr auto; }.topbar-search { display:none; }
    .kpi-grid { grid-template-columns:repeat(2,1fr); }
    .modern-auth-page { grid-template-columns:1fr 480px; }.auth-feature-row{grid-template-columns:1fr}.auth-feature-row>div{display:none}.auth-feature-row>div:first-child{display:grid}.auth-visual{width:78%}
}
@media (max-width: 980px) {
    .app-shell, .app-shell.sidebar-collapsed { grid-template-columns:1fr; }
    .sidebar { position:fixed; left:0; top:0; width:min(310px,86vw); transform:translateX(-102%); transition:transform .22s ease; box-shadow:20px 0 60px rgba(2,19,41,.28); }
    .app-shell.mobile-nav-open .sidebar { transform:translateX(0); }
    .mobile-nav-backdrop { position:fixed; inset:0; z-index:90; display:block; opacity:0; pointer-events:none; border:0; border-radius:0; background:rgba(3,18,38,.5); transition:opacity .2s; }
    .app-shell.mobile-nav-open .mobile-nav-backdrop { opacity:1; pointer-events:auto; }
    .content { padding-left:18px; padding-right:18px; }.topbar { margin-left:-18px;margin-right:-18px;padding-left:18px;padding-right:18px; }
    .mobile-menu-toggle { display:grid; }
    .dashboard-grid-top, .dashboard-grid-bottom { grid-template-columns:1fr; }.dashboard-grid-top .debt-card,.dashboard-grid-bottom .quick-card{grid-column:auto}.dashboard-grid-top .debt-card{display:flex}.quick-grid{grid-template-columns:repeat(3,1fr)}
    .modern-auth-page { grid-template-columns:1fr; }.modern-brand-panel{display:none}.modern-auth-card{padding:80px 22px 32px}.auth-toolbar{top:22px;right:22px}
}
@media (max-width: 700px) {
    .topbar { min-height:72px; grid-template-columns:1fr auto; gap:10px; }.topbar-right .icon-button{display:none}.user-pill{min-width:0;width:46px;grid-template-columns:1fr;padding:5px}.user-pill>div:nth-child(2),.user-pill>.ui-icon{display:none}.user-avatar{width:34px;height:34px}
    .overview-hero { align-items:flex-start; flex-direction:column; }.overview-actions{width:100%;justify-content:space-between}.today-chip{display:none}
    .kpi-grid { grid-template-columns:1fr; }.kpi-card{min-height:104px}.kpi-card strong{font-size:20px}
    .dashboard-grid-top .debt-card{display:flex}.donut-layout{grid-template-columns:1fr;justify-items:center}.donut-legend{width:100%}
    .mini-bar-chart{gap:3px;height:190px}.month-group>span{font-size:8px}.bar{width:5px}
    .quick-grid{grid-template-columns:repeat(2,1fr)}
    .page-stage{padding-top:20px}.placeholder-card{padding:16px}.section-header{align-items:flex-start;flex-direction:column}.page-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}
    .app-footer{flex-direction:column;gap:4px}
    .auth-card-inner{padding:24px 20px;border-radius:20px}.auth-card-logo{width:190px}.register-form-grid{grid-template-columns:1fr}.form-field.full,.register-form-grid .full,.register-form-grid .auth-submit{grid-column:auto}
}


/* =========================================================
   Layout stability patch — v3.1
   Keeps every page in its intended grid column and prevents
   hidden utility buttons from taking layout space.
   ========================================================= */
html, body { width: 100%; min-width: 0; overflow-x: hidden; }
.app-shell { width: 100%; max-width: 100%; align-items: start; }
.app-shell > .sidebar { grid-column: 1; grid-row: 1; }
.app-shell > .mobile-nav-backdrop { display: none !important; width: 0 !important; height: 0 !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
.app-shell > .content {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: stretch;
}
.page-stage { width: 100%; max-width: 1600px; margin: 0 auto; }
.topbar { width: auto; }
.overview-hero, .kpi-grid, .dashboard-grid, .placeholder-card, .form-card, .info-page-card,
.profit-loss-report, .module-grid, .invoice-choice-grid, .cash-receipt-choice-grid { min-width: 0; }
.kpi-card, .dash-card { overflow: hidden; }
.kpi-card strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dash-card-head > div { min-width: 0; }
.dash-card-head h3, .dash-card-head p { overflow-wrap: anywhere; }
.table-wrap, .inventory-table-wrap, .fixed-asset-table-wrap, .cash-receipt-table-wrap, .search-results-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.section-header { display: flex; justify-content: space-between; gap: 18px; }
.section-header > div:first-child { min-width: 0; }
.page-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

/* Desktop sidebar always opens cleanly; collapsed mode remains optional. */
.app-shell.sidebar-collapsed > .content { grid-column: 2; width: 100%; }
.app-shell.sidebar-collapsed > .mobile-nav-backdrop { display: none !important; }

@media (max-width: 980px) {
    .app-shell > .sidebar { grid-column: 1; }
    .app-shell > .content,
    .app-shell.sidebar-collapsed > .content { grid-column: 1; grid-row: 1; width: 100%; }
    .app-shell > .mobile-nav-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        background: rgba(3,18,38,.5);
        transition: opacity .2s ease;
    }
    .app-shell.mobile-nav-open > .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }
    .page-stage { max-width: none; }
}

@media (min-width: 981px) and (max-width: 1380px) {
    :root { --sidebar-w: 260px; }
    .content { padding-left: 22px; padding-right: 22px; }
    .topbar { margin-left: -22px; margin-right: -22px; padding-left: 24px; padding-right: 24px; }
    .dashboard-grid-top { grid-template-columns: minmax(0, 1.3fr) minmax(260px, .8fr); }
    .dashboard-grid-top .debt-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
    .dashboard-grid-top .debt-card .dash-card-head { grid-column: 1 / -1; }
    .dashboard-grid-bottom { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
    .dashboard-grid-bottom .quick-card { grid-column: 1 / -1; }
    .quick-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
}


/* v3.2 refinements */
.month-group { text-decoration: none; cursor: pointer; border-radius: 10px; padding-top: 5px; transition: background .16s ease, transform .16s ease; }
.month-group:hover { background: #f3f8ff; transform: translateY(-2px); }
.month-group:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.kpi-card > div:last-child { display: flex; min-height: 70px; flex-direction: column; justify-content: center; }
.kpi-card strong { margin-bottom: 0; }
.debt-row strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.debt-row small { line-height: 1.35; }
.journal-pagination { margin-top: 16px; display: grid; grid-template-columns: minmax(210px,1fr) auto minmax(230px,1fr); align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #f9fbfd; }
.journal-page-size label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-600); font-size: 12px; font-weight: 600; }
.journal-page-size select { width: auto; min-width: 72px; height: 38px; padding: 0 28px 0 10px; border-radius: 10px; background-color: #fff; }
.journal-page-info { color: var(--ink-500); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.journal-page-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.page-nav-btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink-700); text-decoration: none; font-size: 12px; font-weight: 650; }
.page-nav-btn.primary { border-color: #126bd6; background: #126bd6; color: #fff; }
.page-nav-btn.disabled { opacity: .45; cursor: not-allowed; }
.table-wrap table th { font-weight: 650; letter-spacing: .005em; }
.table-wrap table td { font-weight: 400; }
.table-wrap table td strong { font-weight: 650; }
.placeholder-card h2, .section-header h2 { font-weight: 720; letter-spacing: -.25px; }
label { font-weight: 600; }
.btn-primary, .btn-secondary, button, summary { font-weight: 650; }
@media (max-width: 760px) {
    .journal-pagination { grid-template-columns: 1fr; }
    .journal-page-info { text-align: left; }
    .journal-page-buttons { justify-content: flex-start; }
}

/* =========================================================
   Subscription and journal account-number refinements — v3.3
   ========================================================= */
.account-number-field { display: flex; flex-direction: column; gap: 7px; }
.account-number-field input[type="text"] { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.account-name-hint { min-height: 18px; color: var(--ink-500); font-size: 12px; font-weight: 500; line-height: 1.35; }
.account-name-hint.valid { color: #087f5b; }
.account-name-hint.invalid { color: #c92a2a; }
.journal-entry-number-form datalist { display: none; }

.subscription-nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 13px; border-radius: 12px; color: #c8d7e8; text-decoration: none; font-size: 13px; font-weight: 650; }
.subscription-nav-link:hover, .subscription-nav-link.active { color: #fff; background: rgba(255,255,255,.08); }
.subscription-nav-link .ui-icon { width: 20px; height: 20px; }

.subscription-lock-banner { max-width: 1600px; margin: 18px auto 0; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #f3c77a; border-radius: 14px; background: linear-gradient(135deg,#fff9eb,#fffdf8); color: #7a4c00; box-shadow: 0 10px 26px rgba(127,82,0,.07); }
.subscription-lock-banner > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.subscription-lock-banner strong { font-size: 13px; font-weight: 750; }
.subscription-lock-banner span { color: #926511; font-size: 12px; line-height: 1.45; }
.subscription-lock-banner a { flex: 0 0 auto; padding: 10px 16px; border-radius: 10px; background: #0b3a70; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }

.subscription-page { display: flex; flex-direction: column; gap: 24px; }
.subscription-intro { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; padding: 28px; border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(135deg,#ffffff,#f6faff); box-shadow: var(--shadow-sm); }
.subscription-intro h2 { margin: 8px 0 10px; color: var(--ink-950); font-size: 28px; letter-spacing: -.55px; }
.subscription-intro p { max-width: 760px; margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.65; }
.subscription-status { min-width: 230px; padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border-radius: 16px; }
.subscription-status span { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.subscription-status strong { font-size: 18px; }
.subscription-status small { font-size: 11px; line-height: 1.4; }
.subscription-status.active { color: #087f5b; background: #eafbf4; }
.subscription-status.locked { color: #9a5d00; background: #fff4d8; }

.subscription-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.subscription-card { position: relative; min-width: 0; padding: 26px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.subscription-card:hover { transform: translateY(-3px); border-color: #bad5f6; box-shadow: 0 20px 50px rgba(11,58,112,.10); }
.subscription-card.featured { border-color: #6ea7ee; box-shadow: 0 18px 50px rgba(18,107,214,.13); }
.plan-badge { position: absolute; top: 16px; right: 16px; padding: 6px 9px; border-radius: 999px; background: #e8f3ff; color: #126bd6; font-size: 10px; font-weight: 750; }
.plan-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(135deg,#0c427a,#0ea5a2); color: #fff; font-size: 18px; font-weight: 800; }
.subscription-card h3 { margin: 18px 0 4px; color: var(--ink-950); font-size: 19px; }
.plan-duration { margin: 0; color: var(--ink-500); font-size: 12px; }
.plan-price { margin: 22px 0; display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { color: var(--ink-950); font-size: 30px; letter-spacing: -.8px; }
.plan-price span { color: var(--ink-500); font-size: 12px; }
.subscription-card ul { min-height: 124px; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; list-style: none; color: var(--ink-600); font-size: 12px; }
.subscription-card li::before { content: "✓"; margin-right: 8px; color: #0ca678; font-weight: 800; }
.subscription-card form { margin-top: auto; }
.subscription-card button { width: 100%; }
.subscription-history { max-width: none; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.paid { color: #087f5b; background: #e8f8f1; }
.status-pill.pending { color: #9a5d00; background: #fff2d0; }

.subscription-payment-card { max-width: 920px; }
.payment-summary { margin: 24px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.payment-summary > div { padding: 16px; display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--border); border-radius: 14px; background: #f9fbfd; }
.payment-summary span { color: var(--ink-500); font-size: 11px; }
.payment-summary strong { color: var(--ink-900); font-size: 14px; overflow-wrap: anywhere; }
.local-payment-note, .payment-result { margin: 18px 0; padding: 16px; border-radius: 14px; font-size: 12px; line-height: 1.55; }
.local-payment-note { border: 1px solid #b7d6f8; background: #eef6ff; color: #174f87; }
.local-payment-note p { margin: 4px 0 0; }
.payment-result.success { border: 1px solid #b7ead5; background: #eefbf6; color: #087f5b; }
.payment-result.pending { border: 1px solid #f0d79b; background: #fff9e9; color: #805500; }

@media (max-width: 900px) {
    .subscription-grid { grid-template-columns: 1fr; }
    .subscription-intro { flex-direction: column; }
    .subscription-status { min-width: 0; }
}
@media (max-width: 700px) {
    .subscription-lock-banner { margin-top: 12px; align-items: flex-start; flex-direction: column; }
    .subscription-lock-banner a { width: 100%; text-align: center; }
    .payment-summary { grid-template-columns: 1fr; }
}


/* E-mail + telefon OTP qeydiyyatı və hər girişdə SMS OTP — v3.4 */
.login-otp-note { margin: 12px 0 0; color: var(--ink-500); font-size: 11px; line-height: 1.5; text-align: center; }
.verification-auth-page .auth-card-inner { max-width: 520px; }
.verification-brand-panel { overflow: hidden; }
.verification-illustration { width: min(410px, 100%); margin-top: 30px; padding: 26px; display: grid; grid-template-columns: 74px 1fr; gap: 4px 18px; align-items: center; border: 1px solid rgba(255,255,255,.17); border-radius: 22px; background: rgba(255,255,255,.08); backdrop-filter: blur(14px); }
.verification-shield { grid-row: 1 / 3; width: 74px; height: 74px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(135deg,#24c7a7,#2d7ff0); color: #fff; font-size: 26px; font-weight: 850; box-shadow: 0 18px 42px rgba(4,28,61,.22); }
.verification-illustration strong { color: #fff; font-size: 18px; }
.verification-illustration small { color: rgba(255,255,255,.72); line-height: 1.5; }
.verification-card { position: relative; }
.verification-step { width: fit-content; margin-bottom: 14px; padding: 6px 10px; border-radius: 999px; background: #eaf4ff; color: #126bd6; font-size: 11px; font-weight: 750; }
.verification-target { margin: 18px 0; padding: 15px 16px; border: 1px solid #dce8f5; border-radius: 14px; background: #f7fbff; color: var(--ink-800); font-size: 15px; font-weight: 720; text-align: center; letter-spacing: .02em; }
.local-otp-box { margin: 0 0 18px; padding: 15px 16px; display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; align-items: center; border: 1px dashed #73a9e5; border-radius: 14px; background: #eef7ff; }
.local-otp-box span { color: #285f9d; font-size: 11px; font-weight: 700; }
.local-otp-box strong { grid-row: 1 / 3; grid-column: 2; color: #0b3a70; font-size: 25px; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.local-otp-box small { color: #5b7694; font-size: 10px; }
.verification-form .otp-input { height: 58px; text-align: center; font-size: 24px; font-weight: 750; letter-spacing: .32em; font-variant-numeric: tabular-nums; }
.otp-resend-form { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink-500); font-size: 11px; }
.otp-resend-form button { min-height: 0; padding: 0; border: 0; background: none; color: #126bd6; font-size: 11px; font-weight: 720; cursor: pointer; }
.register-form-grid input[type="email"], .register-form-grid input[type="tel"] { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .verification-illustration { grid-template-columns: 60px 1fr; padding: 20px; } .verification-shield { width: 60px; height: 60px; border-radius: 18px; } .local-otp-box { grid-template-columns: 1fr; text-align: center; } .local-otp-box strong { grid-row: auto; grid-column: auto; } }

/* =========================================================
   v3.4 — dashboard range, tools menu, stable sidebar, uploader
   ========================================================= */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] .user-pill > .ui-icon { transform: rotate(180deg); }
.user-pill > .ui-icon { transition: transform .18s ease; }
.user-tools-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 500;
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(12, 39, 73, .18);
}
.tools-panel-head { display: grid; grid-template-columns: 44px 1fr; gap: 11px; align-items: center; margin-bottom: 12px; }
.tools-panel-head strong, .tools-panel-head small { display: block; }
.tools-panel-head strong { color: var(--ink-950); font-size: 14px; }
.tools-panel-head small { margin-top: 3px; color: var(--ink-500); font-size: 11px; line-height: 1.35; }
.tools-panel-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #e9f8f6; color: var(--teal-600); }
.tools-panel-icon .ui-icon { width: 22px; height: 22px; }
.tool-download-link { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, #0e9fb6, #126bd6); color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }
.tool-download-link .ui-icon { width: 18px; height: 18px; }
.tool-install-note { margin-top: 12px; padding: 12px; border: 1px solid #e4ebf4; border-radius: 13px; background: #f8fbff; }
.tool-install-note > strong { color: var(--ink-800); font-size: 12px; }
.tool-install-note ol { margin: 8px 0 10px 18px; padding: 0; color: var(--ink-500); font-size: 11px; line-height: 1.55; }
.tool-install-note code { padding: 2px 5px; border-radius: 5px; background: #eaf1fa; color: var(--navy-900); }
.copy-extension-url { min-height: 34px; padding: 7px 10px; border: 1px solid #cdd9e8; border-radius: 9px; background: #fff; color: var(--ink-700); font-size: 11px; }

.dashboard-period-filter { display: flex; align-items: flex-end; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.dashboard-period-filter label { display: grid; gap: 3px; color: var(--ink-500); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-period-filter input[type="date"] { width: 132px; height: 34px; padding: 0 8px; border: 1px solid #e3eaf3; border-radius: 9px; background: #f9fbfd; color: var(--ink-800); font-size: 11px; box-shadow: none; }
.dashboard-period-filter input[type="date"]:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(18,107,214,.1); }
.date-range-separator { align-self: center; margin-top: 13px; color: #9aabbd; }
.dashboard-filter-button { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 11px; }

.invoice-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.invoice-picker-card { min-height: 170px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 18px; }
.invoice-picker-card > strong { color: var(--ink-900); font-size: 14px; }
.invoice-picker-button { margin-top: 4px; }
.selected-file-summary { color: var(--ink-500); font-size: 11px; }
.selected-file-summary.has-files { color: var(--teal-600); font-weight: 700; }
.module-grid.two-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }

@media (min-width: 981px) {
    html, body { height: 100%; overflow: hidden; }
    .app-shell, .app-shell.sidebar-collapsed { height: 100vh; min-height: 0; overflow: hidden; }
    .sidebar { position: relative; top: auto; height: 100vh; min-height: 0; }
    .content { height: 100vh; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 1120px) {
    .overview-actions { align-items: stretch; flex-direction: column; }
    .dashboard-period-filter { width: 100%; }
}
@media (max-width: 760px) {
    .dashboard-period-filter { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
    .dashboard-period-filter input[type="date"] { width: 100%; }
    .date-range-separator { display: none; }
    .dashboard-filter-button { grid-column: 1 / -1; }
    .invoice-picker-grid, .module-grid.two-grid { grid-template-columns: 1fr; }
    .user-tools-dropdown { position: fixed; top: 76px; right: 16px; left: 16px; width: auto; }
}

/* =========================================================
   v73 — Hizalanma, tarix formatı və maya dəyəri metodları
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

/* Eyni tipli idarəetmə elementləri eyni optik mərkəz və hündürlükdə qalır. */
button, .btn-primary, .btn-secondary, .auth-submit,
.page-action-menu > summary, .inventory-tab, .edit-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
input, select, textarea, button { font: inherit; }
.modal-header, .section-header, .page-actions, .form-actions,
.compact-header, .info-row, .tools-panel-head { align-items: center; }
.table-wrap table th, .table-wrap table td,
.inventory-table th, .inventory-table td,
.mini-entry-table th, .mini-entry-table td { vertical-align: middle; }
.kebab-cell, .table-actions, .action-cell { text-align: center; }
.form-field input, .form-field select, .modal-form input,
.modal-form select, .modal-form textarea { width: 100%; }
.field-help, .form-hint { display: block; margin-top: 6px; color: var(--ink-500); font-size: 11px; line-height: 1.55; }

/* Dashboard tarix filtri: iki tarix və düymə tam bir xətt üzrə hizalanır. */
.overview-actions {
    display: grid;
    grid-template-columns: minmax(0, auto);
    align-items: stretch;
    gap: 10px;
}
.dashboard-period-filter {
    display: grid;
    grid-template-columns: minmax(168px, 1fr) 18px minmax(168px, 1fr) 112px;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
}
.dashboard-period-filter > label {
    min-width: 0;
    display: grid;
    grid-template-rows: 16px 48px;
    align-items: stretch;
    gap: 6px;
}
.dashboard-period-filter > label > span {
    display: flex;
    align-items: center;
    min-height: 16px;
    line-height: 1;
}
.dashboard-date-control {
    position: relative;
    width: 100%;
    height: 48px;
}
.dashboard-period-filter .dashboard-date-control .date-text {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 43px 0 14px;
    border: 1px solid #e3eaf3;
    border-radius: 12px;
    background: #f9fbfd;
    color: var(--ink-900);
    font-size: 13px;
    font-weight: 650;
    line-height: 48px;
    box-shadow: none;
}
.dashboard-period-filter .dashboard-date-control .date-picker {
    position: absolute;
    inset: 0 0 0 auto;
    width: 42px;
    height: 48px;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.dashboard-date-control::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    pointer-events: none;
    background: linear-gradient(currentColor,currentColor) 2px 3px/11px 1.5px no-repeat,
                linear-gradient(currentColor,currentColor) 2px 6px/11px 1.5px no-repeat,
                linear-gradient(currentColor,currentColor) 2px 9px/11px 1.5px no-repeat;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    color: var(--ink-800);
}
.date-range-separator {
    align-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    margin: 0;
}
.dashboard-filter-button {
    align-self: end;
    width: 112px;
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1;
}
.dashboard-filter-button > span { display: inline-flex; align-items: center; justify-content: center; }
.overview-actions > .btn-primary {
    width: 100%;
    min-height: 48px;
    justify-content: center;
}

/* Malların satışı */
.inventory-sale-modal { width: min(560px, calc(100vw - 32px)); }
.inventory-sale-form { gap: 15px; }
.inventory-method-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #dbe8f4;
    border-radius: 13px;
    background: #f6faff;
}
.inventory-method-note span { color: var(--ink-500); font-size: 12px; }
.inventory-method-note strong { color: var(--blue-700); font-size: 13px; }
.inventory-sale-form label { display: grid; gap: 7px; }
.inventory-sale-form select, .inventory-sale-form input { min-height: 46px; }
.inventory-sale-form [hidden] { display: none !important; }
.inventory-sale-form .form-actions { justify-content: flex-end; }
.inventory-sale-form .form-actions .btn-primary { min-width: 150px; min-height: 44px; }

/* Mövcud şirkətlər üçün məcburi ilkin metod seçimi */
.cost-method-setup-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    background:
        radial-gradient(circle at 12% 10%, rgba(27, 161, 151, .12), transparent 34%),
        radial-gradient(circle at 88% 88%, rgba(18, 107, 214, .12), transparent 32%),
        #f5f8fc;
}
.cost-method-setup-card {
    width: min(700px, 100%);
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid #dfe8f2;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 65px rgba(25, 55, 88, .12);
}
.cost-method-setup-card h1 { margin: 8px 0 10px; color: var(--ink-900); font-size: clamp(25px, 4vw, 36px); line-height: 1.18; }
.cost-method-setup-card > p { margin: 0 0 24px; color: var(--ink-500); line-height: 1.65; }
.cost-method-options { display: grid; gap: 12px; }
.cost-method-option {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #dfe8f2;
    border-radius: 15px;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.cost-method-option:hover { border-color: #95bce8; background: #f8fbff; }
.cost-method-option:has(input:checked) { border-color: var(--blue-600); background: #f3f8ff; box-shadow: 0 0 0 3px rgba(18,107,214,.08); }
.cost-method-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue-600); }
.cost-method-option span { display: grid; gap: 4px; }
.cost-method-option strong { color: var(--ink-900); font-size: 14px; }
.cost-method-option small { color: var(--ink-500); line-height: 1.5; }
.cost-method-options > .btn-primary { min-height: 48px; margin-top: 4px; }
.setup-logout-link { display: inline-flex; margin-top: 18px; color: var(--ink-500); font-size: 12px; }

.flash.warning { background: #fff8e8; border-color: #f0d38b; color: #7a5800; }

@media (max-width: 1120px) {
    .overview-actions { width: 100%; grid-template-columns: 1fr; }
    .dashboard-period-filter { width: 100%; }
}
@media (max-width: 760px) {
    .dashboard-period-filter {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .dashboard-period-filter > label { grid-template-rows: 16px 46px; }
    .dashboard-date-control,
    .dashboard-period-filter .dashboard-date-control .date-text,
    .dashboard-period-filter .dashboard-date-control .date-picker { height: 46px; min-height: 46px; }
    .date-range-separator { display: none; }
    .dashboard-filter-button { grid-column: 1 / -1; width: 100%; height: 46px; min-height: 46px; }
    .inventory-method-note { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 480px) {
    .dashboard-period-filter { grid-template-columns: 1fr; }
    .dashboard-filter-button { grid-column: auto; }
}

@media (min-width: 1121px) {
    .overview-actions { width: min(740px, 50vw); }
    .dashboard-period-filter { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 112px; }
}

/* =========================================================
   v76 — İcmal düzülüşü, bərabər cədvəl xanaları və yükləmə ekranı
   ========================================================= */

/* İcmal: tarixlər və düymələr bir-birinin üzərinə düşmədən bir xəttdə qalır. */
.overview-hero {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) auto;
    align-items: center;
    gap: 28px;
}
.overview-actions {
    width: auto;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}
.dashboard-period-filter {
    width: auto;
    display: grid;
    grid-template-columns: 150px 150px 86px;
    align-items: end;
    gap: 10px;
    padding: 10px;
    border-radius: 15px;
}
.dashboard-period-filter > label {
    min-width: 0;
    display: grid;
    grid-template-rows: 15px 42px;
    gap: 5px;
}
.dashboard-period-filter > label > span {
    min-height: 15px;
    display: flex;
    align-items: center;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.dashboard-date-control {
    position: relative !important;
    display: block !important;
    width: 150px !important;
    height: 42px !important;
    min-height: 42px !important;
}
.dashboard-period-filter .dashboard-date-control .date-text {
    position: relative;
    z-index: 1;
    display: block;
    width: 150px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 43px 0 13px !important;
    border: 1px solid #dce6f1 !important;
    border-radius: 11px !important;
    background: #fbfcfe !important;
    color: var(--ink-900) !important;
    font-size: 12px !important;
    font-weight: 680 !important;
    line-height: 42px !important;
    font-variant-numeric: tabular-nums;
    box-shadow: none !important;
}
.dashboard-period-filter .dashboard-date-control .date-text:focus {
    border-color: #73a9ef !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(47,128,237,.10) !important;
}
.dashboard-period-filter .dashboard-date-control .date-picker {
    position: absolute !important;
    z-index: 3 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
}
.dashboard-date-control::after {
    content: "" !important;
    position: absolute !important;
    z-index: 2 !important;
    top: 50% !important;
    right: 14px !important;
    left: auto !important;
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    border: 1.5px solid #193e68 !important;
    border-radius: 3px !important;
    background:
        linear-gradient(#193e68,#193e68) 2px 3px/11px 1.5px no-repeat,
        linear-gradient(#193e68,#193e68) 2px 6px/11px 1.5px no-repeat,
        linear-gradient(#193e68,#193e68) 2px 9px/11px 1.5px no-repeat !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}
.dashboard-filter-button {
    width: 86px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}
.overview-actions > .dashboard-new-entry-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 174px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 16px;
    gap: 8px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    justify-content: center;
}
.overview-actions > .dashboard-new-entry-button .ui-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}
.date-range-separator { display: none !important; }

/* Debitor/Kreditor: bütün sütunlar eyni en və eyni daxili ölçüdədir. */
.contragent-table {
    width: 100% !important;
    min-width: 980px;
    table-layout: fixed !important;
}
.contragent-table th,
.contragent-table td,
.contragent-table th:nth-child(n),
.contragent-table td:nth-child(n) {
    width: 14.2857% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 58px;
    padding: 12px 13px !important;
    vertical-align: middle !important;
    overflow-wrap: anywhere;
    word-break: normal;
}
.contragent-table th { height: 48px; }
.contragent-table .amount-col { text-align: center !important; }

/* Vaxt aparan import və toplu emal prosesləri üçün brendli yükləmə ekranı. */
.long-task-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 24, 52, .48);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.long-task-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}
body.long-task-active { overflow: hidden !important; }
.long-task-card {
    width: min(360px, calc(100vw - 32px));
    padding: 30px 28px 27px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 24px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 30px 90px rgba(0, 22, 54, .28);
    text-align: center;
    transform: translateY(8px) scale(.985);
    transition: transform .22s ease;
}
.long-task-overlay.open .long-task-card { transform: translateY(0) scale(1); }
.long-task-logo {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    border-radius: 25px;
    background: linear-gradient(145deg, #eef8ff, #edfffb);
    box-shadow: inset 0 0 0 1px #dcecf7, 0 14px 34px rgba(23, 102, 180, .13);
}
.long-task-logo svg { width: 74px; height: 74px; overflow: visible; }
.loading-house {
    fill: none;
    stroke: #0b315d;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.loading-chart-bar {
    fill: url(#loading-logo-gradient);
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: loading-chart-bounce 1.05s ease-in-out infinite;
}
.loading-chart-bar-2 { animation-delay: .16s; }
.loading-chart-bar-3 { animation-delay: .32s; }
.loading-floor {
    fill: none;
    stroke: #10b9a5;
    stroke-width: 6;
    stroke-linecap: round;
}
.loading-lines {
    fill: none;
    stroke: #0b315d;
    stroke-width: 4;
    stroke-linecap: round;
    opacity: .72;
}
@keyframes loading-chart-bounce {
    0%, 100% { transform: translateY(0) scaleY(1); }
    45% { transform: translateY(-5px) scaleY(1.08); }
    70% { transform: translateY(1px) scaleY(.96); }
}
.long-task-card > strong {
    color: var(--ink-950);
    font-size: 20px;
    font-weight: 790;
    letter-spacing: -.25px;
    font-variant-numeric: tabular-nums;
}
.long-task-card > span {
    min-height: 18px;
    margin-top: 7px;
    color: var(--ink-500);
    font-size: 12px;
    line-height: 1.45;
}
.long-task-progress {
    width: 100%;
    height: 8px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eff7;
}
.long-task-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b9a5, #1e63d9);
    box-shadow: 0 0 14px rgba(30, 99, 217, .28);
    transition: width .24s ease;
}

@media (max-width: 1450px) {
    .overview-hero {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 18px;
    }
    .overview-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 760px) {
    .overview-hero { display: flex; flex-direction: column; }
    .overview-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }
    .dashboard-period-filter {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .dashboard-date-control,
    .dashboard-period-filter .dashboard-date-control .date-text {
        width: 100% !important;
    }
    .dashboard-filter-button {
        grid-column: 1 / -1;
        width: 100%;
    }
    .overview-actions > .dashboard-new-entry-button {
        width: 100%;
        min-width: 0;
    }
}
@media (max-width: 480px) {
    .dashboard-period-filter { grid-template-columns: 1fr; }
    .dashboard-filter-button { grid-column: auto; }
    .long-task-card { padding: 26px 22px 24px; }
}

/* =========================================================
   v77 — İcmal tarix sətrinin sadələşdirilməsi
   ========================================================= */
/* Tarix idarəetmələrinin arxasındakı ayrıca ağ panel ləğv edilir.
   Ardıcıllıq dəyişmir: Başlanğıc → Son → Göstər → Yeni müxabirləşmə. */
.dashboard-period-filter {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

@media (min-width: 761px) {
    .overview-actions {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: flex-end !important;
        justify-content: flex-end;
        gap: 10px;
    }
    .dashboard-period-filter {
        flex: 0 0 auto;
        grid-template-columns: 150px 150px 86px !important;
        align-items: end !important;
        gap: 10px !important;
    }
    .dashboard-filter-button,
    .overview-actions > .dashboard-new-entry-button {
        align-self: end;
    }
}


/* =========================================================
   v78 — Scroll, icmal idarəetmələri və bildiriş davranışı
   ========================================================= */

/* Desktop-da səhifə ilk açılışdan etibarən brauzerin adi scroll-u ilə işləyir.
   Əvvəlki daxili .content scroll modeli bəzi girişlərdə səhifəni kilidləyirdi. */
@media (min-width: 981px) {
    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    body {
        height: auto !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    .app-shell,
    .app-shell.sidebar-collapsed {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        align-items: start !important;
    }
    .sidebar {
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
    }
    .content {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
    }
}

/* İcmalda sıra həmişə: Başlanğıc → Son → Göstər → Yeni müxabirləşmə.
   Form display:contents olduğu üçün dörd element eyni grid xəttində və eyni alt səviyyədədir. */
@media (min-width: 761px) {
    .overview-hero {
        display: grid !important;
        grid-template-columns: minmax(390px, 1fr) auto !important;
        align-items: end !important;
        column-gap: 24px !important;
        row-gap: 16px !important;
    }
    .overview-actions {
        width: auto !important;
        display: grid !important;
        grid-template-columns: 150px 150px 86px 174px !important;
        align-items: end !important;
        justify-content: end !important;
        gap: 10px !important;
    }
    .dashboard-period-filter {
        display: contents !important;
    }
    .dashboard-period-filter > label {
        width: 150px !important;
        min-width: 150px !important;
        grid-template-rows: 15px 42px !important;
        align-self: end !important;
        margin: 0 !important;
    }
    .dashboard-date-control,
    .dashboard-period-filter .dashboard-date-control .date-text {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        height: 42px !important;
        min-height: 42px !important;
    }
    .dashboard-filter-button,
    .overview-actions > .dashboard-new-entry-button {
        align-self: end !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        transform: none !important;
    }
    .dashboard-filter-button {
        width: 86px !important;
        min-width: 86px !important;
        max-width: 86px !important;
    }
    .overview-actions > .dashboard-new-entry-button {
        width: 174px !important;
        min-width: 174px !important;
        max-width: 174px !important;
    }
}

/* Orta enli ekranlarda başlıq və idarəetmələr ayrı sətirdə, idarəetmələr isə yenə simmetrik qalır. */
@media (min-width: 761px) and (max-width: 1450px) {
    .overview-hero {
        grid-template-columns: 1fr !important;
        align-items: start !important;
    }
    .overview-actions {
        justify-content: start !important;
    }
}

@media (max-width: 760px) {
    .overview-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 10px !important;
    }
    .dashboard-period-filter {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .dashboard-period-filter > label,
    .dashboard-date-control,
    .dashboard-period-filter .dashboard-date-control .date-text {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    .dashboard-filter-button {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
    .overview-actions > .dashboard-new-entry-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

@media (max-width: 480px) {
    .dashboard-period-filter {
        grid-template-columns: 1fr !important;
    }
    .dashboard-filter-button {
        grid-column: auto !important;
    }
}

/* Flash mesajın 3 saniyədən sonra yumşaq itməsi. */
.flash {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease !important;
}
.flash.flash-hiding {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-8px) !important;
    pointer-events: none !important;
}

/* Modal, mobil menyu və uzun proses açıq olduqda scroll yalnız həmin müddətdə kilidlənir. */
body.modal-open,
body.nav-open,
body.long-task-active {
    overflow: hidden !important;
}
.auth-forgot-link{display:block;text-align:right;margin-top:10px;font-weight:700;color:#0b5fb3;text-decoration:none}.auth-forgot-link:hover{text-decoration:underline}


/* Registration password visibility control */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrap > input {
    width: 100%;
    padding-right: 50px !important;
}
.password-visibility-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-500, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
    background: rgba(15, 61, 94, .08);
    color: var(--ink-900, #0f172a);
    outline: none;
}
.password-eye-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.password-eye-closed { display: none; }
.password-visibility-toggle[aria-pressed="true"] .password-eye-open { display: none; }
.password-visibility-toggle[aria-pressed="true"] .password-eye-closed { display: block; }
