/* =========================================================
   Ritual CRM — Forma-style
   Кремовая земля, терракотовый акцент, serif-заголовки,
   бумажная текстура, тёплые тени
   ========================================================= */

:root {
    /* --------------------------------------------------------
       Палитра Forma (тёплая, приглушённая)
       -------------------------------------------------------- */
    --bg:           #f5f1e8;
    --bg-deep:      #ebe5d5;
    --surface:      #fdfbf6;
    --surface-2:    #f8f4ea;
    --ink:          #1c1916;
    --ink-soft:     #4a4640;
    --ink-mute:     #8a857a;
    --ink-faint:    #b8b3a6;
    --line:         #d9d2bf;
    --line-soft:    #e8e2d0;
    --line-faint:   #f0ebde;

    --accent:       #b8421f;
    --accent-deep:  #8c2f15;
    --accent-soft:  #f4d4c2;
    --accent-bg:    #fbeee5;

    --emerald:      #1f6b4a;
    --emerald-bg:   #d8ede0;
    --mustard:      #b8860b;
    --mustard-bg:   #f5e6c0;
    --plum:         #6b3e5a;
    --plum-bg:      #ebd8e4;
    --ocean:        #2a5d7c;
    --ocean-bg:     #d4e2ec;

    /* Text utilities (соответствие app.js) */
    --text-success: var(--emerald);
    --text-warning: var(--mustard);
    --text-danger:  var(--accent);
    --text-info:    var(--ocean);

    /* --------------------------------------------------------
       Шрифты
       -------------------------------------------------------- */
    --font-ui:      'Outfit', system-ui, -apple-system, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-italic:  'Instrument Serif', Georgia, serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-print:   'Times New Roman', Times, serif;

    /* Тени — мягкие, тёплые */
    --shadow-sm: 0 1px 2px rgba(28, 25, 22, 0.04);
    --shadow-md: 0 4px 16px rgba(28, 25, 22, 0.06);
    --shadow-lg: 0 12px 40px rgba(28, 25, 22, 0.10);
    --shadow-xl: 0 24px 60px rgba(28, 25, 22, 0.15);

    /* Радиусы — большие, мягкие */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Z-индексы */
    --z-topbar:           100;
    --z-sidebar:          110;
    --z-sidebar-backdrop: 105;
    --z-modal-backdrop:   200;
    --z-modal:            210;
    --z-toast:            300;
}

/* =========================================================
   Reset & base
   ========================================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { height: 100%; }
body {
    min-height: 100vh;
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'ss01', 'cv11';
}

/* Бумажная текстура + ambient gradient (Forma-фишка) */
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(184, 66, 31, 0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(31, 107, 74, 0.03), transparent 50%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: "";
    position: fixed; inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    opacity: 0.6;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

#app-layout, .auth-wrapper { position: relative; z-index: 1; }

::selection { background: var(--accent); color: white; }

code, .font-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

::placeholder { color: var(--ink-faint); opacity: 1; }

.custom-table,
.metric-value,
.metric-sub,
.totals-row input,
input[type="number"] {
    font-variant-numeric: tabular-nums;
}

/* Soft scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 5px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* =========================================================
   Utilities
   ========================================================= */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-secondary { color: var(--ink-soft); }
.text-muted     { color: var(--ink-mute); }
.text-success   { color: var(--text-success); }
.text-warning   { color: var(--text-warning); }
.text-danger    { color: var(--text-danger); }
.text-info      { color: var(--text-info); }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }

/* =========================================================
   1. AUTHENTICATION — Forma split (full viewport, no scroll)
   ========================================================= */
.auth-wrapper {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}
.auth-wrapper::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(184, 66, 31, 0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(31, 107, 74, 0.03), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* === LEFT: dark brand panel === */
.auth-left {
    background: var(--ink);
    color: var(--bg);
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: "";
    position: absolute;
    top: -100px; right: -100px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.45;
    pointer-events: none;
}
.auth-left::after {
    content: "";
    position: absolute;
    bottom: -120px; left: 10%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, var(--emerald) 0%, transparent 70%);
    opacity: 0.25;
    pointer-events: none;
}
.auth-left > * { position: relative; z-index: 1; }

.auth-left-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: auth-rise 0.5s 0.05s ease backwards;
}
.auth-brand-logo { display: flex; align-items: center; gap: 12px; }
.auth-brand-mark {
    width: 42px; height: 42px;
    background: var(--bg);
    color: var(--ink);
    border-radius: 12px;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
}
.auth-brand-name {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--bg);
    letter-spacing: -0.01em;
    line-height: 1;
}
.auth-brand-name em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent-soft);
}
.auth-lang {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--bg);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.auth-lang:hover { background: rgba(255,255,255,0.12); }
.auth-lang i { font-size: 14px; }

.auth-left-hero {
    max-width: 480px;
    animation: auth-rise 0.6s 0.15s ease backwards;
}
.auth-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-soft);
    font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.auth-eyebrow::before {
    content: ""; width: 28px; height: 1px;
    background: var(--accent-soft);
}
.auth-hero-title {
    font-family: var(--font-display);
    font-size: 56px;
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--bg);
    margin: 0 0 20px;
}
.auth-hero-title em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent-soft);
    font-weight: 400;
}
.auth-hero-sub {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-faint);
    max-width: 420px;
    margin: 0;
}

.auth-left-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    animation: auth-rise 0.6s 0.3s ease backwards;
}
.auth-left-stat .lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    font-weight: 600;
    margin-bottom: 6px;
}
.auth-left-stat .val {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
    color: var(--bg);
}
.auth-left-stat .delta {
    font-size: 10.5px;
    color: var(--accent-soft);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.auth-left-notice {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 18px 20px;
    animation: auth-rise 0.6s 0.4s ease backwards;
}
.auth-notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-soft);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.auth-notice-header i {
    font-size: 18px;
}
.auth-notice-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-faint);
    margin: 0;
}

.auth-left-foot {
    font-size: 11px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
    animation: auth-rise 0.5s 0.5s ease backwards;
}

/* === RIGHT: form panel === */
.auth-right {
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg);
    position: relative;
}
.auth-right-inner {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    animation: auth-rise 0.6s 0.1s ease backwards;
}

.auth-back {
    position: absolute;
    top: 32px; right: 40px;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ink-mute);
    font-size: 12px;
    text-decoration: none;
    font-family: inherit;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.auth-back:hover { color: var(--ink); background: var(--bg-deep); }
.auth-back i { font-size: 16px; }

.auth-deco {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
}
.auth-deco-1 {
    top: 80px; right: 60px;
    width: 60px; height: 60px;
    border: 1.5px solid var(--line);
    border-radius: 50%;
}
.auth-deco-2 {
    bottom: 100px; right: 100px;
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
}
.auth-deco-3 {
    bottom: 60px; left: 40px;
    width: 80px; height: 1px;
    background: var(--line);
}

.auth-form-head { margin-bottom: 28px; }
.auth-form-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.018em;
    margin: 0 0 8px;
    color: var(--ink);
}
.auth-form-sub {
    font-size: 14px;
    color: var(--ink-mute);
    margin: 0;
}

.auth-form { display: flex; flex-direction: column; }

.auth-field { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--ink-mute);
    pointer-events: none;
    font-size: 16px;
}
.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    transition: all 0.15s ease;
    outline: none;
}
.auth-input-with-icon { padding-left: 42px; }
.form-input::placeholder { color: var(--ink-faint); }
.form-input:hover { border-color: var(--ink-faint); }
.form-input:focus {
    border-color: var(--ink);
    background: white;
    box-shadow: 0 0 0 4px var(--accent-bg);
}
.auth-input-action {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--ink-mute);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: grid; place-items: center;
    transition: all 0.15s ease;
}
.auth-input-action:hover { color: var(--ink); background: var(--bg-deep); }
.auth-input-action i { font-size: 16px; }

.auth-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 6px 0 20px;
}
.auth-check {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-soft);
    user-select: none;
}
.auth-check input { display: none; }
.auth-check-box {
    width: 18px; height: 18px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 5px;
    display: grid; place-items: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.auth-check input:checked + .auth-check-box {
    background: var(--ink);
    border-color: var(--ink);
}
.auth-check input:checked + .auth-check-box::after {
    content: ""; width: 9px; height: 5px;
    border-left: 2px solid white; border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}
.auth-form-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}
.auth-form-link:hover { color: var(--accent-deep); }

.auth-error {
    background: var(--accent-bg);
    color: var(--accent-deep);
    border: 1px solid var(--accent-soft);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 14px;
    animation: auth-fade 0.2s ease;
}

.auth-submit-btn {
    width: 100%;
    background: var(--ink);
    color: var(--bg);
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}
.auth-submit-btn:hover { background: var(--accent); }
.auth-submit-btn:active { transform: scale(0.99); }
.auth-submit-btn:disabled { opacity: 0.7; cursor: progress; }
.auth-submit-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}
.auth-submit-btn:hover::after { left: 100%; }
.auth-submit-btn i.bx-loader-alt.bx-spin { font-size: 18px; }
.auth-submit-arrow { transition: transform 0.2s ease; }
.auth-submit-btn:hover:not(:disabled) .auth-submit-arrow { transform: translateX(3px); }

.auth-note {
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ocean-bg);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ocean);
}
.auth-note i { font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.auth-note strong { font-weight: 600; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--ink-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.auth-quick-btn {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
}
.auth-quick-btn:hover {
    background: var(--surface-2);
    border-color: var(--ink-faint);
    color: var(--ink);
}
.auth-quick-btn i { font-size: 14px; }

.auth-form-foot {
    margin-top: 28px;
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-mute);
}
.auth-form-foot > span { margin-right: 6px; }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right { padding: 32px 24px; min-height: 100vh; }
    .auth-form-title { font-size: 28px; }
    .auth-deco { display: none; }
    .auth-back { top: 16px; right: 16px; }
}
@media (max-width: 480px) {
    .auth-right-inner { max-width: 100%; }
    .auth-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .auth-quick-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-left-top, .auth-left-hero, .auth-left-stats,
    .auth-left-notice, .auth-left-foot, .auth-right-inner { animation: none; }
}

/* =========================================================
   2. App Layout
   ========================================================= */
#app-layout {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--ink);
    color: var(--bg);
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
}
.sidebar-logo-icon {
    width: 32px; height: 32px;
    background: var(--bg);
    color: var(--ink);
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1;
}
.sidebar-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--bg);
    line-height: 1;
}
.sidebar-title em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent-soft);
}
.sidebar-sub {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-faint);
    margin-top: 2px;
}
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    font-weight: 600;
    padding: 0 12px 6px;
}
.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    flex: 1;
}
.nav-item { display: block; }
.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--ink-faint);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.nav-btn i { font-size: 18px; }
.nav-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
    transition: fill 0.15s ease, color 0.15s ease;
}
.nav-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--bg);
}
.nav-item.active .nav-btn {
    background: var(--bg);
    color: var(--ink);
    font-weight: 600;
}
.nav-item.active .nav-btn i { color: var(--accent); }
.nav-item.active .nav-btn svg { fill: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px;
    color: var(--bg);
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bg);
    line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role { font-size: 10.5px; color: var(--ink-faint); line-height: 1.2; }
.btn-logout {
    background: transparent; border: 0;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: var(--bg); }
.btn-logout i { font-size: 16px; }

/* =========================================================
   3. Main + Topbar
   ========================================================= */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 14px clamp(20px, 3vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.topbar-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -0.015em;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content-body { padding: clamp(20px, 3vw, 36px); flex: 1; }

/* =========================================================
   4. Tabs / nav
   ========================================================= */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* =========================================================
   5. Tables
   ========================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -22px;
    padding: 0 22px;
}
.custom-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 13px;
}
.custom-table th {
    background: transparent;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-bottom: 1px solid var(--line);
}
.custom-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
    vertical-align: middle;
}
.custom-table tbody tr:hover td { background: var(--surface-2); }
.custom-table tbody tr:last-child td { border-bottom: 0; }

/* =========================================================
   6. Section cards + forms + buttons
   ========================================================= */
.section-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.section-card-soft {
    background: var(--surface-2);
    border-style: dashed;
    border-color: var(--line);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}
.section-title em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent);
}
.section-title i { font-size: 16px; color: var(--ink-mute); }
.section-sub {
    font-size: 12px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* =========================================================
   6.1 Dashboard enhancements
   ========================================================= */
.dash-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin: 4px 0 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.dash-hero-left { min-width: 0; flex: 1 1 320px; }
.dash-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 8px;
}
.dash-hero-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.1;
    color: var(--ink);
    margin: 0 0 8px;
    font-weight: 400;
    letter-spacing: -0.015em;
}
.dash-hero-title em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent);
}
.dash-hero-sub {
    color: var(--ink-mute);
    font-size: 14px;
    margin: 0;
    max-width: 60ch;
}
.dash-hero-right { display: flex; gap: 14px; align-items: stretch; }
.dash-mini-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dash-mini-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-mute);
}
.dash-mini-value {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--ink);
    line-height: 1;
}
.dash-section-title {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 14px;
    color: var(--ink-mute);
    margin: 8px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}
.dash-section-title i { font-size: 16px; color: var(--accent); }

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.metrics-grid-secondary .metric-mini .metric-value { font-size: 26px; }
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--ink-faint);
}
.metric-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.metric-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
}
.metric-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--surface-2);
    color: var(--ink-soft);
}
.metric-icon i { font-size: 16px; }
.icon-emerald { background: var(--emerald-bg); color: var(--emerald); }
.icon-amber   { background: var(--mustard-bg); color: var(--mustard); }
.icon-rose    { background: var(--accent-bg);  color: var(--accent); }
.icon-sky     { background: var(--ocean-bg);   color: var(--ocean); }
.metric-value {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.1;
    color: var(--ink);
}
.metric-sub {
    font-size: 11.5px;
    color: var(--ink-mute);
}
.metric-card.metric-featured {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    position: relative;
    overflow: hidden;
}
.metric-card.metric-featured::before {
    content: "";
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
    opacity: 0.22;
    pointer-events: none;
}
.metric-card.metric-featured .metric-label { color: var(--accent-soft); }
.metric-card.metric-featured .metric-value { color: var(--bg); font-size: 42px; }
.metric-card.metric-featured .metric-sub { color: var(--ink-faint); }
.metric-card.metric-featured .metric-icon { background: rgba(255,255,255,0.10); color: var(--accent-soft); }

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.15s ease;
    color: var(--ink);
}
.qa-btn:hover {
    border-color: var(--ink-faint);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.qa-btn > i { font-size: 22px; color: var(--ink-mute); margin-bottom: 2px; }
.qa-btn:hover > i { color: var(--accent); }
.qa-btn-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.qa-btn-sub { font-size: 11.5px; color: var(--ink-mute); line-height: 1.35; }
.qa-btn.qa-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.qa-btn.qa-primary > i { color: var(--accent-soft); }
.qa-btn.qa-primary .qa-btn-title { color: var(--bg); }
.qa-btn.qa-primary .qa-btn-sub { color: var(--ink-faint); }
.qa-btn.qa-primary:hover { background: var(--ink-soft); }

/* Status bars */
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-bar-row { display: flex; flex-direction: column; gap: 6px; }
.status-bar-label {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    font-size: 13px;
}
.status-bar-name { color: var(--ink); font-weight: 500; }
.status-bar-count { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.status-bar-pct { font-size: 11.5px; color: var(--ink-faint); }
.status-bar-track {
    height: 8px;
    background: var(--bg-deep);
    border-radius: 999px;
    overflow: hidden;
}
.status-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.status-bar-fill.bar-new      { background: var(--ocean); }
.status-bar-fill.bar-progress { background: var(--mustard); }
.status-bar-fill.bar-paid     { background: var(--emerald); }
.status-bar-fill.bar-closed   { background: var(--ink-mute); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    background: var(--surface-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    color: var(--ink-mute);
}
.empty-state-icon i { font-size: 44px; color: var(--ink-faint); display: inline-block; margin-bottom: 8px; }
.empty-state-title {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
    margin: 0 0 6px;
    font-weight: 400;
}
.empty-state-text {
    max-width: 44ch;
    margin: 0 auto 16px;
    font-size: 14px;
    color: var(--ink-mute);
    line-height: 1.5;
}
.empty-state-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.empty-state-empty {
    text-align: center;
    color: var(--ink-faint);
    padding: 18px 0;
}
.empty-state-empty i { font-size: 32px; display: block; margin-bottom: 6px; }
.empty-state-empty p { margin: 0; font-size: 13px; color: var(--ink-mute); }

/* Onboarding */
.onboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.onboard-step { display: flex; gap: 14px; align-items: flex-start; }
.onboard-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent-deep);
    font-family: var(--font-display);
    font-size: 16px;
    display: grid; place-items: center;
    line-height: 1;
}
.onboard-step h4 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    margin: 0 0 4px;
    color: var(--ink);
}
.onboard-step p {
    font-size: 13px;
    color: var(--ink-mute);
    line-height: 1.5;
    margin: 0 0 10px;
}

/* =========================================================
   6.2 Form controls & buttons (CRM)
   ========================================================= */
.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.form-control {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    transition: all 0.15s ease;
    outline: none;
}
.form-control:hover { border-color: var(--ink-faint); }
.form-control:focus { border-color: var(--ink); background: white; box-shadow: 0 0 0 3px var(--accent-bg); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.form-row > .form-group { margin-bottom: 0; }
.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.form-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-mute);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-soft);
}
.form-check {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--ink-soft);
}
.form-check input { display: none; }
.form-check input:checked + .check-box {
    background: var(--ink);
    border-color: var(--ink);
}
.check-box {
    width: 18px; height: 18px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 5px;
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.check-box::after {
    content: ""; width: 9px; height: 5px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(-45deg) translate(1px, -1px);
    transition: border-color 0.15s ease;
}
.form-check input:checked + .check-box::after {
    border-left-color: white; border-bottom-color: white;
}
.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-search { flex: 1; min-width: 220px; }

/* =========================================================
   6.3 Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-faint); color: var(--ink); }
.btn i { font-size: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-secondary { background: var(--surface); }
.btn-primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}
.btn-primary:hover { background: var(--ink-soft); color: var(--bg); }
.btn-danger {
    background: var(--accent-bg);
    color: var(--accent-deep);
    border-color: var(--accent-soft);
}
.btn-danger:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* =========================================================
   6.4 Modals
   ========================================================= */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(28, 25, 22, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 900px;
    max-height: calc(100vh - 64px);
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: translateY(8px) scale(0.99);
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.open .modal-container { transform: translateY(0) scale(1); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}
.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
    margin: 0;
    font-weight: 400;
}
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}

/* =========================================================
   6.5 Toasts
   ========================================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-toast, 200);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
}

/* =========================================================
   6.6 Document preview
   ========================================================= */
.doc-preview-area { padding: 14px; }

/* =========================================================
   15. Responsive
   ========================================================= */
   ========================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -22px;
    padding: 0 22px;
}
.custom-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 13px;
}
.custom-table th {
    background: transparent;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    text-align: left;
}
.custom-table td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--line-faint);
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
}
.custom-table tbody tr { transition: background 0.1s ease; }
.custom-table tbody tr:hover { background: var(--bg-deep); }
.custom-table tbody tr:last-child td { border-bottom: 0; }

.custom-table code {
    background: var(--bg-deep);
    color: var(--ink);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 500;
    border: 1px solid var(--line-soft);
}
.custom-table .table-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

/* =========================================================
   8. Status badges (Forma: pill с точкой)
   ========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
    line-height: 1.5;
    border: 1px solid transparent;
}
.badge::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge-new {
    background: var(--ocean-bg);
    color: var(--ocean);
    border-color: color-mix(in srgb, var(--ocean) 20%, transparent);
}
.badge-progress {
    background: var(--mustard-bg);
    color: var(--mustard);
    border-color: color-mix(in srgb, var(--mustard) 20%, transparent);
}
.badge-paid {
    background: var(--emerald-bg);
    color: var(--emerald);
    border-color: color-mix(in srgb, var(--emerald) 20%, transparent);
}
.badge-closed {
    background: var(--bg-deep);
    color: var(--ink-mute);
    border-color: var(--line);
}
.badge-goods {
    background: var(--plum-bg);
    color: var(--plum);
    border-color: color-mix(in srgb, var(--plum) 20%, transparent);
}
.badge-services {
    background: var(--ocean-bg);
    color: var(--ocean);
    border-color: color-mix(in srgb, var(--ocean) 20%, transparent);
}
.badge-transport {
    background: var(--mustard-bg);
    color: var(--mustard);
    border-color: color-mix(in srgb, var(--mustard) 20%, transparent);
}
.badge-delivery {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.badge-docs {
    background: var(--emerald-bg);
    color: var(--emerald);
    border-color: color-mix(in srgb, var(--emerald) 20%, transparent);
}

/* =========================================================
   9. Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 36px;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
    white-space: nowrap;
}
.btn:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 15px; }

.btn-primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}
.btn-secondary:hover {
    background: var(--bg-deep);
    border-color: var(--ink-faint);
}

.btn-danger {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--line);
}
.btn-danger:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.btn-success {
    background: var(--emerald);
    color: white;
    border-color: var(--emerald);
    font-weight: 600;
}
.btn-success:hover { filter: brightness(1.05); }

.btn-sm {
    padding: 4px 9px;
    font-size: 12px;
    min-height: 28px;
    min-width: 28px;
    border-radius: 6px;
}
.btn-sm i { font-size: 13px; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-icon:hover {
    background: var(--bg-deep);
    border-color: var(--ink-faint);
    color: var(--accent);
}
.btn-icon i {
    font-size: 20px;
}

.menu-toggle {
    display: none;
}

/* =========================================================
   10. Filter bar & forms
   ========================================================= */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-search { flex: 1; min-width: 220px; }
.filter-select { width: 180px; }

.form-control {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    outline: none;
    transition: all 0.15s ease;
    width: 100%;
    min-height: 38px;
    font-family: inherit;
    line-height: 1.4;
}
.form-control:hover { border-color: var(--ink-faint); }
.form-control:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px var(--accent-bg);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a857a' stroke-width='1.4' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.form-row > .form-group { margin-bottom: 0; }

.form-section-title {
    color: var(--ink);
    margin: 20px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}
.form-section-title:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}
.form-section-title i { color: var(--ink-mute); font-size: 14px; }

.form-section-hint {
    font-size: 12px;
    color: var(--ink-faint);
    margin: -6px 0 12px;
}

.totals-row {
    background: var(--bg-deep);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-soft);
    margin-top: 16px !important;
}
.totals-row input[readonly] {
    background: transparent;
    border-color: transparent;
    font-weight: 600;
    color: var(--ink);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}
.action-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   11. Modal
   ========================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 22, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    padding: 32px 20px;
    overflow-y: auto;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: translateY(8px) scale(0.99);
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    z-index: var(--z-modal);
    overflow: hidden;
}
.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface);
    flex-shrink: 0;
}
.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
    outline: none;
}
.modal-title em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--accent);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.doc-modal-body {
    background: var(--bg-deep);
    padding: 22px;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--surface-2);
    flex-shrink: 0;
}

/* =========================================================
   12. Print documents (A4) — без изменений
   ========================================================= */
.doc-preview-area {
    background: var(--bg-deep);
    padding: 28px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    overflow-y: auto;
    max-height: 75vh;
}

.a4-page {
    background: #ffffff;
    color: #111111;
    width: 210mm;
    min-height: 297mm;
    padding: 22mm 18mm 26mm;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-family: var(--font-print);
    font-size: 11pt;
    line-height: 1.5;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}
.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    margin-bottom: 22px;
    gap: 16px;
}
.doc-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.doc-company-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 17pt;
    color: #000;
    line-height: 1.15;
    letter-spacing: 0.2px;
}
.doc-company-info {
    font-size: 9pt;
    color: #555;
    line-height: 1.55;
    margin-top: 2px;
}
.doc-meta {
    text-align: right;
    font-size: 9.5pt;
    line-height: 1.5;
    color: #444;
}
.doc-meta .doc-meta-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11pt;
    color: #000;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}
.doc-title {
    text-align: center;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 17pt;
    color: #000;
    margin: 16px 0 12px;
    padding: 8px 0;
    letter-spacing: 0.8px;
    line-height: 1.2;
    font-weight: 400;
}
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 9pt;
    border: 1px solid #000;
}
.doc-table th, .doc-table td {
    border: 0.5px solid #000;
    padding: 2px 6px;
    text-align: left;
}
.doc-table th {
    background: none;
    color: #000;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 8pt;
    border-color: #000;
}
.doc-table .num-col { text-align: center; width: 40px; }
.doc-table .right-col { text-align: right; }
.doc-table tr { page-break-inside: avoid; break-inside: avoid; }
.doc-totals {
    margin-top: 8px;
    text-align: right;
    font-size: 10pt;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    page-break-inside: avoid;
    break-inside: avoid;
}
.doc-totals p { margin-bottom: 2px; color: #333; }
.doc-totals p.doc-total-final {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 13pt;
    color: #000;
    margin-top: 2px;
    border-top: 1.5px solid #000;
    padding-top: 3px;
    display: inline-block;
}
.doc-words {
    margin-top: 4px;
    font-style: normal;
    padding: 0;
    font-size: 10pt;
    line-height: 1.45;
    color: #333;
    font-family: 'Inter', sans-serif;
    page-break-inside: avoid;
    break-inside: avoid;
}
.doc-words strong { color: #000; }
.doc-legal {
    margin: 14px 0;
    font-size: 9pt;
    line-height: 1.5;
    text-align: justify;
    color: #000;
}
.doc-legal p { margin: 0 0 4px; }
.doc-legal-h {
    font-weight: 700;
    text-align: center;
    margin: 10px 0 5px;
}
.doc-signatures {
    margin-top: 26px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.doc-sig-block {
    width: 47%;
    font-size: 10pt;
    line-height: 1.55;
    padding: 14px 0;
    border-top: 1px solid #000;
}
.doc-sig-block strong {
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 10pt;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}
.doc-sig-line {
    border-bottom: 1px solid #000;
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    font-size: 8.5pt;
    padding-bottom: 2px;
    color: #777;
    font-family: 'Inter', sans-serif;
}
.doc-footer-print {
    margin-top: 18px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 7.5pt;
    color: #888;
    border-top: 0.5px solid #999;
    padding-top: 6px;
    letter-spacing: 0.3px;
}
.doc-footer-print strong { color: #000; }
/* Финальный блок (подписи + футер) не разрываем: футер не должен
   уезжать на отдельную почти пустую страницу */
.doc-end { page-break-inside: avoid; break-inside: avoid; }

@media print {
    /* Убиваем ВСЕ focus/outline/box-shadow/selection — в PDF ничего не должно лезть */
    *, *::before, *::after,
    *:focus, *:focus-visible, *:focus-within {
        outline: none !important;
        box-shadow: none !important;
    }
    ::selection { background: transparent !important; color: inherit !important; }
    ::-moz-selection { background: transparent !important; color: inherit !important; }

    /* Скрываем интерфейс через display:none — visibility:hidden оставлял
       пустые страницы перед документом */
    body > *:not(#document-modal) { display: none !important; }
    /* Разворачиваем модалку в обычный поток: fixed повторяется на каждой
       странице, а overflow/max-height обрезают всё после первой */
    #document-modal.modal-overlay {
        position: static;
        display: block;
        padding: 0;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    #print-modal-container {
        width: 100%; margin: 0; padding: 0; background: #fff;
        max-width: none; max-height: none;
        display: block;
        border: none;
        border-radius: 0;
        transform: none;
        overflow: visible;
    }
    .modal-header, .modal-footer { display: none !important; }
    #document-modal .modal-body { overflow: visible; padding: 0; background: none; }
    .doc-preview-area { background: none; padding: 0; max-height: none; overflow: visible; display: block; }
    .a4-page { box-shadow: none; width: 100%; min-height: auto; padding: 0; overflow: visible; }
}

/* =========================================================
   13. Toasts
   ========================================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
}
.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    font-size: 13px;
    font-weight: 500;
    animation: slideInRight 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast i { font-size: 18px; flex-shrink: 0; color: var(--emerald); }
.toast-error { border-color: var(--accent); }
.toast-error i { color: var(--accent); }
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   14. Mobile sidebar
   ========================================================= */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 22, 0.5);
    z-index: var(--z-sidebar-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    backdrop-filter: blur(2px);
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

/* =========================================================
   15. Responsive
   ========================================================= */
@media (max-width: 1100px) {
    .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 1024px) {
    #app-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: var(--z-sidebar);
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .main-wrapper { padding: 20px 24px 40px; }
}

/* (Old @media (max-width: 960px) for split-layout removed — no
   longer relevant for the editorial centered layout.) */

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .section-card { padding: 18px 18px; }
    .topbar-title { font-size: 20px; }
    .topbar-actions { gap: 8px; }
    .sync-badge span { display: none; }
    .sync-badge { padding: 5px 9px; }
    .modal-overlay { padding: 16px 12px; }
    .modal-container { max-height: calc(100vh - 32px); border-radius: var(--radius-md); }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 18px; }
    .modal-footer { padding: 12px 18px; }
    .main-wrapper { padding: 16px; }
}

@media (max-width: 640px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .filter-search, .filter-select { width: 100%; min-width: auto; }
    .form-row { grid-template-columns: 1fr; }
    .content-body { padding: 14px; }
    .auth-form { padding: 24px 18px; }
    .doc-preview-area { padding: 14px; }
    .a4-page { padding: 12mm 10mm; }
    .toast-container { left: 14px; right: 14px; bottom: 14px; }
    .toast { min-width: auto; width: 100%; }
}

/* Column Visibility Dropdown */
.col-visibility-dropdown {
    position: relative;
    display: inline-block;
}
.col-visibility-dropdown .dropdown-menu {
    position: absolute;
    top: 100%; right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 200px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.col-visibility-dropdown .dropdown-menu[hidden] {
    display: none;
}
.dropdown-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-faint);
    margin-bottom: 4px;
}
.dropdown-item-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.dropdown-item-check:hover {
    background: var(--bg-deep);
    color: var(--ink);
}
.dropdown-item-check input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent);
}

/* Table Columns Visibility Classes */
.custom-table.hide-col-date th:nth-child(2),
.custom-table.hide-col-date td:nth-child(2) {
    display: none;
}
.custom-table.hide-col-phone th:nth-child(4),
.custom-table.hide-col-phone td:nth-child(4) {
    display: none;
}
.custom-table.hide-col-deceased th:nth-child(5),
.custom-table.hide-col-deceased td:nth-child(5) {
    display: none;
}
.custom-table.hide-col-advance th:nth-child(7),
.custom-table.hide-col-advance td:nth-child(7) {
    display: none;
}
.custom-table.hide-col-remaining th:nth-child(8),
.custom-table.hide-col-remaining td:nth-child(8) {
    display: none;
}
.custom-table.hide-col-profit th:nth-child(9),
.custom-table.hide-col-profit td:nth-child(9) {
    display: none;
}
.custom-table.hide-col-docs th:nth-child(12),
.custom-table.hide-col-docs td:nth-child(12) {
    display: none;
}
.custom-table.hide-col-agent th:nth-child(10),
.custom-table.hide-col-agent td:nth-child(10) {
    display: none;
}

/* Price Table Visibility Classes */
.price-table.hide-col-cat th:nth-child(3),
.price-table.hide-col-cat td:nth-child(3) {
    display: none;
}
.price-table.hide-col-unit th:nth-child(4),
.price-table.hide-col-unit td:nth-child(4) {
    display: none;
}
.price-table.hide-col-cost th:nth-child(5),
.price-table.hide-col-cost td:nth-child(5) {
    display: none;
}
.price-table.hide-col-margin th:nth-child(7),
.price-table.hide-col-margin td:nth-child(7) {
    display: none;
}

/* Clients Table Visibility Classes */
.clients-table.hide-col-email th:nth-child(3),
.clients-table.hide-col-email td:nth-child(3) {
    display: none;
}
.clients-table.hide-col-cat th:nth-child(4),
.clients-table.hide-col-cat td:nth-child(4) {
    display: none;
}
.clients-table.hide-col-date th:nth-child(5),
.clients-table.hide-col-date td:nth-child(5) {
    display: none;
}
.clients-table.hide-col-contracts th:nth-child(6),
.clients-table.hide-col-contracts td:nth-child(6) {
    display: none;
}
.clients-table.hide-col-reminder th:nth-child(8),
.clients-table.hide-col-reminder td:nth-child(8) {
    display: none;
}
.clients-table.hide-col-agent th:nth-child(7),
.clients-table.hide-col-agent td:nth-child(7) {
    display: none;
}

/* Monuments Table Visibility Classes */
.monuments-table.hide-col-date th:nth-child(2),
.monuments-table.hide-col-date td:nth-child(2) {
    display: none;
}
.monuments-table.hide-col-deadline th:nth-child(3),
.monuments-table.hide-col-deadline td:nth-child(3) {
    display: none;
}
.monuments-table.hide-col-phone th:nth-child(5),
.monuments-table.hide-col-phone td:nth-child(5) {
    display: none;
}
.monuments-table.hide-col-cemetery th:nth-child(6),
.monuments-table.hide-col-cemetery td:nth-child(6) {
    display: none;
}
.monuments-table.hide-col-price th:nth-child(8),
.monuments-table.hide-col-price td:nth-child(8) {
    display: none;
}
.monuments-table.hide-col-ritual th:nth-child(9),
.monuments-table.hide-col-ritual td:nth-child(9) {
    display: none;
}
.monuments-table.hide-col-done th:nth-child(10),
.monuments-table.hide-col-done td:nth-child(10) {
    display: none;
}

/* Custom Select Menu */
.custom-select-container {
    position: relative;
    display: inline-block;
    width: 100%;
}
.custom-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.custom-select-btn:hover {
    border-color: var(--accent-soft);
}
.custom-select-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(188, 71, 38, 0.15);
}
.custom-select-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-deep);
}
.custom-select-btn i {
    font-size: 18px;
    color: var(--ink-faint);
    transition: transform 0.2s ease;
}
.custom-select-container.open .custom-select-btn i {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 120;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.custom-select-options[hidden] {
    display: none;
}

/* Items Picker (выбор позиций в договор) */
.items-picker-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 340px;
    overflow-y: auto;
}
.items-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}
.items-picker-row:hover {
    background: var(--bg-deep);
}
.items-picker-row:has(input:checked) {
    background: var(--accent-light);
}
.items-picker-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.items-picker-name {
    flex: 1;
    font-size: 14px;
    color: var(--ink);
}
.items-picker-cat {
    font-size: 12px;
    color: var(--ink-faint);
}
.items-picker-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}
.items-picker-empty {
    text-align: center;
    padding: 24px;
    font-size: 13px;
    color: var(--ink-faint);
}

/* Выпадашка вверх, когда снизу нет места */
.custom-select-container.dropup .custom-select-options,
.custom-date-container.dropup .custom-date-popup {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}

/* Custom Date Picker */
.custom-date-container {
    position: relative;
    display: inline-block;
    width: 100%;
}
.custom-date-popup {
    position: absolute;
    top: 100%; left: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 120;
    padding: 12px;
    width: 280px;
}
.custom-date-popup[hidden] {
    display: none;
}
.custom-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.custom-date-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.custom-date-nav {
    display: flex;
    gap: 4px;
}
.custom-date-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.custom-date-nav button:hover {
    background: var(--bg-deep);
    color: var(--ink);
}
.custom-date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.custom-date-weekday {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-faint);
    text-align: center;
    padding: 4px 0;
    text-transform: uppercase;
}
.custom-date-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 13px;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.custom-date-day:hover {
    background: var(--bg-deep);
    color: var(--ink);
}
.custom-date-day.muted {
    color: var(--ink-faint);
    opacity: 0.5;
}
.custom-date-day.today {
    border: 1px solid var(--accent-soft);
}
.custom-date-day.selected {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.custom-date-day.selected:hover {
    background: var(--accent);
    color: #fff;
}
.custom-date-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.custom-date-footer button {
    background: transparent;
    border: none;
    padding: 4px 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--accent);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.custom-date-footer button:hover {
    background: var(--accent-light);
}

/* Поле ручного ввода даты */
.custom-date-field {
    cursor: text;
}
.custom-date-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(188, 71, 38, 0.15);
}
.custom-date-input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--ink);
    outline: none;
}
.custom-date-input::placeholder {
    color: var(--ink-faint);
}
.custom-date-field i {
    cursor: pointer;
    color: var(--ink-faint);
    transition: color 0.15s ease;
}
.custom-date-field i:hover {
    color: var(--ink);
}

/* Кликабельный год в заголовке календаря */
.custom-date-year-link {
    padding: 0 4px;
    margin: 0 -4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.custom-date-year-link:hover {
    background: var(--bg-deep);
    color: var(--accent);
}

/* Сетка выбора года */
.custom-date-year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}
.custom-date-year {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    font-size: 13px;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.custom-date-year:hover {
    background: var(--bg-deep);
    color: var(--ink);
}
.custom-date-year.today {
    border: 1px solid var(--accent-soft);
}
.custom-date-year.selected {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.custom-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.custom-option:hover {
    background: var(--bg-deep);
    color: var(--ink);
}
.custom-option.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* Clickable Dashboard Mini-Stats */
.dash-mini-stat {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.dash-mini-stat[onclick]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-soft);
}

/* Table Thumbnail Cards */
.price-thumb-img, .monument-thumb-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.price-thumb-cell, .monument-thumb-cell {
    transition: opacity 0.2s ease;
}
.price-thumb-cell:hover .price-thumb-img,
.monument-thumb-cell:hover .monument-thumb-img {
    transform: scale(1.1) translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-soft);
}

/* Центрирование кастомного диалога удаления */
#confirm-modal {
    align-items: center;
}
