/* Pixxelflow Invoices — design system.
   Brand colours come from Config\Brand via --brand / --brand-dark set in common/head.php. */

:root {
    --brand-600: color-mix(in srgb, var(--brand) 82%, #000);
    --brand-700: color-mix(in srgb, var(--brand) 65%, #000);
    --brand-50: color-mix(in srgb, var(--brand) 8%, #fff);
    --brand-100: color-mix(in srgb, var(--brand) 16%, #fff);
    --ink: #0f1512;
    --ink-2: #3a4540;
    --muted: #6b7671;
    --subtle: #98a29d;
    --line: #e6eae8;
    --line-2: #eff2f0;
    --bg: #f4f6f5;
    --card: #ffffff;
    --head-bg: color-mix(in srgb, var(--brand) 12%, #0b120e);
    --head-text: #a9b8b0;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 21, 18, .04), 0 1px 3px rgba(15, 21, 18, .05);
    --shadow-md: 0 6px 16px rgba(15, 21, 18, .06), 0 1px 3px rgba(15, 21, 18, .05);
    --shadow-lg: 0 24px 60px rgba(15, 21, 18, .14);
    --sidebar-w: 260px;
    --sidebar-bg: #0c110e;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    letter-spacing: -.005em;
}

a { color: var(--brand-600); }
.text-brand { color: var(--brand-600) !important; }
.text-muted { color: var(--muted) !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.fw-semibold { font-weight: 600 !important; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ---------- App shell ---------- */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background:
        radial-gradient(140% 45% at 0% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
        linear-gradient(180deg, #0e1511 0%, #0a0f0c 100%);
    color: #c7d0cb;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease, width .2s ease;
    border-right: 1px solid rgba(255, 255, 255, .05);
}
.app-sidebar .brand { display: flex; align-items: center; gap: 8px; padding: 22px 14px 16px 24px; min-height: 74px; }
.brand-logo { display: flex; align-items: center; min-width: 0; }
.brand-logo .logo-full { height: 30px; }
.brand-logo .logo-mark { height: 32px; display: none; }
.app-sidebar .sidebar-toggle { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; color: #6f7c75; font-size: .85rem; }
.app-sidebar .sidebar-toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.app-sidebar nav { padding: 0 14px 14px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .1) transparent; }
.app-sidebar .nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #56625c;
    padding: 18px 10px 8px;
    font-weight: 600;
}
.app-sidebar .nav-group::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .06); }

.app-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px 5px 5px;
    margin: 2px 0;
    color: #a9b4ae;
    border-radius: 12px;
    font-weight: 500;
    font-size: .92rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.app-sidebar .nav-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 1rem;
    color: #7f8c85;
    transition: background .15s, color .15s, box-shadow .15s;
}
.app-sidebar .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, .045); color: #fff; }
.app-sidebar .nav-link:hover .nav-icon { background: rgba(255, 255, 255, .06); color: #fff; }
.app-sidebar .nav-link.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 22%, transparent), color-mix(in srgb, var(--brand) 4%, transparent));
    color: #fff;
    font-weight: 600;
}
.app-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -14px; top: 9px; bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--brand);
    box-shadow: 0 0 14px var(--brand);
}
.app-sidebar .nav-link.active .nav-icon {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--brand) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.app-sidebar .nav-link .count {
    font-size: .7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .08);
    color: #d6dfda;
    border-radius: 999px;
    padding: 1px 8px;
    line-height: 1.5;
}
.app-sidebar .nav-link.active .count { background: rgba(255, 255, 255, .18); color: #fff; }
.app-sidebar .nav-link .count.alert-count { background: #dc2626; color: #fff; }

/* "To collect" card */
.sidebar-stat {
    display: block;
    margin: 0 14px 10px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    background:
        radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
        rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
    transition: border-color .15s;
}
.sidebar-stat:hover { color: #fff; border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.sidebar-stat .k { display: flex; justify-content: space-between; align-items: center; font-size: .68rem; color: #93a59b; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-stat .k i { font-size: .8rem; transition: transform .15s; }
.sidebar-stat:hover .k i { transform: translate(2px, -2px); color: var(--brand); }
.sidebar-stat .v { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; margin: 3px 0 5px; font-variant-numeric: tabular-nums; }
.sidebar-stat .f { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: #8fa198; }
.sidebar-stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.sidebar-stat .f.late { color: #fca5a5; }
.sidebar-stat .f.late .dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .22); }

@media (max-height: 760px) { .sidebar-stat { display: none; } }

/* Account menu */
.sidebar-user { margin: 0 14px 16px; position: relative; }
.sidebar-user .user-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .06);
    color: inherit;
    text-align: left;
    transition: background .15s, border-color .15s;
}
.sidebar-user .user-btn:hover, .sidebar-user .user-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); }
.sidebar-user .who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sidebar-user .who .name { color: #fff; font-weight: 500; font-size: .9rem; line-height: 1.25; }
.sidebar-user .who .email { font-size: .74rem; color: #7f8a85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .chev { color: #6f7c75; }
.sidebar-user .dropdown-menu { width: 100%; min-width: 220px; margin-bottom: 8px !important; }
.nav-tip .tooltip-inner { font-weight: 500; padding: 6px 10px; border-radius: 8px; }

.avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
}
.avatar.soft { background: var(--brand-50); color: var(--brand-700); }

/* Collapsed sidebar (desktop): icons only, labels as tooltips. */
@media (min-width: 992px) {
    body.sidebar-collapsed { --sidebar-w: 84px; }
    body.sidebar-collapsed .app-sidebar .brand { flex-direction: column; gap: 10px; padding: 20px 0 6px; }
    body.sidebar-collapsed .brand-logo .logo-full { display: none; }
    body.sidebar-collapsed .brand-logo .logo-mark { display: block; }
    body.sidebar-collapsed .app-sidebar .sidebar-toggle { margin: 0; }
    body.sidebar-collapsed .app-sidebar .sidebar-toggle i { transform: rotate(180deg); }
    body.sidebar-collapsed .app-sidebar .nav-group { padding: 12px 6px 6px; }
    body.sidebar-collapsed .app-sidebar .nav-group span { display: none; }
    body.sidebar-collapsed .app-sidebar .nav-link { justify-content: center; padding: 5px; }
    body.sidebar-collapsed .app-sidebar .nav-label { display: none; }
    body.sidebar-collapsed .app-sidebar .nav-link .count { position: absolute; top: 0; right: 4px; padding: 0 5px; font-size: .6rem; min-width: 17px; text-align: center; }
    body.sidebar-collapsed .sidebar-stat { display: none; }
    body.sidebar-collapsed .sidebar-user .user-btn { justify-content: center; padding: 8px; }
    body.sidebar-collapsed .sidebar-user .who, body.sidebar-collapsed .sidebar-user .chev { display: none; }
    body.sidebar-collapsed .sidebar-user .dropdown-menu { width: 230px; }
}

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 32px;
    background: rgba(244, 246, 245, .8);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.app-topbar .crumb { flex: 1; min-width: 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-topbar .crumb i { font-size: .7rem; color: var(--subtle); }
.app-topbar .crumb strong { color: var(--ink); font-weight: 600; }
.app-topbar .today { color: var(--muted); font-size: .85rem; }

.app-content { padding: 30px 32px 56px; flex: 1; max-width: 1400px; width: 100%; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    body.nav-open .app-sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1035; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 0 16px; }
    .app-content { padding: 20px 16px 40px; }
}

/* ---------- Page header ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}
.page-head h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: .94rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back-link { color: var(--muted); text-decoration: none; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }

/* ---------- Cards ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-2);
}
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head .hint { color: var(--muted); font-size: .85rem; }
.card-body-x { padding: 22px; }
.section-title { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 14px; }
.head-icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: inline-grid; place-items: center;
    background: var(--brand-50); color: var(--brand-600); font-size: .95rem;
}

/* KPI tiles */
.kpi { padding: 20px 22px; height: 100%; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.kpi .kpi-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.15rem;
}
.kpi .kpi-icon.warn { background: #fff7ed; color: var(--warning); }
.kpi .kpi-icon.danger { background: #fef2f2; color: var(--danger); }
.kpi .kpi-icon.info { background: #eff6ff; color: var(--info); }
.kpi .kpi-label { color: var(--muted); font-size: .86rem; font-weight: 500; }
.kpi .kpi-value { font-size: 1.65rem; font-weight: 600; letter-spacing: -.025em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .kpi-foot { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.kpi.kpi-dark {
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 38%, transparent) 0%, transparent 55%),
        var(--sidebar-bg);
    color: #fff;
    border-color: transparent;
}
.kpi.kpi-dark .kpi-label, .kpi.kpi-dark .kpi-foot { color: #a9b4af; }
.kpi.kpi-dark .kpi-icon { background: rgba(255, 255, 255, .08); color: var(--brand); }
.trend {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .76rem; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
}
.trend.up { background: #e8f8ec; color: #15803d; }
.trend.down { background: #fdecec; color: #b91c1c; }
.trend.flat { background: var(--line-2); color: var(--muted); }
.kpi-dark .trend.up { background: rgba(57, 181, 74, .2); color: #7ee08b; }
.kpi-dark .trend.down { background: rgba(220, 38, 38, .2); color: #fca5a5; }
.kpi-dark .trend.flat { background: rgba(255, 255, 255, .08); color: #a9b4af; }

.delta-up { color: #15803d; }
.delta-down { color: var(--danger); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 200px; }

/* Lists inside cards */
.list-x { list-style: none; margin: 0; padding: 0; }
.list-x li { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line-2); }
.list-x li:last-child { border-bottom: 0; }
.list-x .grow { flex: 1; min-width: 0; }
.list-x .title { font-weight: 500; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-x a.title:hover { color: var(--brand-600); }
.list-x .meta { font-size: .8rem; color: var(--muted); }
.list-x .amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 14px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff;
    color: var(--ink); text-decoration: none; font-weight: 500; font-size: .9rem;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick-action:hover { border-color: var(--brand-100); box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--ink); }
.quick-action i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex-shrink: 0; }

/* ---------- Tables ---------- */

.table { margin: 0; --bs-table-hover-bg: #f6faf7; --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 14px 16px; border-bottom-color: var(--line-2); }
.table thead th,
table.table.dataTable > thead > tr > th {
    background: var(--head-bg) !important;
    box-shadow: none !important;
    color: var(--head-text) !important;
    font-size: .69rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    border-bottom: 0;
    white-space: nowrap;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
}
.table thead th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table thead th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.table-wrap { padding: 14px 14px 6px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td .primary { font-weight: 500; color: var(--ink); text-decoration: none; }
.table td a.primary:hover { color: var(--brand-600); }
.table td .secondary { font-size: .82rem; color: var(--muted); }
.table tfoot td { font-weight: 600; background: var(--brand-50); border-top: 1px solid var(--line); }
.table-tight > :not(caption) > * > * { padding: 10px 8px; font-size: .88rem; }
.table-plain thead th { background: #f7f9f8 !important; color: var(--muted) !important; }
.table-plain thead th:first-child, .table-plain thead th:last-child { border-radius: 0; }

/* ---------- Data tables ---------- */

.dt-container > .row { margin: 0; padding: 14px 18px; align-items: center; row-gap: 10px; }
.dt-container > .row.dt-layout-table { padding: 0 14px; }
.dt-container > .row > div { padding: 0; }
.dt-container .dt-layout-table > div { overflow-x: auto; }
.dt-container .dt-layout-start, .dt-container .dt-layout-end { gap: 10px 16px; flex-wrap: wrap; align-items: center; }
/* Footer band: rows per page + count on the left, pages on the right */
.dt-container > .row:last-child {
    margin-top: 8px;
    padding: 11px 18px;
    border-top: 1px solid var(--line-2);
    background: #fbfcfb;
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

/* Search */
.dt-container .dt-search { position: relative; }
.dt-container .dt-search input {
    margin-left: 0 !important;
    min-width: 300px;
    padding: .55rem 2.4rem .55rem 2.3rem;
    border-radius: 11px;
    border-color: transparent;
    background: #f3f6f4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2398a29d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10'/%3E%3C/svg%3E") no-repeat 13px center;
    background-size: 14px;
}
.dt-container .dt-search input:hover { background-color: #eef2f0; border-color: transparent; }
.dt-container .dt-search input:focus { background-color: #fff; border-color: var(--brand); }
.dt-kbd {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
    font-family: inherit; font-size: .72rem; font-weight: 600; line-height: 1.5;
    padding: 0 7px; border-radius: 6px;
    background: #fff; color: var(--muted);
    border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line);
    pointer-events: none;
}
.dt-search input:focus ~ .dt-kbd, .dt-search input:not(:placeholder-shown) ~ .dt-kbd { display: none; }

/* Toolbar buttons (Columns / Export) */
.dt-container .dt-buttons { display: inline-flex; gap: 8px; }
.dt-container .dt-buttons > .btn,
.dt-container .dt-buttons .btn-group > .btn {
    margin: 0 !important;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 10px !important;
    padding: .5rem .85rem;
    font-size: .86rem;
    box-shadow: var(--shadow-sm);
}
.dt-container .dt-buttons .btn:hover, .dt-container .dt-buttons .btn[aria-expanded="true"] { border-color: #cfd6d2; color: var(--ink); background: #f7f9f8; }
.dt-container .dt-buttons .btn i { color: var(--muted); }
div.dt-button-collection {
    border-radius: 12px !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-md) !important;
    padding: 6px !important;
    min-width: 190px;
}
div.dt-button-collection .dropdown-item, div.dt-button-collection .dt-button {
    border-radius: 8px; padding: 8px 12px; font-size: .9rem; display: flex; gap: 10px; align-items: center;
}
div.dt-button-collection .dropdown-item:hover { background: var(--brand-50); color: var(--ink); }
div.dt-button-collection .dropdown-item.active, div.dt-button-collection .dropdown-item:active { background: transparent; color: var(--ink); }
div.dt-button-collection .dropdown-item.active:hover { background: var(--brand-50); }
/* Column picker: checkbox look */
div.dt-button-collection .buttons-columnVisibility::before {
    content: ''; width: 17px; height: 17px; border-radius: 5px; flex-shrink: 0;
    border: 1.5px solid #cdd5d1; background: #fff;
}
div.dt-button-collection .buttons-columnVisibility.dt-button-active { padding-right: 12px; }
div.dt-button-collection .buttons-columnVisibility.dt-button-active::after { display: none; }
div.dt-button-collection .buttons-columnVisibility.dt-button-active::before {
    border-color: var(--brand);
    background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0'/%3E%3C/svg%3E") center / 12px no-repeat;
}
div.dt-button-collection .buttons-columnVisibility:not(.dt-button-active) { color: var(--muted); }
div.dt-button-info {
    border-radius: 14px !important; border: 0 !important; box-shadow: var(--shadow-lg) !important;
    font-family: 'Outfit', sans-serif;
}
div.dt-button-info h2 { font-size: 1rem !important; background: transparent !important; border: 0 !important; }

/* Footer: rows per page, count, pages */
.dt-container .dt-length { display: flex; align-items: center; }
.dt-container .dt-length label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; margin: 0; }
.dt-container .dt-length select {
    width: auto; display: inline-block; min-width: 0;
    padding: .45rem 1.9rem .45rem .75rem !important;
    background-position: right .55rem center;
    border-radius: 8px; font-size: .85rem; font-weight: 500;
}
.dt-container .dt-info { color: var(--muted); font-size: .85rem; padding: 0; }
.dt-container .dt-info strong { color: var(--ink); font-weight: 600; }
.dt-container .dt-length + .dt-buttons { padding-left: 14px; border-left: 1px solid var(--line); }
.dt-container .pagination { margin: 0; gap: 4px; }
.dt-container .page-link {
    border: 0;
    border-radius: 9px !important;
    color: var(--ink-2);
    background: transparent;
    min-width: 34px; height: 34px;
    display: grid; place-items: center;
    padding: 0 10px;
    font-size: .86rem;
    font-weight: 500;
    box-shadow: none !important;
}
.dt-container .page-link:hover { background: var(--brand-50); color: var(--brand-700); }
.dt-container .page-item:first-child .page-link, .dt-container .page-item:last-child .page-link { border: 1px solid var(--line); background: #fff; }
.dt-container .page-item.active .page-link {
    background: var(--brand); color: #fff;
    box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--brand) 70%, transparent) !important;
}
.dt-container .page-item.disabled .page-link { color: #c3cbc7; background: transparent; }
.dt-container .page-item.disabled:first-child .page-link, .dt-container .page-item.disabled:last-child .page-link { background: #fafbfa; border-color: var(--line-2); }
.dt-container .page-link i { font-size: .8rem; }

/* Header: quiet sort arrows that turn brand-green when active */
.dt-container table.dataTable { margin: 0 !important; border-collapse: separate !important; border-spacing: 0; }
table.dataTable > thead > tr > th.dt-ordering-asc,
table.dataTable > thead > tr > th.dt-ordering-desc,
table.dataTable thead > tr > th.dt-orderable-asc:hover,
table.dataTable thead > tr > th.dt-orderable-desc:hover { color: #fff !important; outline: none !important; }
table.dataTable thead > tr > th span.dt-column-order:before,
table.dataTable thead > tr > th span.dt-column-order:after { opacity: .28 !important; color: #fff; font-size: .7em !important; }
table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after { opacity: 1 !important; color: var(--brand); }
/* Dates read left-to-right like text; only money is right-aligned. */
table.dataTable th.dt-type-date, table.dataTable td.dt-type-date { text-align: left !important; }
table.dataTable th.num, table.dataTable td.num { text-align: right !important; }

/* Body rows */
table.dataTable > tbody > tr > td { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); transition: background-color .12s; }
table.dataTable > tbody > tr > td.sorting_1 { background: #fafcfb; }
table.dataTable > tbody > tr[data-href] { cursor: pointer; }
/* Hover: the whole row becomes a soft green pill with a thin outline, and its main text turns green */
table.dataTable > tbody > tr:hover > td {
    background: color-mix(in srgb, var(--brand) 7%, #fff) !important;
    border-bottom-color: transparent;
    box-shadow: inset 0 1px 0 var(--brand-100), inset 0 -1px 0 var(--brand-100) !important;
}
table.dataTable > tbody > tr:hover > td:first-child { border-radius: 12px 0 0 12px; box-shadow: inset 1px 1px 0 var(--brand-100), inset 0 -1px 0 var(--brand-100) !important; }
table.dataTable > tbody > tr:hover > td:last-child { border-radius: 0 12px 12px 0; box-shadow: inset -1px 1px 0 var(--brand-100), inset 0 -1px 0 var(--brand-100) !important; }
table.dataTable > tbody > tr:hover .primary, table.dataTable > tbody > tr:hover .doc-no { color: var(--brand-700); }
table.dataTable > tbody > tr:has(> td.dt-empty):hover > td { background: transparent !important; box-shadow: none !important; }
.dt-nothing { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 34px 0; color: var(--muted); font-size: .88rem; }
.dt-nothing i { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--line-2); font-size: 1.25rem; margin-bottom: 10px; }
.dt-nothing strong { color: var(--ink); font-weight: 600; font-size: .95rem; }

.doc-cell { display: block; text-decoration: none; color: var(--ink); }
.doc-cell:hover .doc-no { color: var(--brand-600); }
.doc-no { display: block; font-weight: 600; letter-spacing: -.01em; transition: color .15s; white-space: nowrap; }
.doc-date { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; }

.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: .74rem; }
.min-w-0 { min-width: 0; }
.amount-strong { font-weight: 600; font-size: .98rem; }
.settled { color: #15803d; font-weight: 500; font-size: .86rem; white-space: nowrap; }
.due-hint { display: block; font-size: .76rem; color: var(--muted); }
.due-hint.soon { color: var(--warning); font-weight: 500; }
.due-hint.late { color: var(--danger); font-weight: 500; }

/* Row actions: a quick action pill + a segmented icon group */
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.row-actions form { margin: 0; }
/* Each action is its own button; hover tints it with the action's colour */
.row-actions .act {
    width: 34px; height: 34px;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: .92rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.row-actions .act:hover { transform: translateY(-1px); }
.row-actions .act-view:hover { background: #eff6ff; border-color: #cfe0ff; color: #2563eb; }
.row-actions .act-pdf:hover  { background: #fff7ed; border-color: #fddcb4; color: #d97706; }
.row-actions .act-edit:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.row-actions .act.danger:hover { background: #fef2f2; border-color: #fbd5d5; color: var(--danger); }
.act-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--brand-100);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: .8rem; font-weight: 600;
    white-space: nowrap; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.act-pill:hover {
    background: var(--brand); border-color: var(--brand); color: #fff;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand) 80%, transparent);
}

@media (max-width: 767.98px) {
    /* Search and buttons share one row; buttons go icon-only */
    .dt-container > .row:first-child { gap: 10px; padding: 12px; }
    .dt-container > .row:first-child > .dt-layout-end { order: -1; display: flex; width: 100%; margin: 0 !important; }
    .dt-container > .row:first-child > .dt-layout-start { display: flex; flex-wrap: nowrap; justify-content: space-between; width: 100%; margin: 0 !important; }
    .dt-container .dt-search { flex: 1 1 auto; min-width: 0; float: none !important; }
    .dt-container .dt-search input { width: 100% !important; min-width: 0; margin: 0 !important; }
    .dt-kbd { display: none; }
    .dt-container div.dt-buttons { width: auto !important; margin: 0 !important; text-align: left; }
    .dt-container .dt-length + .dt-buttons { padding-left: 0; border-left: 0; }
    .dt-container .dt-buttons { float: none !important; gap: 6px; }
    .dt-container .dt-buttons .btn { padding: .5rem .65rem; }
    .dt-container .dt-buttons .btn .btn-label, .dt-container .dt-buttons .btn::after { display: none; }
    .dt-container .dt-buttons .btn i { color: var(--ink-2); font-size: 1rem; }
    .dt-container .dt-paging { width: 100%; }
    .dt-container .dt-paging nav, .dt-container .dt-paging .pagination { display: flex; justify-content: center; }
    .dt-container > .row.dt-layout-table { padding: 0 8px; }
    .dt-container > .row:last-child > div { width: 100%; display: flex !important; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin: 0 !important; }
    /* Keep the first column in view while the rest scrolls sideways */
    table.dataTable > tbody > tr > td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 8px 0 10px -8px rgba(15, 21, 18, .18); }
    table.dataTable > thead > tr > th:first-child { position: sticky; left: 0; z-index: 2; }
}

/* ---------- Badges ---------- */

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-paid      { background: #e8f8ec; color: #15803d; }
.status-unpaid    { background: #fff4e5; color: #b45309; }
.status-partial   { background: #eaf1ff; color: #1d4ed8; }
.status-overdue   { background: #fdecec; color: #b91c1c; }
.status-cancelled { background: #f1f3f2; color: #6b7280; }
.status-open      { background: #eaf1ff; color: #1d4ed8; }
.status-converted { background: #e8f8ec; color: #15803d; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: .86rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s;
}
.chip:hover { border-color: #cfd6d2; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: .74rem; padding: 0 7px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.chip.active .n { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- Buttons ---------- */

.btn { border-radius: var(--radius-sm); font-weight: 500; padding: .58rem 1.05rem; font-size: .92rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm { padding: .38rem .75rem; font-size: .84rem; border-radius: 9px; }
.btn-lg { padding: .78rem 1.3rem; font-size: 1rem; }
.btn-link { display: inline; }
.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-dark-x {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #26302b;
    --bs-btn-hover-border-color: #26302b;
    --bs-btn-active-bg: #26302b;
    --bs-btn-active-color: #fff;
}
.btn-light-x {
    --bs-btn-color: var(--ink-2);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: #f7f9f8;
    --bs-btn-hover-border-color: #d5dcd8;
    --bs-btn-active-bg: #f0f3f1;
    box-shadow: var(--shadow-sm);
}
.btn-outline-brand {
    --bs-btn-color: var(--brand-700);
    --bs-btn-border-color: var(--brand-100);
    --bs-btn-bg: var(--brand-50);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
}
.btn-icon {
    width: 34px; height: 34px;
    display: inline-grid; place-items: center;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    text-decoration: none;
}
.btn-icon:hover { background: var(--line-2); color: var(--ink); }
.btn-icon.danger:hover { background: #fef2f2; color: var(--danger); }
.btn-icon.success:hover { background: #e8f8ec; color: #15803d; }

/* ---------- Forms ---------- */

.form-label { font-size: .86rem; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.form-label.required::after { content: ' *'; color: var(--danger); font-weight: 600; }
.req { color: var(--danger); }
.form-text { color: var(--subtle); font-size: .8rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #dde3e0;
    padding: .64rem .9rem;
    font-size: .93rem;
    color: var(--ink);
    background-color: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:hover, .form-select:hover { border-color: #c9d1cd; }
.form-control-sm, .form-select-sm { padding: .44rem .7rem; font-size: .88rem; border-radius: 9px; }
.form-control::placeholder { color: #a7b0ab; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}
.input-group-text { background: #f6f8f7; border-color: #dde3e0; color: var(--muted); border-radius: var(--radius-sm); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); border-color: var(--brand); }

/* Invoice item editor */
#items-table td { vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line-2); }
#items-table th { padding: 12px 10px; }
#items-table .col-desc { min-width: 280px; }
#items-table input, #items-table select { min-width: 70px; }
#items-table .line-amount { font-weight: 600; padding-top: 20px; }
.totals-table td { padding: 7px 0; font-size: .93rem; }
.totals-table td:first-child { color: var(--muted); }
.totals-table .grand td {
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
}
.sticky-summary { position: sticky; top: 86px; }

/* ---------- Alerts ---------- */

.alert { border-radius: 14px; border: 1px solid transparent; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert > i { font-size: 1.1rem; line-height: 1.3; }
.alert-success { background: #ecfbef; color: #14532d; border-color: #c9efd2; }
.alert-danger { background: #fef2f2; color: #7f1d1d; border-color: #fbd5d5; }
.alert-warning { background: #fffaeb; color: #78350f; border-color: #fde9b8; }
.alert .btn-close { margin-left: auto; padding: .4rem; }

/* ---------- Empty states ---------- */

.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-state .icon {
    width: 60px; height: 60px;
    border-radius: 18px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.6rem;
}
.empty-state h2, .empty-state h3 { font-size: 1.05rem; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ---------- Invoice view ---------- */

.paper {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
    padding: 36px;
}
@media (max-width: 767.98px) { .paper { padding: 16px; } }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex-shrink: 0; }

.qr-card { text-align: center; }
.qr-card img { width: 170px; height: 170px; border-radius: 14px; border: 1px solid var(--line); padding: 8px; background: #fff; }

.stat-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: .93rem; }
.stat-row + .stat-row { border-top: 1px dashed var(--line-2); }
.stat-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.modal-content { border-radius: 18px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--line-2); padding: 14px 22px; }

.dropdown-menu { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-md); padding: 6px; font-size: .92rem; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
.dropdown-item i { color: var(--muted); }
.dropdown-item:active { background: var(--brand); }

.progress { background: var(--line-2); }

/* ---------- Login ---------- */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60% 60% at 85% 10%, color-mix(in srgb, var(--brand) 45%, transparent) 0%, transparent 60%),
        radial-gradient(50% 50% at 10% 100%, color-mix(in srgb, var(--brand) 25%, transparent) 0%, transparent 60%),
        var(--sidebar-bg);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
    pointer-events: none;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-art > img { align-self: flex-start; height: 34px; width: auto; }
.auth-art h2 { font-size: 2.4rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; max-width: 460px; }
.auth-art h2 span { color: var(--brand); }
.auth-art p { color: #a9b4af; max-width: 420px; font-size: 1.02rem; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #d4dcd8; }
.auth-points i { color: var(--brand); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.password-field { position: relative; }
.password-field .toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
@media (max-width: 899.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

/* ---------- Print ---------- */

@media print {
    .no-print, .app-sidebar, .app-topbar { display: none !important; }
    .app-main { margin: 0; }
    .app-content { padding: 0; max-width: none; }
    body { background: #fff; }
    .paper { box-shadow: none; border: 0; padding: 0; }
}

/* ---------- List pages: summary strip, filters, refined data table ---------- */

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 991.98px) { .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.summary-tile .kpi-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--brand-50); color: var(--brand-600); font-size: 1.1rem;
}
.summary-tile .kpi-icon.info { background: #eff6ff; color: var(--info); }
.summary-tile .kpi-icon.warn { background: #fff7ed; color: var(--warning); }
.summary-tile .kpi-icon.danger { background: #fef2f2; color: var(--danger); }
.summary-tile .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.summary-tile .value { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-2);
}
/* Status chips carry the same colour as their status badge */
.chip.tone-unpaid    { --tone: #d97706; --tone-bg: #fff4e5; }
.chip.tone-partial   { --tone: #2563eb; --tone-bg: #eaf1ff; }
.chip.tone-open      { --tone: #2563eb; --tone-bg: #eaf1ff; }
.chip.tone-overdue   { --tone: #dc2626; --tone-bg: #fdecec; }
.chip.tone-paid      { --tone: #16a34a; --tone-bg: #e8f8ec; }
.chip.tone-converted { --tone: #16a34a; --tone-bg: #e8f8ec; }
.chip.tone-cancelled { --tone: #6b7280; --tone-bg: #f1f3f2; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex-shrink: 0; }
.chip[class*="tone-"] .n { background: var(--tone-bg); color: var(--tone); font-weight: 600; }
.chip[class*="tone-"]:hover { border-color: color-mix(in srgb, var(--tone) 40%, transparent); background: var(--tone-bg); color: var(--ink); }
.chip[class*="tone-"].active {
    background: var(--tone); border-color: var(--tone); color: #fff;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--tone) 80%, transparent);
}
.chip[class*="tone-"].active .dot { background: #fff; }
.chip[class*="tone-"].active .n { background: rgba(255, 255, 255, .22); color: #fff; }

@media (max-width: 575.98px) {
    .summary-strip { gap: 8px; }
    .summary-tile { padding: 12px; gap: 10px; }
    .summary-tile .kpi-icon { width: 32px; height: 32px; font-size: .95rem; border-radius: 10px; }
    .summary-tile .value { font-size: 1rem; }
    .filter-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .filter-bar::-webkit-scrollbar { display: none; }
}

/* ---------- Validation ---------- */

.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-color: #fffafa; }
.form-control.is-invalid { background-image: none; padding-right: .9rem; }
.form-select.is-invalid:not([multiple]):not([size]) { background-image: var(--bs-form-select-bg-img) !important; background-position: right .75rem center; background-size: 16px 12px; padding-right: 2.25rem; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, .13); }
.input-group:has(.is-invalid) .input-group-text { border-color: var(--danger); background: #fef2f2; color: var(--danger); }
.field-error {
    display: flex; align-items: flex-start; gap: 6px;
    margin-top: 6px;
    color: #b91c1c; font-size: .8rem; font-weight: 500; line-height: 1.35;
    animation: field-error-in .18s ease-out;
}
.field-error i { font-size: .85rem; margin-top: 1px; flex-shrink: 0; }
@keyframes field-error-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
#items-table .field-error { font-size: .74rem; }
form.shake { animation: form-shake .32s ease-in-out; }
@keyframes form-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { form.shake, .field-error { animation: none; } }
button:disabled .spinner-border { margin-right: 2px; }

.card-head .n-chip { padding: 1px 9px; font-size: .78rem; color: var(--muted); background: var(--line-2); border-color: transparent; margin-left: 4px; pointer-events: none; }
