
@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap");

/* ======================================
   HESAB YAR AFTO - VERSION 3.2
   Complete Responsive Stylesheet
====================================== */

:root {
    --bg: #f4f7fb;
    --white: #ffffff;
    --navy: #101827;
    --navy-light: #193650;
    --orange: #f4b243;
    --orange-dark: #cf8d1e;
    --blue: #438ade;
    --green: #2fb57a;
    --purple: #9567e9;
    --red: #e45e65;
    --ink: #17283e;
    --muted: #758397;
    --line: #dce5ef;
    --shadow: 0 12px 35px rgba(16, 31, 54, 0.07);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 190px;
}

body {
    margin: 0;
    direction: rtl;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: linear-gradient(180deg, #f9fbfe, #f1f5fa);
}

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

button {
    cursor: pointer;
}

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

[hidden],
tr[hidden] {
    display: none !important;
}

/* ======================================
   HEADER AND AFTO LOGO
====================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 105px;
    background: rgba(13, 23, 40, 0.97);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 4%;
}

.brand,
.brand-rich {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.brand-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 5px 12px rgba(244, 178, 67, 0.15));
}

.brand-copy b,
.brand b {
    display: block;
    font-size: 27px;
    font-weight: 900;
    color: #fff;
}

.brand-copy small,
.brand small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #c7d2e4;
}

.head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.head-actions form {
    margin: 0;
}

.user-chip {
    padding: 10px 16px;
    border: 1px solid #35455d;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.user-chip small {
    color: #d5deea;
}

/* ======================================
   CONTAINER AND NAVIGATION
====================================== */

.container {
    max-width: 1450px;
    margin: auto;
    padding: 24px 28px 60px;
    min-width: 0;
}

.quick-nav {
    position: sticky;
    top: 112px;
    z-index: 900;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 12px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.quick-nav a {
    padding: 12px 16px;
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: #f8fafd;
    color: #25415d;
    font-weight: 700;
    transition: all 0.2s ease;
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
    background: #fff3db;
    border-color: var(--orange);
    color: #8b5b10;
    transform: translateY(-2px);
}

/* ======================================
   GENERAL CARDS AND HEADINGS
====================================== */

.card,
.drawer,
.filter-box,
.v3panel,
.auth,
.hero {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    padding: 25px;
    margin-bottom: 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff, #fff8eb);
}

.page-heading h1,
.hero h1 {
    margin: 5px 0 10px;
    font-size: 32px;
    font-weight: 900;
    color: #142b45;
}

.page-heading p,
.hero p {
    margin: 0;
}

.eyebrow {
    color: #a46c13;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.muted,
.v3hint {
    color: var(--muted);
    line-height: 1.9;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin: 22px 0 16px;
}

.section-title h2 {
    margin: 0;
    font-size: 21px;
}

.export-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

/* ======================================
   BUTTONS
====================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 10px 17px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn.primary,
.btn:not(.ghost):not(.secondary) {
    color: #281a09;
    background: linear-gradient(135deg, #f8c15b, #e7a22b);
    box-shadow: 0 7px 18px rgba(244, 178, 67, 0.22);
}

.btn.secondary {
    color: #fff;
    background: #203d5b;
}

.btn.ghost {
    background: #fff;
    color: #1e3d59;
    border-color: #d9e4f0;
}

.topbar .btn.ghost {
    color: #fff;
    background: #788fb1;
    border-color: #40516b;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(0.98);
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 2px;
}

.btn.mini {
    padding: 9px 12px;
    font-size: 12px;
}

.wide {
    width: 100%;
}

.link-btn {
    border: none;
    background: #eaf2ff;
    color: #2563bd;
    border-radius: 9px;
    padding: 8px 11px;
    font-weight: 700;
    font-size: 12px;
}

.link-btn.danger {
    background: #fff0f0;
    color: #c23d48;
}

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

.row-actions form {
    margin: 0;
}

/* ======================================
   FORMS
====================================== */

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #344963;
    font-weight: 700;
    min-width: 0;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 13px;
    outline: none;
    border: 1px solid #d8e3ef;
    border-radius: 11px;
    color: #233b56;
    background: #fff;
    transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(244, 178, 67, 0.14);
}

textarea {
    resize: vertical;
}

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

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

.form-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-box {
    padding: 20px;
    margin-bottom: 25px;
}

.filter-box form {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.7fr auto;
    align-items: end;
    gap: 13px;
}

/* ======================================
   DASHBOARD STATISTICS
====================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.stat {
    padding: 20px;
    min-height: 140px;
    border-top: 5px solid transparent;
}

.stat:nth-child(1) {
    border-top-color: var(--green);
}

.stat:nth-child(2) {
    border-top-color: var(--orange);
}

.stat:nth-child(3) {
    border-top-color: var(--purple);
}

.stat:nth-child(4) {
    border-top-color: var(--blue);
}

.stat:nth-child(5) {
    border-top-color: var(--red);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
}

.stat-num {
    font-size: clamp(20px, 2vw, 29px);
    font-weight: 900;
    text-align: right;
    direction: ltr;
    margin: 13px 0 5px;
    overflow-wrap: anywhere;
}

.stat-unit,
.subnote {
    font-size: 11px;
    color: #8995a5;
}

.subnote {
    margin: 15px 0 24px;
    line-height: 2;
}

.green {
    color: #119965;
}

.orange {
    color: #d58a19;
}

.purple {
    color: #8754d6;
}

.red {
    color: #d94353;
}

.receivables-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.mini-kpi {
    padding: 21px;
    background: linear-gradient(145deg, #fff, #f7faff);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.mini-kpi span {
    display: block;
    color: #66768b;
    margin-bottom: 9px;
}

.mini-kpi strong {
    font-size: 24px;
    color: #1a3450;
    overflow-wrap: anywhere;
}

.mini-kpi small {
    font-size: 12px;
}

/* ======================================
   TABS AND CHARTS
====================================== */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #e9eef5;
    border-radius: 12px;
    padding: 5px;
}

.tab {
    border: none;
    background: transparent;
    padding: 9px 16px;
    border-radius: 9px;
    color: #64748b;
    font-weight: 700;
}

.tab.selected {
    background: #fff;
    color: #244f85;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.08);
}

.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 26px;
}

.chart-card,
.summary-side {
    padding: 24px;
}

.chart-card {
    min-width: 0;
    overflow: hidden;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    color: #62738a;
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-left: 5px;
    background: currentColor;
}

.chart {
    height: 240px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 6px;
    margin-top: 18px;
    border-bottom: 1px solid var(--line);
}

.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 5px;
}

.bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 90%;
}

.bar {
    width: 25%;
    min-width: 3px;
    border-radius: 8px 8px 2px 2px;
    transition: height 0.35s ease;
}

.bar.green {
    background: #31b77c;
}

.bar.orange {
    background: #f1ac35;
}

.bar.purple {
    background: #9965e6;
}

.chart-column small {
    font-size: 11px;
    color: #79889d;
}

.summary-side {
    color: #fff;
    background: linear-gradient(145deg, #101827, #204466);
}

.summary-side h2 {
    color: #fff;
    margin: 8px 0;
}

.summary-side .muted {
    color: #c8d6e6;
}

.large-kpi {
    font-size: 40px;
    font-weight: 900;
    color: #ffca6b;
    margin: 23px 0;
}

.large-kpi small {
    display: block;
    font-size: 12px;
    color: #d2deea;
}

.tip {
    padding: 15px;
    border-radius: 12px;
    line-height: 2;
    color: #d7e3f2;
    background: rgba(255, 255, 255, 0.09);
}

/* ======================================
   COLLAPSIBLE SECTIONS
====================================== */

.drawer {
    margin: 18px 0;
    overflow: hidden;
}

.drawer summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 21px;
    cursor: pointer;
    list-style: none;
    font-weight: 900;
    font-size: 18px;
}

.drawer summary::-webkit-details-marker {
    display: none;
}

.drawer summary small {
    font-size: 12px;
    font-weight: 400;
    color: #66778b;
    margin-right: 8px;
}

.drawer-body {
    padding: 22px;
    border-top: 1px solid var(--line);
}

.summary-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: 9px;
    background: #fff;
    border-radius: 10px;
    color: #315e92;
}

.chevron {
    transition: transform 0.2s;
}

.drawer[open] .chevron {
    transform: rotate(180deg);
}

/* Logo for each main section */

.drawer > summary > span:first-child::before,
.v3panel > h2::before,
.hero h1::before {
    content: "";
    display: inline-block;
    width: 46px;
    height: 46px;
    margin-left: 10px;
    vertical-align: middle;
    flex-shrink: 0;
    background: #fff url("/static/logo-afto.png") center / 82% no-repeat;
    border: 1px solid #e9eefa;
    border-radius: 12px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

/* Separate colors for sections */

.drawer:not([id]) {
    border-right: 6px solid #edaa32;
}

.drawer:not([id]) > summary {
    background: linear-gradient(120deg, #fff3dd, #fffcf7);
}

#records {
    border-right: 6px solid var(--blue);
}

#records > summary {
    background: linear-gradient(120deg, #eaf4ff, #fafcff);
}

#debts {
    border-right: 6px solid var(--green);
}

#debts > summary {
    background: linear-gradient(120deg, #e9faef, #fafffb);
}

#settings {
    border-right: 6px solid var(--purple);
}

#settings > summary {
    background: linear-gradient(120deg, #f2ebff, #fcfaff);
}

/* ======================================
   INTERACTIVE TABLES
====================================== */

.table-scroll,
.v3table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    margin: 12px 0;
}

table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    text-align: right;
}

th {
    padding: 14px;
    background: #1a3856;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}

td {
    padding: 14px;
    color: #40536c;
    border-bottom: 1px solid #e7edf5;
    font-size: 13px;
}

td strong,
td small {
    display: block;
}

td strong {
    color: #233a54;
}

td small {
    margin-top: 4px;
    color: #8b9aad;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:nth-child(odd) {
    background: #f9fbfe;
}

tbody tr:hover {
    background: #fff4df;
}

.money {
    direction: ltr;
    text-align: right;
    font-weight: 900;
}

.pill {
    display: inline-block;
    border-radius: 30px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.pill.income {
    color: #128256;
    background: #dcf7e9;
}

.pill.consumable {
    color: #b66a16;
    background: #fff0d8;
}

.pill.fixed {
    color: #7950c3;
    background: #eee7ff;
}

.empty {
    text-align: center;
    padding: 27px;
    color: #8390a4;
}

.list-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 17px;
}

.list-toolbar input {
    flex: 2;
}

.list-toolbar select {
    flex: 1;
}

/* ======================================
   CONTACTS AND DEBT MANAGEMENT
====================================== */

.debt-topbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #f2fbf6;
    border: 1px solid #ccebd9;
    padding: 15px;
    border-radius: 14px;
    margin-bottom: 17px;
}

.inline-select-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.inline-create-box {
    padding: 15px;
    background: #f8fbff;
    border: 1px solid #d9e7f4;
    border-radius: 15px;
    margin: 12px 0;
}

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

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

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.settle-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settle-form input {
    min-width: 125px;
    flex: 1;
}

.table-scroll.compact table {
    min-width: 580px;
}

/* ======================================
   SETTINGS AND USERS
====================================== */

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

.settings-panel {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    min-width: 0;
}

.settings-panel h3 {
    margin: 0 0 17px;
}

.settings-panel form {
    display: grid;
    gap: 12px;
}

.users-list {
    max-height: 370px;
    overflow: auto;
}

.user-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 13px;
    margin-bottom: 10px;
    background: #f8fafd;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.user-line small {
    display: block;
    color: var(--muted);
}

.user-line form {
    display: inline-block;
    margin: 0 3px;
}

/* ======================================
   ADVANCED FINANCIAL CENTER
====================================== */

.hero {
    padding: 27px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 20px;
}

.v3stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin: 17px 0 25px;
}

.v3tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.v3tile strong {
    display: block;
    font-size: 30px;
    font-weight: 900;
    color: #234d71;
}

.v3tile span {
    display: block;
    margin-top: 7px;
    color: #76879a;
}

.v3panel {
    padding: 25px;
    margin-bottom: 21px;
}

.v3panel > h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 15px;
    color: #173653;
    font-size: 21px;
}

.v3form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 15px;
    margin: 17px 0;
}

.v3actions,
.v3inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.v3table table {
    min-width: 720px;
}

.v3table input {
    min-width: 95px;
}

#accounts {
    border-right: 6px solid #358ecc;
    background: linear-gradient(180deg, #f6fbff, #fff);
}

#projects {
    border-right: 6px solid #21ae7b;
    background: linear-gradient(180deg, #f3fff8, #fff);
}

#allocate {
    border-right: 6px solid #eca52b;
    background: linear-gradient(180deg, #fff9ef, #fff);
}

#payroll {
    border-right: 6px solid #a066e7;
    background: linear-gradient(180deg, #faf5ff, #fff);
}

#journal {
    border-right: 6px solid #5379df;
    background: linear-gradient(180deg, #f4f7ff, #fff);
}

#requests {
    border-right: 6px solid #f18039;
    background: linear-gradient(180deg, #fff7f1, #fff);
}

#audit {
    border-right: 6px solid #33465d;
    background: linear-gradient(180deg, #f7f9fc, #fff);
}

/* ======================================
   INVOICES
====================================== */

.invoice-links {
    margin-top: 20px;
}

.invoice-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px 16px;
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 9px;
}

.invoice-entry a {
    color: #2568b9;
    font-weight: 700;
}

.file-attach {
    cursor: pointer;
    padding: 8px;
    background: #ecf4ff;
    color: #2864a5;
    border-radius: 9px;
    font-size: 12px;
}

/* ======================================
   AUTHENTICATION
====================================== */

.auth {
    max-width: 480px;
    padding: 34px;
    margin: 7vh auto;
}

.auth h1 {
    font-size: 28px;
    margin: 8px 0;
}

.auth form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

/* ======================================
   ALERTS
====================================== */

.flash {
    padding: 14px 17px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid #c1ead0;
    background: #edfff3;
    color: #176d3c;
}

.flash.success {
    background: #edfff3;
    color: #176d3c;
}

.flash.error {
    background: #fff0f0;
    color: #ad3344;
    border-color: #f0c3c7;
}

/* ======================================
   DATE SELECTORS
====================================== */

.date-selectors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
}

.date-selectors select {
    min-width: 0;
    padding: 8px 5px;
    font-size: 12px;
}

.date-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ======================================
   MODAL
====================================== */

dialog {
    width: min(840px, calc(100vw - 30px));
    max-height: 90vh;
    overflow-y: auto;
    border: none;
    border-radius: 22px;
    padding: 25px;
    box-shadow: 0 25px 90px rgba(13, 24, 44, 0.3);
}

dialog::backdrop {
    background: rgba(10, 20, 38, 0.7);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 0;
}

.close {
    border: none;
    background: transparent;
    font-size: 30px;
    color: #697b90;
}

/* ======================================
   FOOTER
====================================== */

footer {
    text-align: center;
    font-size: 12px;
    color: #77879a;
    padding: 24px 12px 35px;
}

/* ======================================
   TABLET
====================================== */

@media (max-width: 1100px) {

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

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

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

    .chart-row {
        grid-template-columns: 1.5fr 1fr;
    }

    .brand-logo {
        width: 115px;
    }

    .brand-copy b {
        font-size: 23px;
    }
}

/* ======================================
   MOBILE
====================================== */

@media (max-width: 720px) {

    html {
        scroll-padding-top: 125px;
    }

    body {
        font-size: 13px;
    }

    .topbar {
        min-height: 75px;
        padding: 10px 13px;
        gap: 9px;
    }

    .brand,
    .brand-rich {
        gap: 9px;
    }

    .brand-logo {
        width: 76px;
    }

    .brand-copy b {
        font-size: 16px;
    }

    .brand-copy small {
        font-size: 9px;
        line-height: 1.5;
    }

    .head-actions {
        gap: 5px;
    }

    .user-chip {
        display: none;
    }

    .head-actions .btn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .container {
        padding: 15px 12px 35px;
    }

    .quick-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 9px;
    }

    .quick-nav a {
        padding: 10px 6px;
        font-size: 11px;
        text-align: center;
    }

    .page-heading,
    .hero {
        padding: 17px;
    }

    .page-heading h1,
    .hero h1 {
        font-size: 24px;
    }

    .filter-box form,
    .form-grid,
    .settings-grid,
    .chart-row,
    .v3form,
    .mini-form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full,
    .mini-form-grid .full {
        grid-column: auto;
    }

    .stats,
    .receivables-strip,
    .v3stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .stat,
    .mini-kpi,
    .v3tile {
        padding: 14px;
        min-height: 105px;
    }

    .stat-num {
        font-size: 21px;
    }

    .mini-kpi strong {
        font-size: 18px;
    }

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

    .drawer summary {
        padding: 15px;
        font-size: 15px;
    }

    .drawer summary small {
        display: block;
        margin: 4px 0;
        font-size: 10px;
    }

    .drawer-body,
    .v3panel {
        padding: 14px;
    }

    .drawer > summary > span:first-child::before,
    .v3panel > h2::before,
    .hero h1::before {
        width: 34px;
        height: 34px;
    }

    .list-toolbar {
        flex-direction: column;
    }

    .inline-select-actions {
        grid-template-columns: 1fr;
    }

    .inline-select-actions .btn {
        width: 100%;
    }

    .table-scroll,
    .v3table {
        overflow-x: auto;
    }

    .table-scroll table,
    .v3table table {
        min-width: 700px;
    }

    .chart-card,
    .summary-side {
        padding: 16px;
    }

    .chart {
        height: 190px;
    }

    .user-line,
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        padding: 8px;
    }

    .auth {
        margin: 20px auto;
        padding: 22px;
    }

    .v3panel > h2 {
        font-size: 17px;
    }
}

/* ======================================
   SMALL MOBILE SCREENS
====================================== */

@media (max-width: 390px) {

    .brand-logo {
        width: 61px;
    }

    .brand-copy b {
        font-size: 14px;
    }

    .stats,
    .receivables-strip {
        grid-template-columns: 1fr;
    }

    .quick-nav a {
        font-size: 10px;
    }

    .date-selectors {
        gap: 3px;
    }
}

/* ======================================
   ACCESSIBILITY
====================================== */

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