/* ==========================================================================
   Shoe Distribution - UI stylesheet
   Light theme, blue brand. No build step required.
   ========================================================================== */

:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-900: #1e3a8a;
    --navy: #0f1d4a;

    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-muted: #f3f5f9;
    --input-bg: #f3f4f6;
    --border: #e5e8ef;
    --border-strong: #d4d9e3;

    --text: #1f2937;
    --text-muted: #6b7280;
    --text-soft: #9aa3b2;

    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #b45309;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0369a1;
    --info-bg: #e0f2fe;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 8px 30px rgba(17, 38, 99, .06);
    --shadow-lg: 0 20px 60px rgba(17, 38, 99, .10);

    --sidebar-w: 260px;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; }
small, .text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 40;
    transition: transform .25s ease;
}
.sidebar__brand {
    display: flex; align-items: center; gap: .75rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    min-height: 76px;
}
.sidebar__brand img { max-height: 42px; max-width: 64px; object-fit: contain; }
.sidebar__brand-mark {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff; font-family: var(--font-head); font-weight: 700;
}
.sidebar__brand-name { font-family: var(--font-head); font-weight: 600; color: var(--navy); font-size: .98rem; line-height: 1.2; }
.sidebar__brand-sub { font-size: .75rem; color: var(--text-muted); }

.nav { padding: 1rem .75rem; overflow-y: auto; flex: 1; }
.nav__label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; padding: .9rem .75rem .4rem; }
.nav__link {
    display: flex; align-items: center; gap: .75rem;
    padding: .62rem .75rem; margin-bottom: 2px;
    border-radius: 10px;
    color: #4b5563; font-weight: 600;
    transition: background .15s, color .15s;
}
.nav__link svg { width: 20px; height: 20px; flex: none; color: var(--text-soft); }
.nav__link:hover { background: var(--surface-muted); color: var(--navy); }
.nav__link.is-active { background: var(--brand-50); color: var(--brand-700); }
.nav__link.is-active svg { color: var(--brand-600); }

.sidebar__footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .85rem 2rem;
    background: rgba(246, 248, 252, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: .75rem; }
.topbar__date { color: var(--text-muted); font-size: .9rem; }
.menu-toggle { display: none; }

.user-menu { position: relative; }
.user-menu__button {
    display: flex; align-items: center; gap: .6rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: .3rem .8rem .3rem .3rem; cursor: pointer;
    font: inherit; color: var(--text);
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand-100); color: var(--brand-700);
    font-weight: 700; font-size: .8rem;
}
.user-menu__name { font-weight: 700; font-size: .9rem; line-height: 1.1; text-align: left; }
.user-menu__role { font-size: .72rem; color: var(--text-muted); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + .5rem);
    min-width: 200px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .4rem; display: none;
}
.dropdown.is-open { display: block; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .55rem .7rem; border-radius: 8px; border: 0; background: none;
    font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-muted); }
.dropdown svg { width: 18px; height: 18px; color: var(--text-muted); }

.content { padding: 1.75rem 2rem 2rem; flex: 1; }

.app-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 2rem; color: var(--text-muted); font-size: .82rem;
    border-top: 1px solid var(--border);
}

.dev-credit { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-muted); font-size: .8rem; }
.dev-credit img { height: 20px; width: auto; }

.backdrop { display: none; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header p { margin: .3rem 0 0; color: var(--text-muted); }
.page-header__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-600); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: 1.5rem; }
.grid > .card, .report-links > .card { margin-top: 0; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card__header p { margin: .15rem 0 0; font-size: .87rem; color: var(--text-muted); }
.card__body { padding: 1.5rem; }
.card__body--flush { padding: 0; }
.card__footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: #fbfcfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }

/* ---------- Stats ---------- */
.stat { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.35rem; }
.stat__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat__icon svg { width: 22px; height: 22px; }
.stat__label { font-size: .82rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat > div:last-child { min-width: 0; }
.stat__value { font-family: var(--font-head); font-size: clamp(1.05rem, 1.2vw, 1.3rem); font-weight: 600; color: var(--navy); margin-top: .15rem; overflow-wrap: anywhere; }
.stat__hint { font-size: .82rem; color: var(--text-muted); margin-top: .1rem; }
.tone-blue { background: var(--brand-50); color: var(--brand-600); }
.tone-green { background: var(--success-bg); color: var(--success); }
.tone-amber { background: var(--warning-bg); color: var(--warning); }
.tone-red { background: var(--danger-bg); color: var(--danger); }
.tone-sky { background: var(--info-bg); color: var(--info); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .62rem 1.1rem; border-radius: 10px;
    border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .92rem;
    cursor: pointer; white-space: nowrap; line-height: 1.2;
    transition: transform .05s, box-shadow .15s, background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 1px; }
.btn-primary { background: linear-gradient(90deg, var(--brand-700), var(--brand-500)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(37, 99, 235, .35); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { color: #fff; filter: brightness(.95); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f5c2c2; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }
.btn-sm { padding: .4rem .7rem; font-size: .83rem; border-radius: 8px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { padding: .85rem 2.5rem; font-size: 1rem; letter-spacing: .04em; }
.btn-block { width: 100%; }
.btn-icon { padding: .45rem; }

.actions { display: flex; gap: .35rem; justify-content: flex-end; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label, .label { font-weight: 700; font-size: .88rem; color: #374151; }
.field .req { color: var(--danger); }
.field__hint { font-size: .8rem; color: var(--text-muted); }
.field__error { font-size: .82rem; color: var(--danger); font-weight: 600; }

.input, .select, .textarea {
    width: 100%; padding: .7rem .9rem;
    background: var(--input-bg); border: 1px solid #e3e6ec; border-radius: 10px;
    font: inherit; color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: #9ca3af; }
.input:focus, .select:focus, .textarea:focus { outline: none; background: #fff; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); background: #fff7f7; }
.input-sm { padding: .45rem .6rem; font-size: .9rem; border-radius: 8px; }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px; padding-right: 2.2rem; }

.checkbox { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; font-weight: 600; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--brand-600); }

.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 160px; padding: .55rem .8rem; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-soft); pointer-events: none; }
.search-input .input { padding-left: 2.3rem; min-width: 240px; }

.logo-preview { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-muted); }
.logo-preview img { max-height: 70px; max-width: 180px; object-fit: contain; background: #fff; padding: .4rem; border-radius: 8px; border: 1px solid var(--border); }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: .25rem; background: var(--surface-muted); padding: .3rem; border-radius: 12px; border: 1px solid var(--border); }
.tabs a { padding: .45rem .95rem; border-radius: 9px; font-weight: 700; color: var(--text-muted); font-size: .9rem; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a:hover { color: var(--navy); }
.tabs a.is-active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.tabs .count { background: var(--border); color: var(--text-muted); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.tabs a.is-active .count { background: var(--brand-100); color: var(--brand-700); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .85rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 800; background: #fafbfd; white-space: nowrap; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 800; background: #fafbfd; border-top: 2px solid var(--border); border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-sm th, .table-sm td { padding: .6rem .85rem; }
.cell-title { font-weight: 700; color: var(--navy); }
.cell-sub { font-size: .82rem; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--brand-50); color: var(--brand-700); }
.badge-muted { background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid; font-weight: 600; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; font-weight: 500; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-900); }
.alert__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; font-size: 1.2rem; line-height: 1; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin: 0 auto 1rem; }
.empty__icon svg { width: 26px; height: 26px; }
.empty h3 { margin-bottom: .3rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: .88rem; color: var(--text-muted); }
.pagination__links { display: flex; gap: .3rem; flex-wrap: wrap; }
.pagination__links a, .pagination__links span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 .6rem; border-radius: 9px; border: 1px solid var(--border); color: var(--text); font-weight: 700; background: var(--surface); }
.pagination__links a:hover { border-color: var(--brand-500); color: var(--brand-700); }
.pagination__links .is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination__links .is-disabled { color: var(--text-soft); background: var(--surface-muted); }

/* ---------- Detail lists ---------- */
.details { display: grid; grid-template-columns: 140px 1fr; gap: .55rem 1rem; margin: 0; }
.details dt { color: var(--text-muted); font-weight: 600; font-size: .9rem; }
.details dd { margin: 0; font-weight: 600; word-break: break-word; }

.summary-list { margin: 0; }
.summary-list div { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--text-muted); }
.summary-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-list .is-total dt, .summary-list .is-total dd { color: var(--navy); font-size: 1.1rem; font-family: var(--font-head); }

.balance-box { border-radius: var(--radius); padding: 1rem 1.25rem; background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff; }
.balance-box__label { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.balance-box__value { font-family: var(--font-head); font-size: 1.6rem; font-weight: 600; }
.balance-box--paid { background: linear-gradient(135deg, #15803d, #22c55e); }

/* ---------- Invoice builder ---------- */
.item-picker { display: flex; gap: .6rem; align-items: stretch; flex-wrap: wrap; padding: 1rem 1.5rem; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.item-picker .input { flex: 1; min-width: 240px; background: #fff; }
.items-table .input { min-width: 80px; }
.items-table td { vertical-align: top; }
.items-table .col-qty { width: 100px; }
.items-table .col-money { width: 140px; }
.items-table .col-total { width: 140px; padding-top: 1.35rem; }
.items-table .col-remove { width: 52px; }
.price-changed { border-color: #f59e0b !important; background: #fffbeb !important; }
.totals-panel { max-width: 380px; margin-left: auto; }
.totals-panel .input { text-align: right; max-width: 160px; }

/* ---------- Report helpers ---------- */
.report-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.aging__item { padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--surface-muted); border: 1px solid var(--border); }
.aging__item strong { display: block; font-family: var(--font-head); font-size: 1.2rem; color: var(--navy); }
.report-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.report-link { display: flex; gap: 1rem; padding: 1.4rem; align-items: flex-start; color: var(--text); transition: transform .15s, box-shadow .15s; }
.report-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text); }
.report-link h3 { margin-bottom: .25rem; }
.report-link p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.print-only { display: none; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; background: radial-gradient(circle at 10% 10%, #eaf1ff 0, transparent 40%), radial-gradient(circle at 90% 90%, #e8f0ff 0, transparent 40%), var(--bg); }
.auth-card { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 3.5rem 4rem; }
.auth-illustration { display: flex; align-items: center; justify-content: center; }
.auth-illustration svg { width: 100%; max-width: 420px; height: auto; }
.auth-form__logo { display: flex; justify-content: center; margin-bottom: .75rem; }
.auth-form__logo img { max-height: 64px; max-width: 220px; object-fit: contain; }
.auth-form h1 { text-align: center; font-size: 1.75rem; margin-bottom: 1.75rem; }
.auth-form .field { margin-bottom: 1.25rem; }
.auth-form .field label { font-weight: 600; font-size: 1rem; }
.auth-form .input { padding: .95rem 1.1rem; background: var(--input-bg); }
.auth-form__remember { margin: .25rem 0 1.75rem; }
.auth-form__submit { display: flex; justify-content: center; }
.auth-footer { margin-top: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .grid-main-side, .grid-3 { grid-template-columns: 1fr; }
    .auth-card { grid-template-columns: 1fr; padding: 2.5rem 2rem; max-width: 520px; }
    .auth-illustration { display: none; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: none; }
    .backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(15, 29, 74, .35); z-index: 35; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .topbar, .content, .app-footer { padding-left: 1rem; padding-right: 1rem; }
    .topbar__date, .user-menu__text { display: none; }
}
@media (max-width: 700px) {
    .grid-2, .grid-4, .form-grid, .form-grid--3, .report-links, .aging { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .details { grid-template-columns: 1fr; gap: .15rem; }
    .details dd { margin-bottom: .5rem; }
    .search-input .input { min-width: 0; }
    .filters, .filters > * { width: 100%; }
    .filters .input, .filters .select { width: 100%; }
}

/* ---------- Print (reports & any page) ---------- */
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    body { background: #fff; font-size: 12px; }
    .sidebar, .topbar, .app-footer, .no-print, .page-header__actions, .pagination, .filters, .btn { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; border-radius: 6px; break-inside: avoid; }
    .print-only { display: block; }
    a { color: inherit; }
}

/* ---------- Misc helpers ---------- */
.card-toolbar { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.list-link { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); color: var(--text); }
.list-link:last-child { border-bottom: 0; }
.list-link:hover { background: #fafcff; color: var(--text); }
.list-link__body { flex: 1; min-width: 0; }
.list-link .stat__icon { width: 38px; height: 38px; border-radius: 11px; }
.list-link .stat__icon svg { width: 18px; height: 18px; }
.push-right { margin-left: auto; }
.alert-flat { border-radius: 0; margin: 0; border-left: 0; border-right: 0; }
.form-grid--1 { grid-template-columns: 1fr; } .form-grid--1 .span-2 { grid-column: auto; }
.actions--start { justify-content: flex-start; }
