/* =========================================================
   SIP-GAJI — Enterprise interface
   Formal government financial system treatment.
   Loaded after app.css to replace the legacy visual layer.
   ========================================================= */

:root {
    --navy: #0F2742;
    --navy-deep: #0A1B2E;
    --navy-soft: #173A5E;
    --navy-muted: #3E5A78;
    --gold: #B08D57;
    --gold-light: #E9DCC5;
    --gold-dark: #8A6B3D;
    --slate: #64748B;
    --slate-light: #E8EDF3;
    --maroon: #9B3434;
    --maroon-light: #F7E9E9;
    --green: #2F6B4F;
    --green-light: #E8F1EC;

    --teal: var(--navy);
    --teal-deep: var(--navy);
    --teal-dark: var(--navy-soft);
    --teal-light: var(--navy-muted);
    --teal-bg: #EDF2F7;
    --gold-dark-legacy: var(--gold-dark);
    --coral: var(--maroon);
    --coral-dark: #7E2929;
    --coral-light: #B85A5A;
    --sky: #4D6F91;
    --surface: #F3F5F8;
    --card: #FFFFFF;
    --ink: #1B2A3C;
    --ink-soft: #4B5D70;
    --ink-muted: #77869A;
    --line: #DDE4EC;
    --line-strong: #C8D3DF;
    --success: var(--green);
    --error: var(--maroon);
    --silver: #C3CED8;
    --silver-deep: #7C8B9A;
    --bronze: #9A714D;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-round: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 39, 66, 0.05);
    --shadow-md: 0 2px 8px rgba(15, 39, 66, 0.07);
    --shadow-lg: 0 12px 32px rgba(15, 39, 66, 0.14);
    --shadow-card: 0 1px 2px rgba(15, 39, 66, 0.04);
    --shadow-focus: 0 0 0 3px rgba(15, 39, 66, 0.10);
    --shadow-coral-glow: none;
    --shadow-teal-glow: none;
    --shadow-accent-glow: none;
    --shadow-sky-glow: none;
    --bounce: ease;

    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body::before {
    display: none;
}

h1, h2, h3, h4, p {
    margin: 0;
}

h1, h2, h3, h4 {
    color: var(--navy);
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--gold-light);
    color: var(--navy);
}

:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #C5CFDA;
    border: 2px solid #F3F5F8;
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: #F3F5F8;
}

/* =========================================================
   Brand
   ========================================================= */

.brand {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: auto;
    padding: 0;
    isolation: auto;
    color: var(--navy);
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    color: var(--gold);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand-name {
    color: currentColor;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.15;
    white-space: nowrap;
}

.brand-sub {
    color: currentColor;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 1.1px;
    line-height: 1.2;
    opacity: 0.62;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand--xs {
    gap: 7px;
}

.brand--xs .brand-mark {
    width: 27px;
    height: 27px;
}

.brand--xs .brand-name {
    font-size: 14px;
}

.brand--xs .brand-sub {
    display: none;
}

.brand--lg {
    gap: 14px;
}

.brand--lg .brand-mark {
    width: 50px;
    height: 50px;
}

.brand--lg .brand-name {
    font-size: 26px;
    letter-spacing: 0.8px;
}

.brand--lg .brand-sub {
    font-size: 9px;
    letter-spacing: 1.6px;
}

.brand-fan,
.brand-plate,
.brand-ribbon {
    display: none !important;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.1px;
    white-space: nowrap;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover {
    transform: none;
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary,
.btn-gold {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.btn-primary:hover,
.btn-gold:hover {
    background: var(--navy-soft);
    border-color: var(--navy-soft);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    background: #F7F9FB;
    border-color: var(--navy-muted);
    color: var(--navy);
}

.btn-white,
.btn-sky {
    background: #fff;
    border-color: #fff;
    color: var(--navy);
}

.btn-white:hover,
.btn-sky:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--navy);
}

.btn-coral,
.btn-danger {
    background: var(--maroon);
    border-color: var(--maroon);
    color: #fff;
}

.btn-coral:hover,
.btn-danger:hover {
    background: var(--coral-dark);
    border-color: var(--coral-dark);
}

.btn-danger-ghost {
    background: #fff;
    border-color: #E7C9C9;
    color: var(--maroon);
}

.btn-danger-ghost:hover {
    background: var(--maroon-light);
    border-color: var(--maroon);
}

.btn-sm {
    min-height: 31px;
    padding: 0 11px;
    font-size: 11px;
}

.btn-xs {
    min-height: 26px;
    padding: 0 8px;
    font-size: 10.5px;
}

.btn-lg {
    min-height: 44px;
    padding: 0 20px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-label {
    display: inline-flex;
    align-items: center;
}

.btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.btn.is-loading .btn-label {
    display: none;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
}

.btn-ghost.is-loading .btn-spinner,
.btn-danger-ghost.is-loading .btn-spinner {
    border-color: rgba(15, 39, 66, 0.2);
    border-top-color: var(--navy);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
    transition: background 150ms, border-color 150ms, color 150ms;
}

.icon-btn:hover {
    background: #F7F9FB;
    border-color: var(--line-strong);
    color: var(--navy);
}

/* =========================================================
   Form controls
   ========================================================= */

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.field label,
.field-label {
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-transform: uppercase;
}

.input,
.select {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    transition: border-color 150ms, box-shadow 150ms;
}

.input::placeholder {
    color: #9AA7B6;
    font-weight: 400;
}

.input:hover,
.select:hover {
    border-color: #AFBDCC;
}

.input:focus,
.select:focus {
    border-color: var(--navy);
    box-shadow: var(--shadow-focus);
}

.input.is-invalid,
.select.is-invalid {
    border-color: var(--maroon);
    box-shadow: 0 0 0 2px rgba(155, 52, 52, 0.08);
}

.select {
    padding-right: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234B5D70' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

.field-hint {
    color: var(--ink-muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.45;
}

.field-error {
    color: var(--maroon);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.field-error:empty {
    display: none;
}

.form-error-box {
    padding: 10px 12px;
    border: 1px solid #E7C9C9;
    border-left: 3px solid var(--maroon);
    border-radius: var(--radius-sm);
    background: var(--maroon-light);
    color: #7E2929;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.input-wrap {
    position: relative;
}

.input-wrap .input {
    padding-right: 42px;
}

.input-wrap .input.has-trailing {
    padding-right: 46px;
}

.input-icon {
    display: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-muted);
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle.is-active {
    background: #F1F4F8;
    color: var(--navy);
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.45;
    cursor: pointer;
}

.check-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: #fff;
}

.check-row input:checked + .check-box {
    border-color: var(--navy);
    background: var(--navy);
}

.check-row input:checked + .check-box::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.check-row input:focus-visible + .check-box {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.check-row--block {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.form-grid .field--full {
    grid-column: 1 / -1;
}

.form-section-label {
    margin-top: 8px;
    padding: 10px 0 7px;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.form-section-label:first-child {
    margin-top: 0;
}

.money-field {
    position: relative;
    display: flex;
    align-items: center;
}

.money-prefix {
    position: absolute;
    left: 11px;
    z-index: 1;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.money-field .input {
    padding-left: 34px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stepper {
    display: flex;
    align-items: stretch;
}

.stepper .input {
    border-radius: 0;
    text-align: center;
}

.stepper-btn {
    display: grid;
    place-items: center;
    width: 38px;
    min-height: 40px;
    border: 1px solid var(--line-strong);
    background: #F7F9FB;
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 600;
}

.stepper-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: 0;
}

.stepper-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: 0;
}

.stepper-btn:hover {
    background: var(--slate-light);
    color: var(--navy);
}

/* =========================================================
   Badges, avatars, editor
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 21px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-round);
    background: #F3F5F8;
    color: var(--ink-soft);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
    white-space: nowrap;
}

.badge::before {
    display: none;
}

.badge--gold {
    border-color: #DCC8A8;
    background: #F7F2E9;
    color: var(--gold-dark);
}

.badge--sky {
    border-color: #C9D8E7;
    background: #EDF3F9;
    color: #355B7E;
}

.badge--success {
    border-color: #C7DCCF;
    background: var(--green-light);
    color: var(--green);
}

.badge--coral {
    border-color: #E7C9C9;
    background: var(--maroon-light);
    color: var(--maroon);
}

.badge--muted {
    border-color: var(--line);
    background: #F3F5F8;
    color: var(--ink-muted);
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid #CCD7E2;
    border-radius: 50%;
    background: #EAF0F6;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.avatar--gold {
    border-color: #DCC8A8;
    background: #F7F2E9;
    color: var(--gold-dark);
}

.avatar--sm {
    width: 31px;
    height: 31px;
    font-size: 10px;
}

.avatar--lg {
    width: 48px;
    height: 48px;
    font-size: 14px;
}

.avatar--xl {
    width: 64px;
    height: 64px;
    font-size: 18px;
}

.editor-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--navy);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.editor-total span {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.editor-total strong {
    color: var(--navy);
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.editor-total--multi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.editor-total-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 16px;
    border-right: 1px solid var(--line);
}

.editor-total-item:last-child {
    border-right: 0;
}

.editor-total-item.is-net {
    background: #F2F5F9;
}

.editor-total-item.is-net strong {
    font-size: 20px;
}

.editor-total-item span {
    color: var(--ink-muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.editor-total-item strong {
    color: var(--navy);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   App shell
   ========================================================= */

.app-page {
    min-height: 100vh;
    background: var(--surface);
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 90;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 264px;
    padding: 20px 16px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    color: #fff;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transition: transform 220ms ease;
}

.sidebar::before {
    display: none;
}

.sidebar-deco {
    display: none;
}

.sidebar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 4px 8px 22px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar .brand {
    color: #fff;
}

.sidebar .brand-mark {
    color: var(--gold);
}

.sidebar .brand-sub {
    color: rgba(255, 255, 255, 0.58);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 10px;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.1px;
    transition: background 150ms, color 150ms, border-color 150ms;
}

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

.nav-item.is-active {
    background: rgba(255, 255, 255, 0.09);
    border-left-color: var(--gold);
    color: #fff;
    box-shadow: none;
    font-weight: 600;
}

.nav-ico {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0;
}

.nav-item.is-active .nav-ico,
.nav-item:hover .nav-ico {
    background: transparent;
    color: var(--gold-light);
}

.sidebar-spacer {
    flex: 1;
    min-height: 20px;
}

.sidebar-tip {
    display: block;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.64);
    box-shadow: none;
}

.sidebar-tip-label {
    display: block;
    margin-bottom: 6px;
    color: var(--gold);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.sidebar-tip p {
    font-size: 10px;
    font-weight: 400;
    line-height: 1.55;
}

.sidebar-tip strong {
    color: #fff;
    font-weight: 600;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user .avatar {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.sidebar-user-info strong {
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}

.sidebar-user-info span {
    color: rgba(255, 255, 255, 0.50);
    font-size: 8.5px;
    font-weight: 400;
}

.sidebar-logout {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.app-main {
    margin-left: 264px;
    min-height: 100vh;
}

.drawer-overlay {
    background: rgba(10, 27, 46, 0.55);
    backdrop-filter: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.menu-btn {
    display: none;
}

.topbar-brand-mobile {
    display: none;
}

.topbar-brand-mobile .brand {
    color: var(--navy);
}

.topbar-brand-mobile .brand-mark {
    color: var(--gold-dark);
}

.topbar-context {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.eyebrow {
    display: block;
    color: var(--gold-dark);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    line-height: 1.3;
    text-transform: uppercase;
}

.topbar-context h2 {
    color: var(--navy);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
}

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

.topbar .icon-btn {
    border-color: transparent;
    background: transparent;
}

.topbar .icon-btn:hover {
    background: #F3F5F8;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: none;
    transition: background 150ms, border-color 150ms;
}

.user-chip:hover {
    background: #F7F9FB;
    border-color: var(--line-strong);
    box-shadow: none;
    transform: none;
}

.user-chip-info strong {
    color: var(--navy);
    font-size: 10.5px;
    font-weight: 600;
}

.user-chip-info span {
    color: var(--ink-muted);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.user-chip-caret {
    color: var(--ink-muted);
    font-size: 0;
}

.view {
    width: min(1400px, 100%);
    margin: 0 auto;
    padding: 26px 26px 60px;
    outline: none;
}

.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50vh;
    color: var(--ink-muted);
    font-size: 11.5px;
    font-weight: 500;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--line);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.loader-card {
    display: none;
}

.mobile-nav {
    display: none;
}

/* =========================================================
   Page header
   ========================================================= */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    animation: none;
}

.page-head > div:first-child {
    min-width: 0;
}

.page-title {
    margin-top: 3px;
    color: var(--navy);
    font-size: clamp(23px, 2.2vw, 28px);
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

.page-sub {
    max-width: 780px;
    margin-top: 5px;
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.title-emoji {
    display: none !important;
}

/* =========================================================
   Dashboard
   ========================================================= */

.dashboard-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: none;
}

.context-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: none;
    animation: none;
}

.context-group label {
    padding-left: 0;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.context-select {
    min-height: 38px;
    padding: 0 32px 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
}

.context-select:focus {
    border-color: var(--navy);
    box-shadow: var(--shadow-focus);
}

.context-readonly {
    min-height: 38px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.context-readonly strong {
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 600;
}

.context-readonly small {
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 400;
}

.context-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
    color: var(--ink-soft);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.quick-periods {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding-left: 0;
    animation: none;
}

.quick-periods-label {
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.period-chip {
    min-height: 27px;
    padding: 3px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 500;
    transition: background 150ms, border-color 150ms, color 150ms;
}

.period-chip:hover {
    border-color: var(--navy-muted);
    color: var(--navy);
}

.period-chip.is-active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
    box-shadow: none;
}

.context-empty {
    color: var(--ink-muted);
    font-size: 10.5px;
    font-weight: 400;
}

.hero-grid,
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.hero-grid > *,
.content-grid > *,
.kpi-grid > * {
    min-width: 0;
}

.thp-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 246px;
    padding: 26px 28px;
    overflow: hidden;
    border: 1px solid var(--navy);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--navy) 0%, #173653 100%);
    box-shadow: none;
}

.thp-hero::before,
.thp-hero::after {
    display: none;
}

.thp-hero.is-empty {
    border-color: var(--line-strong);
    background: #fff;
}

.hero-fan {
    display: none !important;
}

.hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gold-light);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.hero-label .ico {
    display: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 2px 9px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.80);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.thp-hero.is-empty .hero-label {
    color: var(--gold-dark);
}

.thp-hero.is-empty .hero-badge {
    border-color: var(--line);
    background: #F7F9FB;
    color: var(--ink-muted);
}

.hero-main {
    margin: 18px 0;
}

.hero-amount {
    color: #fff;
    font-size: clamp(32px, 4.2vw, 48px);
    font-weight: 600;
    letter-spacing: -1.2px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.thp-hero.is-empty .hero-amount {
    color: var(--ink-muted);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 500;
}

.hero-amount--empty {
    color: var(--ink-muted);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10.5px;
    font-weight: 400;
}

.hero-meta strong {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.thp-hero.is-empty .hero-meta {
    color: var(--ink-muted);
}

.thp-hero.is-empty .hero-meta strong {
    color: var(--ink-soft);
}

.hero-meta-sep {
    color: rgba(255, 255, 255, 0.28);
}

.thp-hero.is-empty .hero-meta-sep {
    color: var(--line-strong);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-actions .btn-ghost {
    border-color: rgba(255, 255, 255, 0.24);
    background: transparent;
    color: #fff;
}

.hero-actions .btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.08);
}

.hero-actions .btn-primary {
    border-color: #fff;
    background: #fff;
    color: var(--navy);
}

.hero-actions .btn-primary:hover {
    border-color: var(--gold-light);
    background: var(--gold-light);
}

.thp-hero.is-empty .hero-actions .btn-primary {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    min-height: 104px;
    padding: 15px 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: none;
    transition: border-color 150ms;
}

.kpi-card::before {
    display: block;
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--navy);
}

.kpi-card--gold::before { background: var(--gold); }
.kpi-card--sky::before { background: #4D6F91; }
.kpi-card--coral::before { background: var(--maroon); }

.kpi-card:hover {
    border-color: var(--line-strong);
    box-shadow: none;
    transform: none;
}

.kpi-icon {
    display: none;
}

.kpi-copy {
    min-width: 0;
}

.kpi-label {
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.7px;
    line-height: 1.35;
    text-transform: uppercase;
}

.kpi-value {
    margin-top: 7px;
    color: var(--navy);
    font-size: clamp(16px, 1.7vw, 20px);
    font-weight: 600;
    letter-spacing: -0.4px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kpi-foot {
    display: block;
    margin-top: 5px;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 400;
    line-height: 1.4;
}

.panel,
.side-card,
.contribution-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: none;
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.panel-head .section-title {
    flex: 1;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.section-title .ico {
    display: none;
}

.section-title h2,
.section-title h3 {
    color: var(--navy);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    line-height: 1.3;
}

.section-title .section-sub {
    margin-left: auto;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    margin-bottom: 1px;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: color 150ms, border-color 150ms, background 150ms;
}

.tab:hover {
    background: #F7F9FB;
    color: var(--navy);
}

.tab.is-active {
    border-bottom-color: var(--navy);
    background: transparent;
    color: var(--navy);
    box-shadow: none;
    font-weight: 700;
}

.ledger {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
}

.ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 12px;
    border-bottom: 1px solid #EEF1F5;
    font-size: 11.5px;
}

.ledger-row:nth-child(even) {
    background: #FBFCFD;
}

.ledger-label {
    color: var(--ink-soft);
    font-weight: 400;
}

.ledger-amount {
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger-row.is-deduction .ledger-amount {
    color: var(--maroon);
}

.ledger-group {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: #F3F5F8;
    color: var(--navy);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.ledger-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: #F7F9FB;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
}

.ledger-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 12px;
    border-top: 2px solid var(--navy);
    background: #F2F5F9;
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ledger-total .ledger-amount {
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

.ledger-updated {
    margin-top: 8px;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 400;
}

.ledger-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #FBFCFD;
    text-align: center;
}

.ledger-empty-ico {
    display: none;
}

.ledger-empty p {
    color: var(--ink-muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.contribution-card {
    padding: 20px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #EEF1F5;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    transition: none;
}

.rank-item:hover {
    background: transparent;
    transform: none;
}

.rank-medal {
    display: none;
}

.rank-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.rank-name {
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 500;
}

.rank-value {
    color: var(--navy);
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rank-bar {
    height: 4px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 0;
    background: #EEF1F5;
}

.rank-fill {
    height: 100%;
    border-radius: 0;
    background: var(--navy-muted);
    animation: none;
}

.rank-item.is-first .rank-fill {
    background: var(--gold);
}

.rank-footnote {
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 9px;
    font-style: normal;
}

.side-card {
    padding: 18px;
}

.side-card .section-title {
    margin-bottom: 12px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 500;
    text-align: left;
    transition: background 150ms, border-color 150ms, color 150ms;
}

.quick-action:hover {
    background: #F7F9FB;
    border-color: var(--navy-muted);
    color: var(--navy);
    transform: none;
}

.quick-action .ico {
    display: none;
}

.quick-action span:last-child {
    color: var(--ink-muted);
    font-size: 14px;
}

.quick-action.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.side-tip {
    border-left: 3px solid var(--gold);
}

.side-tip-text {
    color: var(--ink-muted);
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.65;
}

.dashboard-warnings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.boom-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid #E7C9C9;
    border-left: 3px solid var(--maroon);
    border-radius: var(--radius-sm);
    background: var(--maroon-light);
    box-shadow: none;
}

.boom-ico {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--maroon);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.boom-alert strong {
    display: block;
    color: var(--maroon);
    font-size: 10.5px;
    font-weight: 700;
}

.boom-alert p {
    margin-top: 2px;
    color: #7E2929;
    font-size: 10.5px;
    line-height: 1.5;
}

/* =========================================================
   Toolbar and tables
   ========================================================= */

.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.toolbar .field {
    flex: 0 1 190px;
}

.toolbar .field--search {
    flex: 1 1 280px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.data-table th {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: #F5F7FA;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1.35;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #EEF1F5;
    color: var(--ink-soft);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: #FAFBFC;
}

.data-table tr.is-inactive td {
    color: var(--ink-muted);
    background: #FBFCFD;
}

.data-table .is-actions {
    text-align: right;
    white-space: nowrap;
}

.data-table .mono,
.mono {
    color: var(--ink);
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1px;
}

.employee-table {
    min-width: 940px;
}

.table-person {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 190px;
}

.table-person-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.table-person-sub {
    color: var(--ink-muted);
    font-size: 8.5px;
    line-height: 1.3;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.table-actions .btn {
    border-color: transparent;
    background: transparent;
}

.table-actions .btn-ghost:hover {
    border-color: var(--line);
    background: #F3F5F8;
}

.table-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 12px;
}

.table-skeleton-row {
    height: 38px;
    border-radius: 3px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 2px;
}

.pagination-info {
    color: var(--ink-muted);
    font-size: 10px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pagination-btn {
    display: inline-grid;
    place-items: center;
    min-width: 29px;
    height: 29px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--navy-muted);
    color: var(--navy);
}

.pagination-btn.is-active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* =========================================================
   Modals
   ========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(10, 27, 46, 0.55);
    backdrop-filter: none;
}

.modal {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 27, 46, 0.22);
    animation: modalIn 180ms ease both;
}

.modal--wide {
    width: min(940px, 100%);
}

.modal--slip {
    width: min(840px, 100%);
}

.modal--import {
    width: min(1180px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px 15px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.modal-head .ico {
    display: none;
}

.modal-heading {
    min-width: 0;
}

.modal-heading h2 {
    margin-top: 2px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.modal-heading p {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 29px;
    height: 29px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-muted);
    font-size: 19px;
    line-height: 1;
}

.modal-close:hover {
    border-color: var(--line);
    background: #F3F5F8;
    color: var(--navy);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.modal-body > .tabs {
    margin-bottom: 15px;
}

.modal-intro {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
    color: var(--ink-soft);
    font-size: 10.5px;
    line-height: 1.55;
}

.modal-intro strong {
    color: var(--navy);
    font-weight: 600;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
    padding: 13px 22px;
    border-top: 1px solid var(--line);
    background: #FAFBFC;
}

.modal-foot-left {
    margin-right: auto;
}

.modal--wide .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal--wide .form-grid .field--full,
.modal--wide .form-grid .form-section-label {
    grid-column: 1 / -1;
}

.confirm-modal {
    width: min(430px, 100%);
    padding: 24px;
    text-align: center;
}

.confirm-ico {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 1px solid #DCC8A8;
    border-radius: 50%;
    background: #F7F2E9;
    color: var(--gold-dark);
    font-size: 16px;
    font-weight: 700;
}

.confirm-ico--danger {
    border-color: #E7C9C9;
    background: var(--maroon-light);
    color: var(--maroon);
}

.confirm-modal h2 {
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
}

.confirm-modal p {
    margin-top: 7px;
    color: var(--ink-muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
}

/* =========================================================
   Tables inside slip preview
   ========================================================= */

.slip-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 18px;
}

.slip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 11px;
}

.slip-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #EEF1F5;
    color: var(--ink-soft);
}

.slip-table .amount {
    text-align: right;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.slip-table .section-row td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    background: #F3F5F8;
    color: var(--navy);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

.slip-table .subtotal td {
    border-top: 1px solid var(--line-strong);
    background: #F7F9FB;
    color: var(--navy);
    font-weight: 600;
}

.slip-table .total td {
    border-top: 2px solid var(--navy);
    background: #F2F5F9;
    color: var(--navy);
    font-weight: 700;
}

/* =========================================================
   Empty states and skeletons
   ========================================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 44px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    text-align: center;
}

.empty-state h3 {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
}

.empty-state p {
    max-width: 460px;
    color: var(--ink-muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 6px;
}

.empty-ico {
    display: none;
}

.skeleton {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #E8EDF3;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.4s infinite;
}

/* =========================================================
   Audit trail
   ========================================================= */

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audit-skeleton {
    height: 78px;
}

.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
}

.audit-item.is-created { border-left-color: var(--green); }
.audit-item.is-updated { border-left-color: #4D6F91; }
.audit-item.is-deleted { border-left-color: var(--maroon); }

.audit-item::before {
    display: none;
}

.audit-ico {
    display: none;
}

.audit-body {
    flex: 1;
    min-width: 0;
}

.audit-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.audit-title {
    color: var(--navy);
    font-size: 12px;
    font-weight: 600;
}

.audit-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    color: var(--ink-muted);
    font-size: 9.5px;
}

.audit-meta-sep {
    color: var(--line-strong);
}

.audit-props {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.audit-prop {
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
    color: var(--ink-muted);
    font-size: 9px;
}

.audit-prop strong {
    color: var(--ink-soft);
    font-weight: 600;
}

.audit-details {
    margin-top: 8px;
}

.audit-details summary {
    color: var(--slate);
    font-size: 9.5px;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================================
   Profile
   ========================================================= */

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
}

.profile-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.profile-name {
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
}

.profile-role {
    margin-top: 4px;
}

.profile-list {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.profile-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #EEF1F5;
    font-size: 11px;
}

.profile-row > span:first-child {
    color: var(--ink-muted);
}

.profile-row > span:last-child {
    color: var(--ink);
    font-weight: 500;
    text-align: right;
}

.profile-card .login-note {
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.profile-card .login-note p {
    color: var(--ink-muted);
    font-size: 10.5px;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-root {
    position: fixed;
    z-index: 200;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(360px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--navy);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 39, 66, 0.12);
    animation: toastIn 180ms ease both;
}

.toast.is-success { border-left-color: var(--green); }
.toast.is-error { border-left-color: var(--maroon); }
.toast.is-info { border-left-color: #4D6F91; }

.toast-ico {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #F3F5F8;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
}

.toast.is-success .toast-ico { background: var(--green-light); color: var(--green); }
.toast.is-error .toast-ico { background: var(--maroon-light); color: var(--maroon); }
.toast.is-info .toast-ico { background: #EDF3F9; color: #355B7E; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-body strong {
    display: block;
    color: var(--navy);
    font-size: 10.5px;
    font-weight: 600;
}

.toast-body p {
    margin-top: 2px;
    color: var(--ink-muted);
    font-size: 10px;
    line-height: 1.45;
}

.toast-close {
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    font-size: 15px;
}

/* =========================================================
   Import wizard
   ========================================================= */

.import-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin: -20px -22px 20px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}

.import-step {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 20px 0 0;
    color: var(--ink-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.import-step b {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 700;
}

.import-step.is-active {
    color: var(--navy);
}

.import-step.is-active b {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.import-step.is-done b {
    border-color: var(--gold);
    background: var(--gold-light);
    color: var(--gold-dark);
}

.import-source-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.5fr) minmax(120px, 0.4fr);
}

.import-source-grid .field--full {
    grid-column: 1 / -1;
}

.import-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.import-template-card strong {
    display: block;
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 600;
}

.import-template-card p {
    margin-top: 2px;
    color: var(--ink-muted);
    font-size: 10px;
    line-height: 1.5;
}

.import-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    padding: 30px 20px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #FBFCFD;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms, background 150ms;
}

.import-drop:hover,
.import-drop.is-dragging,
.import-drop.has-file {
    border-color: var(--navy-muted);
    border-style: solid;
    background: #F5F8FB;
}

.import-drop-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--navy-soft);
}

.import-drop-title {
    color: var(--navy);
    font-size: 12.5px;
    font-weight: 600;
}

.import-drop-hint {
    color: var(--ink-muted);
    font-size: 10px;
}

.import-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.import-file-name {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-actions {
    margin-top: 18px;
}

.import-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.import-preview-head h3 {
    color: var(--navy);
    font-size: 15px;
    font-weight: 600;
}

.import-preview-head p {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 10.5px;
}

.import-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.import-summary {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
}

.import-summary span {
    display: block;
    color: var(--ink-muted);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.import-summary strong {
    display: block;
    margin-top: 3px;
    color: var(--navy);
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.import-summary.is-valid { border-left-color: var(--green); }
.import-summary.is-new { border-left-color: var(--navy); }
.import-summary.is-update { border-left-color: #4D6F91; }
.import-summary.is-invalid { border-left-color: var(--maroon); }

.import-table-note {
    margin-bottom: 8px;
    color: var(--ink-muted);
    font-size: 9.5px;
}

.import-table-wrap {
    max-height: 42vh;
    overflow: auto;
}

.import-table {
    min-width: 920px;
}

.import-table td {
    font-size: 10.5px;
    white-space: nowrap;
}

.import-table td.import-validation {
    max-width: 260px;
    white-space: normal;
}

.import-table tr.is-error td {
    background: #FDF8F8;
}

.import-issues {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.import-issues li {
    font-size: 9.5px;
    line-height: 1.45;
}

.import-issues .is-error {
    color: var(--maroon);
}

.import-issues .is-warning {
    color: var(--gold-dark);
}

.import-ok {
    color: var(--green);
    font-size: 9.5px;
    font-weight: 600;
}

.import-result-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 16px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.import-result-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid #C7DCCF;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    font-size: 17px;
    font-weight: 700;
}

.import-result-mark.is-warning {
    border-color: #DCC8A8;
    background: #F7F2E9;
    color: var(--gold-dark);
}

.import-result-head h3 {
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
}

.import-result-head p {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.import-credentials {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #DCC8A8;
    border-radius: var(--radius-sm);
    background: #FCFAF6;
}

.import-credentials-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.import-credentials-head h4,
.import-errors h4 {
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 600;
}

.import-credentials-head p {
    margin-top: 2px;
    color: var(--ink-muted);
    font-size: 9.5px;
    line-height: 1.5;
}

.import-credentials .data-table {
    border: 1px solid var(--line);
}

.import-credentials .mono {
    color: var(--maroon);
    font-weight: 600;
}

.import-errors {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #E7C9C9;
    border-radius: var(--radius-sm);
    background: #FDF8F8;
}

.import-errors ul {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}

.import-errors li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-top: 7px;
    border-top: 1px solid #F0DADA;
}

.import-errors li strong {
    color: var(--maroon);
    font-size: 9.5px;
    font-weight: 600;
}

.import-errors li span {
    color: #7E2929;
    font-size: 9.5px;
    line-height: 1.45;
}

/* =========================================================
   Forced password change
   ========================================================= */

body.force-mode {
    background: #EAEFF4;
}

body.force-mode .sidebar,
body.force-mode .topbar,
body.force-mode .mobile-nav {
    display: none;
}

body.force-mode .app-main {
    margin-left: 0;
}

body.force-mode .view {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.force-card {
    width: min(460px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--navy);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 39, 66, 0.12);
}

.force-ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border: 1px solid #DCC8A8;
    border-radius: 50%;
    background: #F7F2E9;
    color: var(--gold-dark);
}

.force-card h1 {
    margin-top: 3px;
    color: var(--navy);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.force-card > p {
    margin-top: 7px;
    color: var(--ink-muted);
    font-size: 11.5px;
    line-height: 1.65;
}

.force-card > p strong {
    color: var(--ink);
    font-weight: 600;
}

.force-card .password-form {
    margin-top: 18px;
}

.force-card .force-logout {
    margin-top: 10px;
}

/* =========================================================
   Login
   ========================================================= */

body.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #E9EDF2;
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.02fr 0.98fr;
    width: min(1080px, 100%);
    min-height: 660px;
    overflow: hidden;
    border: 1px solid #D5DEE8;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 39, 66, 0.12);
}

.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px 42px 30px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(160deg, var(--navy) 0%, #122D4B 58%, var(--navy-deep) 100%);
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    opacity: 1;
    pointer-events: none;
}

.login-hero::after {
    display: none;
}

.login-hero-glow {
    display: none;
}

.login-hero-top,
.login-hero-copy,
.login-hero-foot,
.login-features {
    position: relative;
    z-index: 2;
}

.login-hero-top {
    display: flex;
    justify-content: flex-start;
}

.login-hero .brand {
    color: #fff;
}

.login-hero .brand-mark {
    color: var(--gold);
}

.login-hero .brand-sub {
    color: rgba(255, 255, 255, 0.55);
}

.login-hero-copy {
    margin-top: 30px;
    max-width: 470px;
}

.login-hero-copy .eyebrow {
    color: var(--gold-light);
}

.login-hero-copy h1 {
    margin-top: 12px;
    color: #fff;
    font-size: clamp(29px, 3.1vw, 38px);
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.18;
    text-shadow: none;
}

.login-hero-copy h1 span {
    color: inherit;
    text-shadow: none;
}

.login-hero-copy p {
    max-width: 440px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.7;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 28px 0 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    list-style: none;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.login-feature-mark {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.8;
}

.login-features strong {
    display: block;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}

.login-features span:last-child {
    display: block;
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 9.5px;
    line-height: 1.5;
}

.login-hero-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.hero-foot-sep {
    color: rgba(255, 255, 255, 0.26);
}

.login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 44px;
    background: #fff;
}

.login-card {
    width: min(360px, 100%);
}

.login-card-head {
    display: block;
}

.login-card-head h2 {
    margin-top: 7px;
    color: var(--navy);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.login-card-head p {
    margin-top: 6px;
    color: var(--ink-muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 22px;
}

.login-form .btn-block {
    margin-top: 5px;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 0;
    padding: 10px 12px;
    border: 1px solid #E7C9C9;
    border-left: 3px solid var(--maroon);
    border-radius: var(--radius-sm);
    background: var(--maroon-light);
    color: #7E2929;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: none;
    animation: none;
}

.auth-alert-ico {
    display: none;
}

.login-note {
    display: block;
    margin-top: 20px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    background: #F7F9FB;
}

.login-note p {
    color: var(--ink-muted);
    font-size: 9.5px;
    line-height: 1.55;
}

.login-copyright {
    color: var(--ink-muted);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.2px;
    text-align: center;
}

.login-card-fan,
.login-fan-card {
    display: none !important;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    to { transform: translateX(100%); }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
    .import-source-grid {
        grid-template-columns: 1fr 1fr;
    }

    .import-source-grid .field--full {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1080px) {
    .sidebar {
        width: 264px;
        transform: translateX(-105%);
        border-radius: 0;
    }

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

    body.drawer-open .drawer-overlay {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .menu-btn {
        display: inline-grid;
    }

    .topbar {
        padding: 0 18px;
    }

    .view {
        padding: 22px 18px 56px;
    }

    .hero-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal--wide .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-hero {
        min-height: 0;
        padding: 30px 32px 26px;
    }

    .login-features {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 18px;
        margin-top: 18px;
    }

    .login-features li {
        border-bottom: 0;
    }

    .login-main {
        padding: 34px 32px 30px;
    }

    .login-card {
        width: min(420px, 100%);
    }

    .login-copyright {
        margin-top: 4px;
    }
}

@media (max-width: 860px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .hero-amount {
        font-size: clamp(30px, 7vw, 42px);
    }

    .import-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .import-credentials-head {
        flex-direction: column;
    }

    .login-features {
        grid-template-columns: 1fr;
    }

    .login-features li {
        padding: 8px 0;
    }
}

@media (max-width: 760px) {
    body.app-page {
        padding-bottom: 68px;
    }

    .topbar {
        min-height: 58px;
        gap: 8px;
        padding: 0 12px;
    }

    .topbar-context {
        display: none;
    }

    .topbar-brand-mobile {
        display: block;
        margin-right: auto;
    }

    .topbar-refresh {
        display: none;
    }

    .user-chip {
        min-height: 38px;
        padding: 3px;
        border-color: transparent;
        border-radius: 50%;
        background: transparent;
    }

    .user-chip-info,
    .user-chip-caret {
        display: none;
    }

    .view {
        padding: 18px 12px 40px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 11px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 23px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .context-bar {
        gap: 8px;
        padding: 11px;
    }

    .context-group--employee {
        flex: 1 1 100%;
    }

    .context-group--period,
    .context-group--year {
        flex: 1 1 calc(50% - 4px);
    }

    .context-note {
        display: none;
    }

    .dashboard-body {
        gap: 12px;
    }

    .hero-grid,
    .content-grid {
        gap: 12px;
    }

    .thp-hero {
        min-height: 220px;
        padding: 20px 18px;
    }

    .hero-amount {
        font-size: clamp(28px, 9vw, 38px);
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn {
        flex: 1;
    }

    .kpi-grid {
        gap: 9px;
    }

    .kpi-card {
        min-height: 96px;
        padding: 13px 13px 12px 16px;
    }

    .kpi-value {
        font-size: 16px;
    }

    .panel,
    .side-card,
    .contribution-card {
        padding: 15px;
    }

    .section-title h2,
    .section-title h3 {
        font-size: 12.5px;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        padding: 0 10px;
        font-size: 10px;
    }

    .ledger-row {
        padding: 7px 9px;
        font-size: 10.5px;
    }

    .ledger-amount {
        font-size: 10.5px;
    }

    .ledger-total .ledger-amount {
        font-size: 12.5px;
    }

    .toolbar {
        align-items: stretch;
    }

    .toolbar .field,
    .toolbar .field--search {
        flex: 1 1 calc(50% - 5px);
    }

    .toolbar-actions {
        width: 100%;
        margin-left: 0;
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-height: 93vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .modal-head {
        padding: 15px 16px 13px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-foot {
        padding: 12px 16px;
    }

    .modal-foot .btn {
        flex: 1;
    }

    .modal-foot-left {
        flex: 1 1 100%;
        margin-right: 0;
    }

    .form-grid,
    .modal--wide .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .field--full,
    .modal--wide .form-grid .field--full,
    .modal--wide .form-grid .form-section-label {
        grid-column: auto;
    }

    .editor-total--multi {
        grid-template-columns: 1fr;
    }

    .editor-total-item {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .editor-total-item:last-child {
        border-bottom: 0;
    }

    .confirm-modal {
        margin: auto 12px;
        border-radius: var(--radius-md);
    }

    .toast-root {
        right: 12px;
        bottom: 78px;
        width: calc(100vw - 24px);
    }

    .mobile-nav {
        position: fixed;
        z-index: 70;
        inset: auto 10px 10px;
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 3px;
        min-height: 58px;
        padding: 5px;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 8px 24px rgba(15, 39, 66, 0.14);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-nav-item {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 44px;
        border-radius: var(--radius-sm);
        color: var(--ink-muted);
        font-size: 8px;
        font-weight: 600;
        letter-spacing: 0.2px;
        transition: background 150ms, color 150ms;
    }

    .mobile-nav-item.is-active {
        background: #F0F3F7;
        color: var(--navy);
        box-shadow: none;
    }

    .mobile-nav-ico {
        color: currentColor;
        font-size: 0;
        line-height: 1;
    }

    .import-steps {
        margin: -16px -16px 16px;
        padding: 0 16px;
        overflow-x: auto;
    }

    .import-step {
        flex: 0 0 auto;
        padding-right: 14px;
    }

    .import-source-grid {
        grid-template-columns: 1fr;
    }

    .import-source-grid .field--full {
        grid-column: auto;
    }

    .import-template-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .import-template-card .btn {
        width: 100%;
    }

    .import-preview-head {
        flex-direction: column;
        gap: 8px;
    }

    .import-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-table-wrap {
        max-height: 38vh;
    }

    .login-page {
        padding: 10px;
    }

    .login-shell {
        border-radius: var(--radius-md);
    }

    .login-hero {
        padding: 22px 20px 20px;
    }

    .login-hero .brand--lg .brand-mark {
        width: 38px;
        height: 38px;
    }

    .login-hero .brand--lg .brand-name {
        font-size: 21px;
    }

    .login-hero-copy {
        margin-top: 18px;
    }

    .login-hero-copy h1 {
        margin-top: 9px;
        font-size: 26px;
    }

    .login-hero-copy p {
        margin-top: 9px;
        font-size: 11.5px;
    }

    .login-features {
        display: none;
    }

    .login-hero-foot {
        display: none;
    }

    .login-main {
        padding: 26px 20px 22px;
    }

    .login-card-head h2 {
        font-size: 22px;
    }

    .login-form {
        margin-top: 18px;
    }
}

@media (max-width: 430px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .import-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-badge {
        font-size: 8px;
    }

    .page-actions {
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .mobile-nav,
    .page-actions,
    .toast-root,
    .modal-backdrop {
        display: none !important;
    }

    .app-main {
        margin-left: 0;
    }

    .view {
        width: 100%;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
