:root {
    --bg: #080a0e;
    --panel: #10141a;
    --panel-2: #141920;

    --text: #f0f3f7;
    --muted: #9099a6;
    --muted-2: #66717e;

    --line: rgba(255,255,255,.075);
    --line-2: rgba(255,255,255,.14);

    --accent: #82aaff;
    --accent-2: #b0c8ff;

    --success: #71d7a3;
    --warning: #e9bb72;
    --danger: #ed777d;

    --radius: 17px;
    --ease: cubic-bezier(.22,.61,.36,1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(130,170,255,.055),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);
    font-family: "DM Sans", sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

body.light-theme {
    --bg: #edf1f6;
    --panel: #ffffff;
    --panel-2: #f7f9fc;
    --text: #171d25;
    --muted: #63707d;
    --muted-2: #89939e;
    --line: rgba(15,20,28,.08);
    --line-2: rgba(15,20,28,.14);
}

/* APP */

.app {
    min-height: 100vh;
}

.main {
    margin-left: 270px;
    min-width: 0;
}

/* SIDEBAR */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    width: 270px;

    padding: 20px 14px;

    display: flex;
    flex-direction: column;

    z-index: 1000;

    background:
        linear-gradient(
            180deg,
            #10151b,
            #090c10
        );

    border-right: 1px solid var(--line);
}

.brand {
    min-height: 65px;
    padding: 0 8px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 39px;
    height: 39px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    color: var(--accent-2);
    background: rgba(130,170,255,.10);
    border: 1px solid rgba(130,170,255,.2);

    font-weight: 800;
}

.brand div:last-child {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    letter-spacing: .12em;
}

.brand small {
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 7px;
    letter-spacing: .18em;
}

.workspace {
    margin: 17px 2px 17px;
    padding: 11px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: rgba(255,255,255,.025);
}

.workspace-avatar {
    width: 33px;
    height: 33px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: rgba(130,170,255,.08);
    color: var(--accent);

    font-size: 9px;
    font-weight: 800;
}

.workspace div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workspace small {
    color: var(--muted-2);
    font-size: 7px;
    letter-spacing: .13em;
}

.workspace strong {
    font-size: 10px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

nav {
    display: grid;
    gap: 4px;
}

.nav-link {
    min-height: 43px;
    padding: 0 12px;

    display: flex;
    align-items: center;
    gap: 11px;

    border: 1px solid transparent;
    border-radius: 10px;

    color: var(--muted);

    font-size: 10px;

    transition:
        transform .25s var(--ease),
        color .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.nav-link:hover {
    transform: translateX(3px);
    color: var(--text);
    background: rgba(255,255,255,.035);
}

.nav-link.active {
    color: var(--text);
    background: rgba(130,170,255,.085);
    border-color: rgba(130,170,255,.12);
}

.nav-link.active span {
    color: var(--accent);
}

.nav-link span {
    width: 20px;
    text-align: center;
    color: var(--muted-2);
}

.sidebar-bottom {
    margin-top: auto;
    padding: 13px 11px;

    display: flex;
    align-items: flex-start;
    gap: 9px;

    border-radius: 11px;
    border: 1px solid rgba(113,215,163,.08);
    background: rgba(113,215,163,.025);
}

.status-dot {
    width: 7px;
    height: 7px;

    margin-top: 4px;

    border-radius: 50%;

    background: var(--success);
    box-shadow: 0 0 13px rgba(113,215,163,.4);
}

.sidebar-bottom div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-bottom strong {
    font-size: 9px;
}

.sidebar-bottom small {
    color: var(--muted-2);
    font-size: 7px;
}

/* TOPBAR */

.topbar {
    height: 82px;

    position: sticky;
    top: 0;
    z-index: 900;

    padding: 0 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);

    background: rgba(8,10,14,.83);
    backdrop-filter: blur(18px);
}

body.light-theme .topbar {
    background: rgba(237,241,246,.82);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 9px;
    color: var(--muted-2);
}

.breadcrumb strong {
    color: var(--text);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.top-actions button,
.profile {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: rgba(255,255,255,.025);
    border: 1px solid var(--line);

    color: var(--muted);

    transition:
        transform .25s var(--ease),
        color .2s ease,
        border-color .2s ease,
        background .2s ease;
}

.top-actions button:hover {
    transform: translateY(-2px);
    color: var(--text);
    border-color: var(--line-2);
    background: rgba(255,255,255,.05);
}

.profile {
    border-radius: 50%;
    color: var(--accent-2);
    background: #1b293d;
}

/* CONTENT */

.content {
    width: min(1500px, calc(100% - 64px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: page-in .4s var(--ease) both;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.heading {
    margin-bottom: 29px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 25px;
}

.eyebrow {
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .18em;
    font-weight: 700;
}

h1,
h2,
h3,
strong {
    font-family: "Manrope", sans-serif;
}

h1 {
    margin: 9px 0 0;

    font-size: clamp(36px, 4vw, 54px);
    line-height: 1;

    letter-spacing: -.05em;
}

h1 em {
    color: var(--accent-2);
    font-style: normal;
}

.heading p {
    max-width: 530px;
    margin: 11px 0 0;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.heading-actions {
    display: flex;
    gap: 8px;
}

/* BUTTONS */

.button {
    min-height: 42px;
    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 9px;
    font-weight: 600;

    transition:
        transform .25s var(--ease),
        box-shadow .25s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent-2);
    color: #07111e;

    box-shadow:
        0 9px 28px rgba(130,170,255,.08);
}

.button.secondary {
    border: 1px solid var(--line);
    background: rgba(255,255,255,.025);
    color: var(--muted);
}

/* METRICS */

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
}

.metric {
    min-height: 158px;
    padding: 18px;

    position: relative;
    overflow: hidden;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.012)
        );

    transition:
        transform .35s var(--ease),
        box-shadow .35s var(--ease),
        border-color .25s ease;
}

.metric::after {
    content: "";

    position: absolute;

    width: 160px;
    height: 160px;

    right: -75px;
    top: -80px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(130,170,255,.09),
            transparent 68%
        );
}

.metric:hover {
    transform: translateY(-5px);
    border-color: var(--line-2);
    box-shadow: var(--shadow);
}

.metric > span {
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .14em;
}

.metric strong {
    display: block;
    margin-top: 24px;
    font-size: 31px;
    letter-spacing: -.045em;
}

.metric small {
    display: block;
    margin-top: 13px;
    color: var(--muted-2);
    font-size: 8px;
}

.metric.accent {
    background:
        linear-gradient(
            145deg,
            rgba(130,170,255,.075),
            rgba(255,255,255,.012)
        );
}

/* GRID */

.grid {
    display: grid;
    grid-template-columns: 1.55fr .85fr;
    gap: 13px;
    margin-top: 13px;
}

.grid.lower {
    grid-template-columns: 1.35fr .75fr;
}

.panel {
    min-width: 0;
    padding: 20px;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.03),
            rgba(255,255,255,.014)
        );

    box-shadow:
        0 10px 40px rgba(0,0,0,.08);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.panel h2 {
    margin: 6px 0 0;
    font-size: 21px;
}

.text-button {
    padding: 4px 0;
    background: transparent;
    color: var(--accent);
    font-size: 8px;
}

/* CHART */

.chart {
    height: 280px;
    margin-top: 18px;
    position: relative;

    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.chart::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 55px,
            rgba(255,255,255,.045) 56px
        );
}

.chart-line {
    position: absolute;

    left: -5%;
    right: -5%;

    top: 47%;

    height: 3px;

    border-radius: 50%;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--accent),
            transparent
        );

    transform:
        rotate(-7deg);
    filter: blur(.2px);
}

.chart-bars {
    position: absolute;

    inset: 20px 10px 0;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;
}

.chart-bars i {
    width: 8%;
    min-height: 15px;

    border-radius: 6px 6px 0 0;

    background:
        linear-gradient(
            to top,
            rgba(130,170,255,.13),
            rgba(130,170,255,.55)
        );

    transform-origin: bottom;

    animation: bar-in .9s var(--ease) both;
}

.chart-bars i:nth-child(2) { animation-delay: .05s; }
.chart-bars i:nth-child(3) { animation-delay: .10s; }
.chart-bars i:nth-child(4) { animation-delay: .15s; }
.chart-bars i:nth-child(5) { animation-delay: .20s; }
.chart-bars i:nth-child(6) { animation-delay: .25s; }
.chart-bars i:nth-child(7) { animation-delay: .30s; }
.chart-bars i:nth-child(8) { animation-delay: .35s; }

@keyframes bar-in {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* ATTENTION */

.count {
    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(235,119,125,.08);
    color: var(--danger);
    font-size: 8px;
}

.attention-row {
    width: 100%;

    padding: 14px 0;

    display: grid;
    grid-template-columns: 29px 1fr auto;
    gap: 10px;

    align-items: center;

    text-align: left;

    background: transparent;
    border-top: 1px solid var(--line);

    transition:
        transform .25s var(--ease),
        padding-left .25s var(--ease);
}

.attention-row:hover {
    transform: translateX(4px);
    padding-left: 3px;
}

.attention-row > span:first-child {
    width: 27px;
    height: 27px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    font-size: 9px;
}

.danger {
    color: var(--danger);
}

.warning {
    color: var(--warning);
}

.neutral {
    color: var(--accent);
}

.attention-row > span {
    background: rgba(255,255,255,.035);
}

.attention-row div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attention-row strong {
    font-size: 9px;
}

.attention-row small {
    color: var(--muted-2);
    font-size: 7px;
}

.attention-row b {
    color: var(--muted-2);
}

/* TRANSACTIONS */

.transactions {
    margin-top: 16px;
}

.transaction {
    min-height: 61px;

    display: grid;
    grid-template-columns: 31px 1fr auto;

    align-items: center;
    gap: 10px;

    border-top: 1px solid var(--line);
}

.transaction-icon {
    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    border-radius: 8px;
    font-size: 8px;
    font-weight: 800;
}

.transaction-icon.income {
    background: rgba(113,215,163,.08);
    color: var(--success);
}

.transaction-icon.expense {
    background: rgba(233,187,114,.08);
    color: var(--warning);
}

.transaction div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction strong {
    font-size: 9px;
}

.transaction small {
    color: var(--muted-2);
    font-size: 7px;
}

.positive {
    color: var(--success);
    font-size: 9px;
}

.negative {
    color: var(--danger);
    font-size: 9px;
}

/* SHORTCUTS */

.shortcuts {
    margin-top: 15px;
    display: grid;
    gap: 8px;
}

.shortcut {
    min-height: 62px;
    padding: 11px;

    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: center;

    border-radius: 10px;
    border: 1px solid var(--line);

    background: rgba(255,255,255,.018);

    text-align: left;

    transition:
        transform .27s var(--ease),
        background .23s ease,
        border-color .23s ease;
}

.shortcut:hover {
    transform: translateX(4px);
    background: rgba(255,255,255,.035);
    border-color: var(--line-2);
}

.shortcut > span {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: rgba(130,170,255,.07);
    color: var(--accent);
}

.shortcut div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shortcut strong {
    font-size: 9px;
}

.shortcut small {
    color: var(--muted-2);
    font-size: 7px;
}

/* PLACEHOLDERS */

.workspace-placeholder {
    min-height: 400px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    border: 1px dashed rgba(255,255,255,.11);
    border-radius: var(--radius);

    background:
        radial-gradient(
            circle at center,
            rgba(130,170,255,.04),
            transparent 42%
        );
}

.workspace-placeholder > div {
    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    border-radius: 16px;

    background: rgba(130,170,255,.05);
    color: var(--accent);

    font-size: 20px;
}

.workspace-placeholder h2 {
    margin: 18px 0 0;
    font-size: 24px;
}

.workspace-placeholder p {
    max-width: 400px;
    margin-top: 8px;
    font-size: 9px;
}

/* SETTINGS */

.settings {
    display: grid;
    gap: 9px;
}

.settings button {
    width: 100%;

    padding: 17px 18px;

    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: rgba(255,255,255,.018);

    text-align: left;

    transition:
        transform .27s var(--ease),
        border-color .23s ease,
        background .23s ease;
}

.settings button:hover {
    transform: translateX(4px);
    border-color: var(--line-2);
    background: rgba(255,255,255,.035);
}

.settings button > span {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;
    background: rgba(130,170,255,.07);
    color: var(--accent);
}

.settings button div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings button strong {
    font-size: 9px;
}

.settings button small {
    color: var(--muted-2);
    font-size: 7px;
}

.settings button b {
    color: var(--muted-2);
}

/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1800;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(2,3,5,.7);
    backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    width: min(640px,100%);

    padding: 31px;

    position: relative;

    border-radius: 19px;
    border: 1px solid var(--line-2);

    background:
        linear-gradient(
            145deg,
            #171d24,
            #0b0f13
        );

    box-shadow:
        0 40px 100px rgba(0,0,0,.48);

    transform:
        translateY(17px)
        scale(.985);

    transition:
        transform .36s var(--ease);
}

.modal-overlay.open .modal {
    transform:
        translateY(0)
        scale(1);
}

.modal-close {
    position: absolute;
    top: 13px;
    right: 13px;

    width: 33px;
    height: 33px;

    border-radius: 9px;

    border: 1px solid var(--line);
    background: rgba(255,255,255,.035);

    color: var(--muted);
    font-size: 18px;
}

.modal h2 {
    margin: 8px 0 0;
    font-size: 32px;
}

.modal input {
    width: 100%;
    height: 55px;

    margin-top: 25px;

    padding: 0 15px;

    border: 1px solid var(--line);
    border-radius: 11px;

    background: rgba(0,0,0,.2);
    color: var(--text);

    outline: none;
}

.modal input:focus {
    border-color: rgba(130,170,255,.34);
}

.modal small {
    display: block;
    margin-top: 11px;
    color: var(--muted-2);
    font-size: 7px;
}

/* NOTIFICATION */

.notification-panel {
    position: fixed;
    top: 72px;
    right: 25px;
    z-index: 1600;

    width: min(350px,calc(100% - 30px));

    padding: 18px;

    border-radius: 16px;
    border: 1px solid var(--line-2);

    background: rgba(15,19,24,.98);

    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
        opacity .25s ease,
        visibility .25s ease,
        transform .25s var(--ease);
}

.notification-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-head {
    padding-bottom: 12px;

    display: flex;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}

.notification-head h3 {
    margin: 5px 0 0;
    font-size: 17px;
}

.notification-head button {
    width: 28px;
    height: 28px;

    border-radius: 8px;

    background: rgba(255,255,255,.035);
    color: var(--muted);
}

.notification {
    padding: 13px 0;

    display: grid;
    grid-template-columns: 29px 1fr;
    gap: 10px;

    border-bottom: 1px solid var(--line);
}

.notification:last-child {
    border-bottom: 0;
}

.notification > span {
    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: rgba(255,255,255,.03);
}

.notification div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification strong {
    font-size: 9px;
}

.notification small {
    color: var(--muted-2);
    font-size: 7px;
}

/* TOAST */

.toast {
    position: fixed;
    left: 50%;
    bottom: 25px;
    z-index: 1900;

    padding: 12px 16px;

    border-radius: 10px;
    border: 1px solid var(--line-2);

    background: rgba(10,13,17,.96);
    color: var(--text);

    font-size: 9px;

    opacity: 0;

    pointer-events: none;

    transform:
        translate(-50%, 15px);

    transition:
        opacity .25s ease,
        transform .25s var(--ease);
}

.toast.show {
    opacity: 1;
    transform:
        translate(-50%, 0);
}

/* RESPONSIVE */

@media (max-width: 1180px) {

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

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

@media (max-width: 850px) {

    .sidebar {
        transform: translateX(-100%);
        transition: transform .35s var(--ease);
    }

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

    .main {
        margin-left: 0;
    }

    .mobile-overlay {
        display: block;
    }

    .content {
        width: min(100% - 30px,1500px);
    }
}

@media (max-width: 600px) {

    .topbar {
        height: 70px;
        padding: 0 15px;
    }

    .content {
        padding-top: 25px;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

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

    .heading-actions {
        width: 100%;
    }

    .heading-actions .button {
        flex: 1;
    }

    .transaction {
        grid-template-columns: 31px 1fr auto;
    }

    .notification-panel {
        right: 15px;
    }
}

/* ============================================================
   LEDGER — TRANSACTIONS MODULE
   ============================================================ */

.transactions-shell {
    display: grid;
    gap: 14px;
}

.transaction-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
}

.transaction-summary-card {
    min-height: 106px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.012)
        );
}

.transaction-summary-card span {
    display: block;
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.transaction-summary-card strong {
    display: block;
    margin-top: 14px;
    font-size: 23px;
    letter-spacing: -.035em;
}

.transaction-summary-card.income strong {
    color: var(--success);
}

.transaction-summary-card.expense strong {
    color: var(--danger);
}

.transaction-summary-card.net strong {
    color: var(--accent-2);
}

.transaction-summary-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 7px;
}

.transactions-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-search {
    flex: 1 1 260px;
    min-width: 190px;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: rgba(255,255,255,.025);
    color: var(--text);
    font-size: 9px;
    transition:
        border-color .2s ease,
        background .2s ease;
}

.transaction-search::placeholder {
    color: var(--muted-2);
}

.transaction-search:focus {
    border-color: rgba(130,170,255,.35);
    background: rgba(255,255,255,.04);
}

.transaction-filter {
    height: 42px;
    min-width: 120px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: rgba(255,255,255,.025);
    color: var(--muted);
    font-size: 8px;
}

.transaction-filter:focus {
    border-color: rgba(130,170,255,.35);
}

.transactions-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.028),
            rgba(255,255,255,.012)
        );
}

.transactions-table {
    width: 100%;
    min-width: 890px;
    border-collapse: collapse;
}

.transactions-table thead {
    background: rgba(255,255,255,.018);
}

.transactions-table th {
    height: 49px;
    padding: 0 14px;
    text-align: left;
    color: var(--muted-2);
    border-bottom: 1px solid var(--line);
    font-size: 7px;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.transactions-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.transactions-table tbody tr {
    transition:
        background .2s ease,
        transform .2s var(--ease);
}

.transactions-table tbody tr:hover {
    background: rgba(255,255,255,.018);
}

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

.txn-date,
.txn-main,
.txn-main > div {
    display: flex;
    flex-direction: column;
}

.txn-date {
    gap: 4px;
    white-space: nowrap;
}

.txn-date strong {
    font-size: 8px;
}

.txn-date small {
    color: var(--muted-2);
    font-size: 7px;
}

.txn-main {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 235px;
}

.txn-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
}

.txn-icon.income {
    color: var(--success);
    background: rgba(113,215,163,.08);
}

.txn-icon.expense {
    color: var(--danger);
    background: rgba(237,119,125,.08);
}

.txn-main > div {
    min-width: 0;
    gap: 4px;
}

.txn-main strong {
    max-width: 260px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 9px;
}

.txn-main small {
    color: var(--muted-2);
    font-size: 7px;
}

.txn-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 25px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .04em;
}

.txn-type-badge.income {
    color: var(--success);
    background: rgba(113,215,163,.08);
}

.txn-type-badge.expense {
    color: var(--danger);
    background: rgba(237,119,125,.08);
}

.txn-payment {
    color: var(--muted);
    font-size: 8px;
    white-space: nowrap;
}

.txn-amount {
    display: inline-block;
    min-width: 104px;
    text-align: right;
    font-size: 9px;
}

.txn-amount.income {
    color: var(--success);
}

.txn-amount.expense {
    color: var(--danger);
}

.negative-value {
    color: var(--danger) !important;
}

.txn-actions-cell {
    width: 84px;
}

.txn-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.icon-action {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.025);
    color: var(--muted);
    transition:
        transform .2s var(--ease),
        color .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.icon-action:hover {
    transform: translateY(-2px);
    color: var(--text);
    border-color: var(--line-2);
    background: rgba(255,255,255,.05);
}

.icon-action.danger-action:hover {
    color: var(--danger);
    border-color: rgba(237,119,125,.25);
}

.transactions-empty {
    padding: 70px 20px;
    text-align: center;
}

.transactions-empty-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(130,170,255,.06);
    color: var(--accent);
    font-size: 18px;
}

.transactions-empty h3 {
    margin: 17px 0 0;
    font-size: 19px;
}

.transactions-empty p {
    max-width: 360px;
    margin: 8px auto 0;
    color: var(--muted-2);
    font-size: 8px;
    line-height: 1.6;
}

/* TRANSACTION MODAL */

.transaction-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: grid;
    place-items: center;

    padding: 18px;

    background: rgba(2,3,5,.74);
    backdrop-filter: blur(13px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.transaction-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.transaction-dialog {
    width: min(720px,100%);
    max-height: min(760px,calc(100vh - 36px));
    overflow: auto;

    padding: 25px;

    border: 1px solid var(--line-2);
    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #171d24,
            #0c1015
        );

    box-shadow:
        0 35px 100px rgba(0,0,0,.5);

    transform:
        translateY(15px)
        scale(.985);

    transition:
        transform .32s var(--ease);
}

.transaction-modal.open .transaction-dialog {
    transform:
        translateY(0)
        scale(1);
}

.transaction-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 21px;
}

.transaction-modal-head h2 {
    margin: 7px 0 0;
    font-size: 27px;
    letter-spacing: -.035em;
}

.transaction-modal-close {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: rgba(255,255,255,.03);
    color: var(--muted);

    font-size: 18px;
}

.transaction-form {
    display: grid;
    gap: 15px;
}

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

.form-field {
    display: grid;
    gap: 7px;
}

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

.form-field label {
    color: var(--muted-2);
    font-size: 7px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(255,255,255,.024);
    color: var(--text);

    outline: none;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.form-field input,
.form-field select {
    height: 43px;
    padding: 0 12px;
}

.form-field textarea {
    min-height: 86px;
    padding: 11px 12px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: rgba(130,170,255,.35);
    background: rgba(255,255,255,.038);
}

.transaction-type-switch {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 7px;
}

.transaction-type-option {
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.02);
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
}

.transaction-type-option.active-income {
    border-color: rgba(113,215,163,.25);
    background: rgba(113,215,163,.08);
    color: var(--success);
}

.transaction-type-option.active-expense {
    border-color: rgba(237,119,125,.25);
    background: rgba(237,119,125,.08);
    color: var(--danger);
}

.transaction-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

@media (max-width: 850px) {
    .transaction-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .transaction-summary {
        grid-template-columns: 1fr;
    }

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

    .form-field.full {
        grid-column: auto;
    }

    .transaction-dialog {
        padding: 19px;
    }

    .transaction-form-actions {
        flex-direction: column-reverse;
    }

    .transaction-form-actions .button {
        width: 100%;
    }
}

/* ============================================================
   LEDGER — CUSTOMERS MODULE
   ============================================================ */

.customers-shell {
    display: grid;
    gap: 14px;
}

.customer-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
}

.customer-summary-card {
    min-height: 106px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.012)
        );
}

.customer-summary-card span {
    display: block;
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.customer-summary-card strong {
    display: block;
    margin-top: 14px;
    font-size: 23px;
    letter-spacing: -.035em;
}

.customer-summary-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 7px;
}

.customers-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.customer-search {
    flex: 1 1 280px;
    min-width: 200px;
    height: 42px;
    padding: 0 13px;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.025);
    color: var(--text);

    font-size: 9px;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.customer-search::placeholder {
    color: var(--muted-2);
}

.customer-search:focus {
    border-color: rgba(130,170,255,.35);
    background: rgba(255,255,255,.04);
}

.customer-sort {
    height: 42px;
    min-width: 145px;
    padding: 0 11px;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.025);
    color: var(--muted);

    font-size: 8px;
}

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

.customer-card {
    min-width: 0;
    padding: 18px;

    border: 1px solid var(--line);
    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.034),
            rgba(255,255,255,.012)
        );

    transition:
        transform .3s var(--ease),
        border-color .25s ease,
        box-shadow .3s var(--ease);
}

.customer-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-2);
    box-shadow:
        0 17px 50px rgba(0,0,0,.15);
}

.customer-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.customer-avatar {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            rgba(130,170,255,.16),
            rgba(130,170,255,.045)
        );

    border: 1px solid rgba(130,170,255,.16);

    color: var(--accent-2);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.customer-card-actions {
    display: flex;
    gap: 5px;
}

.customer-identity {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;

    margin-top: 17px;
}

.customer-identity strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 13px;
    letter-spacing: -.02em;
}

.customer-identity small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: var(--muted-2);
    font-size: 7px;
}

.customer-status-row {
    margin-top: 15px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.customer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: 7px;
    font-weight: 700;
}

.customer-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: block;
    background: var(--muted-2);
}

.customer-status.active {
    color: var(--success);
}

.customer-status.active i {
    background: var(--success);
    box-shadow:
        0 0 8px rgba(113,215,163,.4);
}

.customer-status.inactive {
    color: var(--muted-2);
}

.customer-activity {
    color: var(--muted-2);
    font-size: 7px;
}

.customer-details {
    display: grid;
    gap: 10px;

    padding: 14px 0;
}

.customer-details > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.customer-details span {
    color: var(--muted-2);
    font-size: 6px;
    letter-spacing: .12em;
}

.customer-details strong {
    color: var(--muted);
    font-size: 8px;
    font-weight: 500;
}

.customer-details .truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.customer-card-footer {
    padding-top: 13px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 10px;

    border-top: 1px solid var(--line);
}

.customer-card-footer > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.customer-card-footer span {
    color: var(--muted-2);
    font-size: 7px;
}

.customer-card-footer strong {
    font-size: 11px;
}

.customer-edit-link {
    padding: 3px 0;
    background: transparent;
    border: 0;
    color: var(--accent);
    font-size: 7px;
}

.customer-edit-link:hover {
    color: var(--accent-2);
}

.customers-empty {
    padding: 70px 20px;
    text-align: center;

    border: 1px dashed rgba(255,255,255,.11);
    border-radius: 16px;

    background:
        radial-gradient(
            circle at center,
            rgba(130,170,255,.04),
            transparent 42%
        );
}

.customers-empty-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background: rgba(130,170,255,.06);
    color: var(--accent);

    font-size: 19px;
}

.customers-empty h3 {
    margin: 17px 0 0;
    font-size: 19px;
}

.customers-empty p {
    max-width: 390px;
    margin: 8px auto 0;

    color: var(--muted-2);

    font-size: 8px;
    line-height: 1.6;
}

/* CUSTOMER MODAL */

.customer-modal {
    position: fixed;
    inset: 0;
    z-index: 2050;

    display: grid;
    place-items: center;

    padding: 18px;

    background: rgba(2,3,5,.74);
    backdrop-filter: blur(13px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.customer-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.customer-dialog {
    width: min(720px,100%);
    max-height: min(760px,calc(100vh - 36px));
    overflow: auto;

    padding: 25px;

    border: 1px solid var(--line-2);
    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #171d24,
            #0c1015
        );

    box-shadow:
        0 35px 100px rgba(0,0,0,.5);

    transform:
        translateY(15px)
        scale(.985);

    transition:
        transform .32s var(--ease);
}

.customer-modal.open .customer-dialog {
    transform:
        translateY(0)
        scale(1);
}

.customer-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 21px;
}

.customer-modal-head h2 {
    margin: 7px 0 0;

    font-size: 27px;
    letter-spacing: -.035em;
}

.customer-modal-close {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: rgba(255,255,255,.03);
    color: var(--muted);

    font-size: 18px;
}

.customer-form {
    display: grid;
    gap: 15px;
}

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

.customer-form-field {
    display: grid;
    gap: 7px;
}

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

.customer-form-field label {
    color: var(--muted-2);
    font-size: 7px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.customer-form-field input,
.customer-form-field textarea {
    width: 100%;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(255,255,255,.024);
    color: var(--text);

    outline: none;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.customer-form-field input {
    height: 43px;
    padding: 0 12px;
}

.customer-form-field textarea {
    min-height: 82px;
    padding: 11px 12px;
    resize: vertical;
}

.customer-form-field input:focus,
.customer-form-field textarea:focus {
    border-color: rgba(130,170,255,.35);
    background: rgba(255,255,255,.038);
}

.customer-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

@media (max-width: 1180px) {
    .customers-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 850px) {
    .customer-summary {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 600px) {
    .customer-summary {
        grid-template-columns: 1fr;
    }

    .customers-grid {
        grid-template-columns: 1fr;
    }

    .customer-form-grid {
        grid-template-columns: 1fr;
    }

    .customer-form-field.full {
        grid-column: auto;
    }

    .customer-dialog {
        padding: 19px;
    }

    .customer-form-actions {
        flex-direction: column-reverse;
    }

    .customer-form-actions .button {
        width: 100%;
    }
}

/* ============================================================
   LEDGER — CUSTOMER READABILITY PATCH
   ============================================================ */

.customer-summary-card span {
    font-size: 9px;
}

.customer-summary-card strong {
    font-size: 27px;
}

.customer-summary-card small {
    font-size: 8px;
}

.customer-search {
    font-size: 10px;
}

.customer-search::placeholder {
    font-size: 10px;
}

.customer-sort {
    font-size: 9px;
}

.customer-identity strong {
    font-size: 16px;
}

.customer-identity small {
    font-size: 9px;
}

.customer-status {
    font-size: 8px;
}

.customer-activity {
    font-size: 8px;
}

.customer-details span {
    font-size: 7px;
}

.customer-details strong {
    font-size: 9px;
}

.customer-card-footer span {
    font-size: 8px;
}

.customer-card-footer strong {
    font-size: 13px;
}

.customer-edit-link {
    font-size: 8px;
}

.customer-card-actions .icon-action {
    font-size: 10px;
}

.customer-form-field label {
    font-size: 8px;
}

.customer-form-field input,
.customer-form-field textarea {
    font-size: 14px;
}

.customer-form-field input::placeholder,
.customer-form-field textarea::placeholder {
    font-size: 12px;
}

.customer-form-actions .button {
    font-size: 10px;
}

.customer-field-help {
    margin-top: -2px;
    color: var(--muted-2);
    font-size: 8px;
    line-height: 1.45;
}

.customer-dialog {
    font-size: 12px;
}

.customer-modal-head h2 {
    font-size: 30px;
}

.customer-modal-head .eyebrow {
    font-size: 9px;
}

.customers-empty h3 {
    font-size: 21px;
}

.customers-empty p {
    font-size: 9px;
}

.nav-link {
    font-size: 11px;
}

.workspace strong {
    font-size: 11px;
}

.breadcrumb {
    font-size: 10px;
}

.button {
    font-size: 10px;
}

/* ============================================================
   LEDGER — INVOICES MODULE
   ============================================================ */

.invoices-shell {
    display: grid;
    gap: 14px;
}

.invoice-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
}

.invoice-summary-card {
    min-height: 106px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.012)
        );
}

.invoice-summary-card span {
    display: block;
    color: var(--muted-2);
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.invoice-summary-card strong {
    display: block;
    margin-top: 14px;
    font-size: 26px;
    letter-spacing: -.035em;
}

.invoice-summary-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 8px;
}

.invoice-summary-card.paid strong {
    color: var(--success);
}

.invoice-summary-card.outstanding strong {
    color: var(--warning);
}

.invoice-summary-card.pending strong {
    color: var(--accent-2);
}

.invoices-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.invoice-search {
    flex: 1 1 270px;
    min-width: 210px;
    height: 43px;
    padding: 0 13px;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.025);
    color: var(--text);

    font-size: 10px;
}

.invoice-search::placeholder {
    color: var(--muted-2);
    font-size: 10px;
}

.invoice-filter {
    height: 43px;
    min-width: 135px;
    padding: 0 11px;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.025);
    color: var(--muted);

    font-size: 9px;
}

.invoices-table-wrap {
    overflow-x: auto;

    border: 1px solid var(--line);
    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.028),
            rgba(255,255,255,.012)
        );
}

.invoices-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.invoices-table th {
    height: 50px;
    padding: 0 14px;

    text-align: left;

    color: var(--muted-2);

    border-bottom: 1px solid var(--line);

    font-size: 7px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.invoices-table td {
    padding: 14px;

    border-bottom: 1px solid var(--line);

    vertical-align: middle;
}

.invoices-table tbody tr {
    transition:
        background .2s ease;
}

.invoices-table tbody tr:hover {
    background: rgba(255,255,255,.018);
}

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

.invoice-number,
.invoice-customer {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.invoice-number strong {
    font-size: 10px;
}

.invoice-number small,
.invoice-customer small {
    color: var(--muted-2);
    font-size: 8px;
}

.invoice-customer strong {
    font-size: 10px;
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 27px;
    padding: 0 9px;

    border-radius: 999px;

    font-size: 8px;
    font-weight: 700;
}

.invoice-status.paid {
    color: var(--success);
    background: rgba(113,215,163,.08);
}

.invoice-status.partial {
    color: var(--warning);
    background: rgba(233,187,114,.08);
}

.invoice-status.unpaid {
    color: var(--accent);
    background: rgba(130,170,255,.08);
}

.invoice-status.overdue {
    color: var(--danger);
    background: rgba(237,119,125,.08);
}

.invoice-total {
    font-size: 10px;
}

.invoice-balance {
    font-size: 9px;
}

.invoice-balance.due {
    color: var(--warning);
}

.invoice-balance.clear {
    color: var(--success);
}

.invoice-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.invoices-empty {
    padding: 70px 20px;
    text-align: center;

    border: 1px dashed rgba(255,255,255,.11);
    border-radius: 16px;

    background:
        radial-gradient(
            circle at center,
            rgba(130,170,255,.04),
            transparent 42%
        );
}

.invoices-empty-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background: rgba(130,170,255,.06);
    color: var(--accent);

    font-size: 18px;
}

.invoices-empty h3 {
    margin: 17px 0 0;
    font-size: 21px;
}

.invoices-empty p {
    max-width: 390px;
    margin: 8px auto 0;

    color: var(--muted-2);

    font-size: 9px;
    line-height: 1.6;
}

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

.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 2080;

    display: grid;
    place-items: center;

    padding: 18px;

    background: rgba(2,3,5,.76);
    backdrop-filter: blur(14px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.invoice-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.invoice-dialog {
    width: min(940px,100%);
    max-height: min(820px,calc(100vh - 36px));
    overflow: auto;

    padding: 26px;

    border: 1px solid var(--line-2);
    border-radius: 19px;

    background:
        linear-gradient(
            145deg,
            #171d24,
            #0b0f14
        );

    box-shadow:
        0 40px 110px rgba(0,0,0,.52);

    transform:
        translateY(15px)
        scale(.985);

    transition:
        transform .34s var(--ease);
}

.invoice-modal.open .invoice-dialog {
    transform:
        translateY(0)
        scale(1);
}

.invoice-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.invoice-modal-head h2 {
    margin: 7px 0 0;

    font-size: 30px;
    letter-spacing: -.04em;
}

.invoice-modal-close {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: rgba(255,255,255,.03);
    color: var(--muted);

    font-size: 18px;
}

.invoice-form {
    display: grid;
    gap: 15px;
}

.invoice-header-grid {
    display: grid;
    grid-template-columns:
        1fr 1.6fr 1fr 1fr;
    gap: 10px;
}

.invoice-field {
    display: grid;
    gap: 7px;
}

.invoice-field label {
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.invoice-field input,
.invoice-field select,
.invoice-field textarea {
    width: 100%;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.024);
    color: var(--text);

    font-size: 13px;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.invoice-field input,
.invoice-field select {
    height: 44px;
    padding: 0 12px;
}

.invoice-field textarea {
    min-height: 76px;
    padding: 11px 12px;
    resize: vertical;
}

.invoice-field input:focus,
.invoice-field select:focus,
.invoice-field textarea:focus {
    border-color: rgba(130,170,255,.35);
    background: rgba(255,255,255,.038);
}

.invoice-items-box {
    padding: 15px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: rgba(255,255,255,.014);
}

.invoice-items-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 10px;
}

.invoice-items-head h3 {
    margin: 0;
    font-size: 15px;
}

.invoice-add-item {
    min-height: 34px;
    padding: 0 11px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: rgba(130,170,255,.055);
    color: var(--accent);

    font-size: 8px;
}

.invoice-add-item:hover {
    border-color: var(--line-2);
    background: rgba(130,170,255,.085);
}

.invoice-items {
    display: grid;
    gap: 8px;
}

.invoice-item {
    display: grid;
    grid-template-columns:
        minmax(240px,1fr)
        85px
        120px
        120px
        34px;
    gap: 8px;
    align-items: end;

    padding: 10px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(255,255,255,.014);
}

.invoice-item-field {
    display: grid;
    gap: 6px;
}

.invoice-item-field label,
.invoice-item-total span {
    color: var(--muted-2);
    font-size: 7px;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.invoice-item-field input {
    height: 40px;
    width: 100%;

    padding: 0 10px;

    border: 1px solid var(--line);
    border-radius: 9px;

    outline: none;

    background: rgba(255,255,255,.024);
    color: var(--text);

    font-size: 11px;
}

.invoice-item-field input:focus {
    border-color: rgba(130,170,255,.35);
}

.invoice-item-total {
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.invoice-item-total strong {
    font-size: 10px;
}

.invoice-remove-item {
    width: 34px;
    height: 40px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: rgba(255,255,255,.02);
    color: var(--muted);

    font-size: 16px;
}

.invoice-remove-item:hover {
    color: var(--danger);
    border-color: rgba(237,119,125,.25);
}

.invoice-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 18px;
}

.invoice-notes {
    display: grid;
    gap: 7px;
}

.invoice-notes label {
    color: var(--muted-2);
    font-size: 8px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.invoice-notes textarea {
    width: 100%;
    min-height: 125px;

    padding: 12px;

    border: 1px solid var(--line);
    border-radius: 10px;

    outline: none;

    background: rgba(255,255,255,.024);
    color: var(--text);

    font-size: 12px;
    resize: vertical;
}

.invoice-totals {
    padding: 15px;

    border: 1px solid var(--line);
    border-radius: 13px;

    background: rgba(255,255,255,.018);
}

.invoice-total-row {
    min-height: 37px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid var(--line);

    color: var(--muted);
    font-size: 9px;
}

.invoice-total-row:last-child {
    border-bottom: 0;
}

.invoice-total-row strong {
    color: var(--text);
    font-size: 10px;
}

.invoice-total-row.grand {
    min-height: 53px;
    color: var(--text);
    font-size: 10px;
}

.invoice-total-row.grand strong {
    color: var(--accent-2);
    font-size: 19px;
}

.invoice-tax-control {
    width: 75px;
    height: 28px;

    padding: 0 7px;

    border: 1px solid var(--line);
    border-radius: 7px;

    outline: none;

    background: rgba(255,255,255,.025);
    color: var(--text);

    font-size: 9px;
}

.invoice-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    padding-top: 3px;
}

@media (max-width: 1180px) {

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

    .invoice-header-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

    .invoice-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {

    .invoice-item {
        grid-template-columns:
            1fr 90px 120px;
    }

    .invoice-item-total {
        grid-column: 1 / 2;
    }

    .invoice-remove-item {
        grid-column: 3;
        grid-row: 2;
    }
}

@media (max-width: 600px) {

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

    .invoice-header-grid {
        grid-template-columns: 1fr;
    }

    .invoice-item {
        grid-template-columns: 1fr 1fr;
    }

    .invoice-item-field.description {
        grid-column: 1 / -1;
    }

    .invoice-item-total {
        grid-column: 1 / 2;
    }

    .invoice-remove-item {
        grid-column: 2;
        grid-row: auto;
    }

    .invoice-dialog {
        padding: 19px;
    }

    .invoice-form-actions {
        flex-direction: column-reverse;
    }

    .invoice-form-actions .button {
        width: 100%;
    }
}

/* ============================================================
   LEDGER — LIVE DASHBOARD
   ============================================================ */

.dashboard-range {
    height: 42px;
    min-width: 150px;
    padding: 0 12px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(255,255,255,.025);
    color: var(--muted);

    outline: none;
    font-size: 9px;
}

.dashboard-range:focus {
    border-color: rgba(130,170,255,.35);
}

.metric-change {
    display: block;
    margin-top: 7px;
    font-size: 8px;
}

.positive-change {
    color: var(--success) !important;
}

.negative-change {
    color: var(--danger) !important;
}

.dashboard-chart-wrap {
    margin-top: 18px;
}

.dashboard-live-chart {
    height: 280px;
    padding: 18px 12px 8px;

    display: grid;
    grid-template-columns:
        repeat(12,minmax(0,1fr));

    align-items: end;
    gap: 8px;

    border-bottom: 1px solid var(--line);
    overflow: hidden;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 54px,
            rgba(255,255,255,.045) 55px
        );
}

.dashboard-bar-day {
    min-width: 0;
    height: 100%;

    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dashboard-bar-pair {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    gap: 3px;
}

.dashboard-bar {
    display: block;

    width: min(16px,38%);

    min-height: 4px;

    border-radius: 5px 5px 1px 1px;

    transform-origin: bottom;

    animation: dashboard-bar-in .65s var(--ease) both;
}

.dashboard-bar.income {
    background:
        linear-gradient(
            to top,
            rgba(113,215,163,.20),
            rgba(113,215,163,.72)
        );
}

.dashboard-bar.expense {
    background:
        linear-gradient(
            to top,
            rgba(237,119,125,.16),
            rgba(237,119,125,.62)
        );
}

@keyframes dashboard-bar-in {

    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.dashboard-chart-labels {
    margin-top: 7px;

    display: grid;
    grid-template-columns:
        repeat(12,minmax(0,1fr));

    gap: 8px;

    color: var(--muted-2);

    font-size: 7px;
    text-align: center;
}

.dashboard-chart-labels span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dashboard-recent {
    margin-top: 12px;
    display: grid;
}

.dashboard-recent-row {
    min-height: 63px;

    display: grid;
    grid-template-columns:
        34px 1fr auto;

    align-items: center;

    gap: 10px;

    border-top: 1px solid var(--line);
}

.dashboard-recent-icon {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    font-size: 11px;
    font-weight: 800;
}

.dashboard-recent-icon.income {
    background: rgba(113,215,163,.08);
    color: var(--success);
}

.dashboard-recent-icon.expense {
    background: rgba(237,119,125,.08);
    color: var(--danger);
}

.dashboard-recent-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-recent-info strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 9px;
}

.dashboard-recent-info small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: var(--muted-2);
    font-size: 7px;
}

.dashboard-recent-amount {
    font-size: 9px;
    white-space: nowrap;
}

.dashboard-recent-amount.income {
    color: var(--success);
}

.dashboard-recent-amount.expense {
    color: var(--danger);
}

.dashboard-empty-inline {
    padding: 35px 10px;

    text-align: center;

    color: var(--muted-2);
    font-size: 9px;
}

.dashboard-attention-good {
    min-height: 110px;

    display: flex;
    align-items: center;

    gap: 12px;

    color: var(--success);
}

.dashboard-attention-good > span {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: rgba(113,215,163,.08);

    font-size: 14px;
}

.dashboard-attention-good div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dashboard-attention-good strong {
    color: var(--text);
    font-size: 10px;
}

.dashboard-attention-good small {
    color: var(--muted-2);
    font-size: 8px;
}

.attention .count {
    min-width: 25px;
}

@media (max-width: 850px) {

    .dashboard-live-chart {
        height: 240px;
    }

    .dashboard-chart-labels {
        font-size: 6px;
    }
}

@media (max-width: 600px) {

    .dashboard-live-chart {
        height: 210px;
        gap: 4px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .dashboard-chart-labels {
        gap: 4px;
    }

    .dashboard-recent-row {
        grid-template-columns:
            32px 1fr auto;
    }
}

/* ============================================================
   LEDGER — ANALYTICS MODULE
   ============================================================ */

.analytics-page {
  width: 100%;
}

.analytics-shell {
  width: 100%;
}

.analytics-header {
  margin-bottom: 22px;
}

.analytics-header h1 {
  margin: 5px 0 7px;
}

.analytics-header p {
  margin: 0;
  opacity: 0.68;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.analytics-range-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-range-btn,
.analytics-refresh-btn {
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(127, 127, 127, 0.08);
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.analytics-range-btn:hover,
.analytics-refresh-btn:hover {
  transform: translateY(-1px);
}

.analytics-range-btn.active {
  border-color: currentColor;
  background: rgba(127, 127, 127, 0.16);
  font-weight: 700;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.analytics-kpi {
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 16px;
  padding: 17px;
  background: rgba(127, 127, 127, 0.055);
  min-width: 0;
}

.analytics-kpi span,
.analytics-kpi small {
  display: block;
  opacity: 0.66;
}

.analytics-kpi strong {
  display: block;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  margin: 9px 0 7px;
}

.analytics-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-card {
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 18px;
  padding: 18px;
  background: rgba(127, 127, 127, 0.045);
  min-width: 0;
}

.analytics-card-wide {
  min-height: 330px;
}

.analytics-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.analytics-card-header h2 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.analytics-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  opacity: 0.76;
}

.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.analytics-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: currentColor;
}

.analytics-dot-revenue {
  opacity: 1;
}

.analytics-dot-expense {
  opacity: 0.45;
}

.analytics-chart-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.analytics-trend-chart {
  min-width: 520px;
  height: 220px;
  display: flex;
  align-items: stretch;
  gap: 13px;
  padding: 10px 6px 0;
}

.analytics-month {
  min-width: 42px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.analytics-month-bars {
  height: 185px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid rgba(127, 127, 127, 0.15);
}

.analytics-bar {
  width: 11px;
  min-height: 3px;
  border-radius: 7px 7px 2px 2px;
  background: currentColor;
  transition: height 300ms ease;
}

.analytics-revenue-bar {
  opacity: 0.95;
}

.analytics-expense-bar {
  opacity: 0.34;
}

.analytics-month-label {
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.58;
  padding-top: 7px;
}

.analytics-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.analytics-rank-row {
  min-width: 0;
}

.analytics-rank-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.analytics-rank-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-rank-top strong {
  flex: none;
}

.analytics-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
  overflow: hidden;
}

.analytics-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.75;
}

.analytics-rank-meta {
  margin-top: 5px;
  font-size: 0.76rem;
  opacity: 0.52;
}

.analytics-empty,
.analytics-error {
  padding: 28px 14px;
  text-align: center;
  opacity: 0.65;
}

.analytics-error {
  border: 1px solid rgba(180, 70, 70, 0.32);
  border-radius: 14px;
  text-align: left;
}

.analytics-error p {
  margin-bottom: 0;
}

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

.analytics-mini-stat {
  border: 1px solid rgba(127, 127, 127, 0.13);
  border-radius: 13px;
  padding: 14px;
  background: rgba(127, 127, 127, 0.045);
}

.analytics-mini-stat span {
  display: block;
  opacity: 0.58;
  font-size: 0.78rem;
}

.analytics-mini-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.08rem;
}

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

.analytics-insight {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(127, 127, 127, 0.055);
  border: 1px solid rgba(127, 127, 127, 0.13);
}

.analytics-insight-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(127, 127, 127, 0.12);
}

.analytics-insight strong {
  display: block;
  margin-bottom: 4px;
}

.analytics-insight p {
  margin: 0;
  opacity: 0.64;
  line-height: 1.45;
  font-size: 0.86rem;
}

.analytics-footer-note {
  margin-top: 13px;
  text-align: right;
  font-size: 0.75rem;
  opacity: 0.48;
}

@media (max-width: 1050px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid-two {
    grid-template-columns: 1fr;
  }
}

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

  .analytics-card {
    padding: 15px;
  }

  .analytics-card-header {
    flex-direction: column;
  }

  .analytics-insights-grid {
    grid-template-columns: 1fr;
  }

  .analytics-invoice-grid {
    grid-template-columns: 1fr;
  }

  .analytics-footer-note {
    text-align: left;
  }
}

/* ============================================================
   LEDGER — GLOBAL SEARCH + DATA TOOLS
   ============================================================ */

.search-page,
.data-tools-page {
  width: 100%;
}

.search-shell,
.data-tools-shell {
  width: 100%;
}

.search-header,
.data-tools-header {
  margin-bottom: 22px;
}

.search-header h1,
.data-tools-header h1 {
  margin: 5px 0 7px;
}

.search-header p,
.data-tools-header p {
  margin: 0;
  opacity: 0.68;
}

.search-control-card,
.search-results-card,
.data-tool-card,
.data-integrity-card {
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 18px;
  background: rgba(127, 127, 127, 0.045);
}

.search-control-card {
  padding: 17px;
  margin-bottom: 16px;
}

.search-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
}

.search-input-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 12px;
  padding: 0 13px;
  background: rgba(127, 127, 127, 0.04);
}

.search-input-wrap span {
  font-size: 1.15rem;
  opacity: 0.58;
}

.search-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 12px 0;
  font: inherit;
  color: inherit;
}

.search-action-btn,
.search-clear-btn,
.data-tool-card button,
.data-upload-button {
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 11px;
  padding: 11px 15px;
  background: rgba(127, 127, 127, 0.09);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.search-action-btn:hover,
.search-clear-btn:hover,
.data-tool-card button:hover,
.data-upload-button:hover {
  transform: translateY(-1px);
  background: rgba(127, 127, 127, 0.15);
}

.search-filter-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    minmax(130px, 1fr)
    minmax(130px, 1fr);
  gap: 9px;
  margin-top: 11px;
}

.search-filter-row select,
.search-filter-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.05);
  color: inherit;
  font: inherit;
  padding: 10px 11px;
}

.search-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-filter-row label span {
  font-size: 0.72rem;
  opacity: 0.55;
}

.search-results-card {
  overflow: hidden;
}

.search-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 18px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.13);
}

.search-results-header h2 {
  margin: 4px 0 0;
  font-size: 1.06rem;
}

.search-results-header > strong {
  opacity: 0.6;
  font-size: 0.84rem;
}

.global-search-result {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.11);
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 14px 18px;
  cursor: pointer;
  font: inherit;
  transition:
    background 150ms ease,
    padding-left 150ms ease;
}

.global-search-result:hover {
  background: rgba(127, 127, 127, 0.06);
  padding-left: 22px;
}

.global-search-result:last-child {
  border-bottom: 0;
}

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(127, 127, 127, 0.12);
  font-weight: 800;
  font-size: 0.78rem;
}

.search-result-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.search-result-topline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-topline em {
  flex: none;
  font-size: 0.72rem;
  font-style: normal;
  opacity: 0.52;
}

.search-result-subtitle {
  opacity: 0.68;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  font-size: 0.75rem;
  opacity: 0.48;
}

.search-empty-state {
  padding: 45px 18px;
  text-align: center;
}

.search-empty-icon {
  font-size: 2rem;
  opacity: 0.32;
  margin-bottom: 6px;
}

.search-empty-state strong {
  display: block;
  margin-bottom: 5px;
}

.search-empty-state p {
  margin: 0;
  opacity: 0.58;
}

.search-note {
  margin-top: 11px;
  font-size: 0.75rem;
  opacity: 0.46;
}

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

.data-tool-card {
  padding: 19px;
  display: grid;
  gap: 12px;
}

.data-tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(127, 127, 127, 0.11);
  font-weight: 800;
}

.data-tool-card h2,
.data-integrity-card h2 {
  margin: 4px 0 5px;
  font-size: 1.05rem;
}

.data-tool-card p,
.data-integrity-card p {
  margin: 0;
  line-height: 1.5;
  opacity: 0.64;
  font-size: 0.88rem;
}

.data-upload-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
}

.data-integrity-card {
  padding: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.data-integrity-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.data-integrity-points span {
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(127, 127, 127, 0.08);
  font-size: 0.76rem;
  opacity: 0.7;
}

.ledger-data-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ledger-data-toast {
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(30, 30, 30, 0.92);
  color: white;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(8px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: 0.84rem;
}

.ledger-data-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .search-main-row {
    grid-template-columns: 1fr 1fr;
  }

  .search-input-wrap {
    grid-column: 1 / -1;
  }

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

  .data-integrity-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-integrity-points {
    justify-content: flex-start;
  }
}

@media (max-width: 650px) {
  .search-main-row {
    grid-template-columns: 1fr;
  }

  .search-filter-row {
    grid-template-columns: 1fr;
  }

  .data-tools-grid {
    grid-template-columns: 1fr;
  }

  .search-results-header,
  .search-result-topline {
    flex-direction: column;
  }

  .ledger-data-toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
   LEDGER — GLOBAL SEARCH + DATA TOOLS
   ============================================================ */

.search-page,
.data-tools-page {
  width: 100%;
}

.search-shell,
.data-tools-shell {
  width: 100%;
}

.search-header,
.data-tools-header {
  margin-bottom: 22px;
}

.search-header h1,
.data-tools-header h1 {
  margin: 5px 0 7px;
}

.search-header p,
.data-tools-header p {
  margin: 0;
  opacity: 0.68;
}

.search-control-card,
.search-results-card,
.data-tool-card,
.data-integrity-card {
  border: 1px solid rgba(127, 127, 127, 0.18);
  border-radius: 18px;
  background: rgba(127, 127, 127, 0.045);
}

.search-control-card {
  padding: 17px;
  margin-bottom: 16px;
}

.search-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
}

.search-input-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 12px;
  padding: 0 13px;
  background: rgba(127, 127, 127, 0.04);
}

.search-input-wrap span {
  font-size: 1.15rem;
  opacity: 0.58;
}

.search-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 12px 0;
  font: inherit;
  color: inherit;
}

.search-action-btn,
.search-clear-btn,
.data-tool-card button,
.data-upload-button {
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 11px;
  padding: 11px 15px;
  background: rgba(127, 127, 127, 0.09);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.search-action-btn:hover,
.search-clear-btn:hover,
.data-tool-card button:hover,
.data-upload-button:hover {
  transform: translateY(-1px);
  background: rgba(127, 127, 127, 0.15);
}

.search-filter-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    minmax(130px, 1fr)
    minmax(130px, 1fr);
  gap: 9px;
  margin-top: 11px;
}

.search-filter-row select,
.search-filter-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.05);
  color: inherit;
  font: inherit;
  padding: 10px 11px;
}

.search-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-filter-row label span {
  font-size: 0.72rem;
  opacity: 0.55;
}

.search-results-card {
  overflow: hidden;
}

.search-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 18px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.13);
}

.search-results-header h2 {
  margin: 4px 0 0;
  font-size: 1.06rem;
}

.search-results-header > strong {
  opacity: 0.6;
  font-size: 0.84rem;
}

.global-search-result {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.11);
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 14px 18px;
  cursor: pointer;
  font: inherit;
  transition:
    background 150ms ease,
    padding-left 150ms ease;
}

.global-search-result:hover {
  background: rgba(127, 127, 127, 0.06);
  padding-left: 22px;
}

.global-search-result:last-child {
  border-bottom: 0;
}

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(127, 127, 127, 0.12);
  font-weight: 800;
  font-size: 0.78rem;
}

.search-result-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.search-result-topline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-topline em {
  flex: none;
  font-size: 0.72rem;
  font-style: normal;
  opacity: 0.52;
}

.search-result-subtitle {
  opacity: 0.68;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  font-size: 0.75rem;
  opacity: 0.48;
}

.search-empty-state {
  padding: 45px 18px;
  text-align: center;
}

.search-empty-icon {
  font-size: 2rem;
  opacity: 0.32;
  margin-bottom: 6px;
}

.search-empty-state strong {
  display: block;
  margin-bottom: 5px;
}

.search-empty-state p {
  margin: 0;
  opacity: 0.58;
}

.search-note {
  margin-top: 11px;
  font-size: 0.75rem;
  opacity: 0.46;
}

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

.data-tool-card {
  padding: 19px;
  display: grid;
  gap: 12px;
}

.data-tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(127, 127, 127, 0.11);
  font-weight: 800;
}

.data-tool-card h2,
.data-integrity-card h2 {
  margin: 4px 0 5px;
  font-size: 1.05rem;
}

.data-tool-card p,
.data-integrity-card p {
  margin: 0;
  line-height: 1.5;
  opacity: 0.64;
  font-size: 0.88rem;
}

.data-upload-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
}

.data-integrity-card {
  padding: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.data-integrity-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.data-integrity-points span {
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(127, 127, 127, 0.08);
  font-size: 0.76rem;
  opacity: 0.7;
}

.ledger-data-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ledger-data-toast {
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(30, 30, 30, 0.92);
  color: white;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(8px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: 0.84rem;
}

.ledger-data-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .search-main-row {
    grid-template-columns: 1fr 1fr;
  }

  .search-input-wrap {
    grid-column: 1 / -1;
  }

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

  .data-integrity-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-integrity-points {
    justify-content: flex-start;
  }
}

@media (max-width: 650px) {
  .search-main-row {
    grid-template-columns: 1fr;
  }

  .search-filter-row {
    grid-template-columns: 1fr;
  }

  .data-tools-grid {
    grid-template-columns: 1fr;
  }

  .search-results-header,
  .search-result-topline {
    flex-direction: column;
  }

  .ledger-data-toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
   LEDGER — PAYMENT WORKFLOW
   ============================================================ */

.payments-page {
  width: 100%;
}

.payments-shell {
  width: 100%;
}

.payments-header {
  margin-bottom: 22px;
}

.payments-header h1 {
  margin: 5px 0 7px;
}

.payments-header p {
  margin: 0;
  opacity: 0.68;
}

.payments-kpi-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.payments-kpi {
  border: 1px solid rgba(127,127,127,.18);
  border-radius: 16px;
  padding: 17px;
  background: rgba(127,127,127,.045);
}

.payments-kpi span,
.payments-kpi small {
  display: block;
  opacity: .62;
}

.payments-kpi strong {
  display: block;
  font-size: 1.45rem;
  margin: 8px 0 6px;
}

.ledger-payments-card {
  border: 1px solid rgba(127,127,127,.18);
  border-radius: 18px;
  background: rgba(127,127,127,.045);
  overflow: hidden;
}

.ledger-payments-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(127,127,127,.12);
}

.ledger-payments-card-header h2 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.ledger-payments-card-header button,
.ledger-record-payment-btn {
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(127,127,127,.09);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ledger-record-payment-btn:hover,
.ledger-payments-card-header button:hover {
  transform: translateY(-1px);
  background: rgba(127,127,127,.15);
}

.ledger-payment-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ledger-payment-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ledger-payment-table th,
.ledger-payment-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(127,127,127,.1);
  vertical-align: middle;
}

.ledger-payment-table th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .55;
}

.ledger-payment-table td strong {
  display: block;
}

.ledger-payment-table td small {
  display: block;
  margin-top: 3px;
  opacity: .5;
  font-size: .72rem;
}

.ledger-payment-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(127,127,127,.11);
  font-size: .72rem;
  text-transform: capitalize;
}

.ledger-payment-status.partial {
  font-weight: 700;
}

.ledger-payment-status.overdue {
  font-weight: 700;
}

.ledger-payment-empty {
  padding: 40px 18px;
  text-align: center;
}

.ledger-payment-empty strong {
  display: block;
  margin-bottom: 6px;
}

.ledger-payment-empty p {
  margin: 0;
  opacity: .58;
}

.ledger-payment-note {
  margin-top: 11px;
  font-size: .76rem;
  opacity: .48;
}

.ledger-payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(5px);
}

.ledger-payment-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 20px;
  background: var(--surface, #fff);
  color: inherit;
  box-shadow: 0 25px 80px rgba(0,0,0,.24);
  padding: 20px;
}

.ledger-payment-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.ledger-payment-header h2 {
  margin: 4px 0 0;
}

.ledger-payment-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(127,127,127,.1);
  color: inherit;
  font-size: 1.45rem;
  cursor: pointer;
}

.ledger-payment-invoice-summary {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0,1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.ledger-payment-invoice-summary > div {
  border: 1px solid rgba(127,127,127,.13);
  border-radius: 12px;
  padding: 11px;
  background: rgba(127,127,127,.045);
}

.ledger-payment-invoice-summary span {
  display: block;
  font-size: .73rem;
  opacity: .55;
}

.ledger-payment-invoice-summary strong {
  display: block;
  margin-top: 5px;
}

.ledger-payment-form {
  display: grid;
  gap: 13px;
}

.ledger-payment-field {
  display: grid;
  gap: 6px;
}

.ledger-payment-field label {
  font-weight: 600;
  font-size: .84rem;
}

.ledger-payment-field input,
.ledger-payment-field select,
.ledger-payment-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(127,127,127,.22);
  border-radius: 11px;
  background: transparent;
  color: inherit;
  padding: 11px;
  font: inherit;
  outline: none;
}

.ledger-payment-field textarea {
  resize: vertical;
}

.ledger-payment-field small {
  opacity: .56;
}

.ledger-payment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 4px;
}

.ledger-payment-actions button {
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 11px;
  padding: 10px 14px;
  background: rgba(127,127,127,.09);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ledger-payment-actions .primary {
  font-weight: 700;
}

.ledger-payment-actions button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ledger-payment-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ledger-payment-toast {
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(30,30,30,.94);
  color: #fff;
  box-shadow: 0 15px 40px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: .84rem;
}

.ledger-payment-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 620px) {
  .ledger-payment-modal {
    padding: 15px;
  }

  .ledger-payment-invoice-summary {
    grid-template-columns:
      1fr;
  }

  .ledger-payment-actions {
    flex-direction: column-reverse;
  }

  .ledger-payment-actions button {
    width: 100%;
  }

  .ledger-payment-toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
   LEDGER — SETTINGS + BUSINESS CONFIGURATION
   ============================================================ */

.settings-page {
  width: 100%;
}

.settings-shell {
  width: 100%;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.settings-header h1 {
  margin: 5px 0 7px;
}

.settings-header p {
  margin: 0;
  opacity: .68;
}

.settings-save-state {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(127,127,127,.18);
  background: rgba(127,127,127,.06);
  font-size: .76rem;
  opacity: .65;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.settings-save-state.saving {
  opacity: .45;
}

.settings-save-state.saved {
  opacity: 1;
  transform: translateY(-1px);
}

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

.settings-card,
.settings-actions-card {
  border: 1px solid rgba(127,127,127,.18);
  border-radius: 18px;
  background: rgba(127,127,127,.045);
}

.settings-card {
  padding: 20px;
}

.settings-card-header {
  margin-bottom: 18px;
}

.settings-card-header h2,
.settings-actions-card h2 {
  margin: 4px 0 6px;
  font-size: 1.06rem;
}

.settings-card-header p,
.settings-actions-card p {
  margin: 0;
  opacity: .61;
  font-size: .86rem;
  line-height: 1.5;
}

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

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field > span {
  font-size: .8rem;
  font-weight: 650;
  opacity: .78;
}

.settings-field input,
.settings-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(127,127,127,.22);
  border-radius: 11px;
  background: transparent;
  color: inherit;
  padding: 11px;
  font: inherit;
  outline: none;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: currentColor;
}

.settings-span-2 {
  grid-column: 1 / -1;
}

.settings-preferences {
  display: grid;
  gap: 9px;
}

.settings-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border: 1px solid rgba(127,127,127,.13);
  border-radius: 13px;
  padding: 13px;
  background: rgba(127,127,127,.035);
}

.settings-toggle > span {
  min-width: 0;
}

.settings-toggle strong,
.settings-toggle small {
  display: block;
}

.settings-toggle strong {
  margin-bottom: 4px;
}

.settings-toggle small {
  opacity: .56;
  line-height: 1.4;
  font-size: .77rem;
}

.settings-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
}

.settings-inline-select {
  min-width: 170px;
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.settings-actions-card {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-actions button {
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 11px;
  padding: 10px 14px;
  background: rgba(127,127,127,.08);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease;
}

.settings-actions button:hover {
  transform: translateY(-1px);
  background: rgba(127,127,127,.14);
}

.settings-actions .primary {
  font-weight: 700;
}

.settings-footer-note {
  margin-top: 11px;
  font-size: .75rem;
  opacity: .46;
}

.ledger-settings-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100002;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ledger-settings-toast {
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(30,30,30,.94);
  color: white;
  box-shadow: 0 15px 40px rgba(0,0,0,.2);
  transform: translateY(8px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: .84rem;
}

.ledger-settings-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .settings-span-2 {
    grid-column: auto;
  }

  .settings-actions-card,
  .settings-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .settings-card {
    padding: 15px;
  }

  .settings-actions-card {
    padding: 15px;
  }

  .settings-actions {
    width: 100%;
  }

  .settings-actions button {
    width: 100%;
  }

  .settings-toggle {
    align-items: flex-start;
  }

  .settings-inline-select {
    min-width: 130px;
  }

  .ledger-settings-toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
   LEDGER — BATCH 11 / FULL UI UX POLISH
   ============================================================ */

:root {
  --ledger-motion-fast: 140ms;
  --ledger-motion: 190ms;
  --ledger-motion-slow: 280ms;

  --ledger-radius-sm: 9px;
  --ledger-radius-md: 12px;
  --ledger-radius-lg: 16px;
  --ledger-radius-xl: 20px;

  --ledger-shadow-soft:
    0 8px 28px rgba(0, 0, 0, 0.07);

  --ledger-shadow-medium:
    0 16px 48px rgba(0, 0, 0, 0.12);

  --ledger-focus:
    0 0 0 3px rgba(127, 127, 127, 0.17);
}

/* ------------------------------------------------------------
   GLOBAL READABILITY
   ------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

input::placeholder,
textarea::placeholder {
  opacity: .52;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--ledger-focus);
}

/* ------------------------------------------------------------
   PAGE MOTION
   ------------------------------------------------------------ */

.page {
  animation:
    ledgerPageIn
    260ms
    cubic-bezier(.2,.7,.2,1);
}

@keyframes ledgerPageIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------
   UNIVERSAL INTERACTION
   ------------------------------------------------------------ */

.analytics-card,
.analytics-kpi,
.search-control-card,
.search-results-card,
.data-tool-card,
.data-integrity-card,
.settings-card,
.settings-actions-card,
.ledger-payments-card,
.payments-kpi,
.ledger-payment-summary,
.customer-card,
.transaction-card,
.invoice-card {
  transition:
    transform var(--ledger-motion) ease,
    box-shadow var(--ledger-motion) ease,
    border-color var(--ledger-motion) ease,
    background var(--ledger-motion) ease;
}

.analytics-card:hover,
.analytics-kpi:hover,
.data-tool-card:hover,
.settings-card:hover,
.settings-actions-card:hover,
.payments-kpi:hover,
.ledger-payments-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--ledger-shadow-soft);
}

/* ------------------------------------------------------------
   BUTTON POLISH
   ------------------------------------------------------------ */

button,
[role="button"],
.data-upload-button,
.analytics-range-btn,
.analytics-refresh-btn,
.search-action-btn,
.search-clear-btn,
.data-tool-card button,
.settings-actions button,
.ledger-payments-card-header button,
.ledger-record-payment-btn {
  transition:
    transform var(--ledger-motion-fast) ease,
    opacity var(--ledger-motion-fast) ease,
    background var(--ledger-motion-fast) ease,
    border-color var(--ledger-motion-fast) ease,
    box-shadow var(--ledger-motion-fast) ease;
}

button:hover,
[role="button"]:hover,
.data-upload-button:hover {
  transform: translateY(-1px);
}

button:active,
[role="button"]:active,
.data-upload-button:active {
  transform: translateY(0) scale(.985);
}

button:disabled {
  transform: none !important;
}

/* ------------------------------------------------------------
   FORM CONTROL POLISH
   ------------------------------------------------------------ */

input,
select,
textarea {
  transition:
    border-color var(--ledger-motion-fast) ease,
    box-shadow var(--ledger-motion-fast) ease,
    background var(--ledger-motion-fast) ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(127, 127, 127, 0.34);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: var(--ledger-focus);
}

/* ------------------------------------------------------------
   MODAL BACKDROPS
   ------------------------------------------------------------ */

.ledger-payment-overlay,
.modal-overlay,
.modal-backdrop,
.overlay {
  animation:
    ledgerOverlayIn
    180ms
    ease;
}

@keyframes ledgerOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.ledger-payment-modal,
.modal,
.modal-dialog,
[role="dialog"] {
  animation:
    ledgerModalIn
    220ms
    cubic-bezier(.2,.75,.2,1);
}

@keyframes ledgerModalIn {
  from {
    opacity: 0;
    transform:
      translateY(10px)
      scale(.985);
  }

  to {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}

/* ------------------------------------------------------------
   TOAST POLISH
   ------------------------------------------------------------ */

.ledger-data-toast,
.ledger-payment-toast,
.ledger-settings-toast {
  backdrop-filter: blur(8px);
}

/* ------------------------------------------------------------
   SEARCH RESULT POLISH
   ------------------------------------------------------------ */

.global-search-result {
  position: relative;
}

.global-search-result::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(127, 127, 127, .08);
  transition:
    opacity var(--ledger-motion-fast) ease;
}

.global-search-result:hover::after {
  opacity: 1;
}

/* ------------------------------------------------------------
   TABLE READABILITY
   ------------------------------------------------------------ */

table th {
  font-weight: 700;
}

table td,
table th {
  line-height: 1.4;
}

tbody tr {
  transition:
    background var(--ledger-motion-fast) ease;
}

tbody tr:hover {
  background: rgba(127, 127, 127, .035);
}

/* ------------------------------------------------------------
   ANALYTICS REFINEMENT
   ------------------------------------------------------------ */

.analytics-kpi strong,
.payments-kpi strong {
  letter-spacing: -.02em;
}

.analytics-insight {
  transition:
    transform var(--ledger-motion-fast) ease,
    background var(--ledger-motion-fast) ease,
    border-color var(--ledger-motion-fast) ease;
}

.analytics-insight:hover {
  transform: translateY(-1px);
  background: rgba(127, 127, 127, .075);
}

/* ------------------------------------------------------------
   SETTINGS REFINEMENT
   ------------------------------------------------------------ */

.settings-toggle {
  transition:
    background var(--ledger-motion-fast) ease,
    border-color var(--ledger-motion-fast) ease,
    transform var(--ledger-motion-fast) ease;
}

.settings-toggle:hover {
  transform: translateY(-1px);
  background: rgba(127, 127, 127, .055);
}

/* ------------------------------------------------------------
   EMPTY STATES
   ------------------------------------------------------------ */

.search-empty-state,
.analytics-empty,
.ledger-payment-empty {
  animation:
    ledgerEmptyIn
    220ms
    ease;
}

@keyframes ledgerEmptyIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------
   GLOBAL MOBILE SAFETY
   ------------------------------------------------------------ */

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  button,
  input,
  select,
  textarea {
    max-width: 100%;
  }

  .analytics-kpi strong,
  .payments-kpi strong {
    font-size: 1.3rem;
  }
}

/* ------------------------------------------------------------
   TOUCH TARGETS
   ------------------------------------------------------------ */

@media (pointer: coarse) {
  button,
  [role="button"],
  select,
  input[type="checkbox"] {
    min-height: 42px;
  }

  .ledger-payment-close {
    min-width: 42px;
    min-height: 42px;
  }
}

/* ------------------------------------------------------------
   UTILITY LOADING STATE
   ------------------------------------------------------------ */

.ledger-loading {
  position: relative;
  overflow: hidden;
}

.ledger-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(127,127,127,.07),
      transparent
    );
  transform: translateX(-100%);
  animation:
    ledgerShimmer
    1.15s
    infinite;
}

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

/* ------------------------------------------------------------
   DISABLED / MUTED STATES
   ------------------------------------------------------------ */

.is-disabled,
[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

/* ------------------------------------------------------------
   CARD HEADERS
   ------------------------------------------------------------ */

.eyebrow {
  letter-spacing: .09em;
  font-weight: 750;
}

/* ------------------------------------------------------------
   PRINT FRIENDLY FOUNDATION
   ------------------------------------------------------------ */

@media print {
  body {
    background: white !important;
  }

  button,
  .analytics-toolbar,
  .search-control-card,
  .settings-actions-card,
  .ledger-payment-note,
  .search-note,
  .settings-footer-note {
    display: none !important;
  }

  .analytics-card,
  .analytics-kpi,
  .settings-card,
  .ledger-payments-card {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* LEDGER PAYMENT MODAL VISIBILITY FIX */
.ledger-payment-overlay {
  display: none;
}

body.ledger-payment-open .ledger-payment-overlay {
  display: grid;
}


/* ============================================================
   LEDGER V1 — MOBILE UX RELEASE OVERRIDES
   Navigation + readability + touch targets
   ============================================================ */

.sidebar-toggle {
    display: none;

    width: 42px;
    height: 42px;

    padding: 9px;

    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;

    border: 1px solid var(--line-2);
    border-radius: 11px;

    background: rgba(255,255,255,.035);
    color: var(--text);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
}

.mobile-overlay {
    display: none;
}

@media (max-width: 850px) {

    .sidebar-toggle {
        display: flex;
        flex: 0 0 auto;
    }

    .topbar {
        gap: 10px;
    }

    .breadcrumb {
        min-width: 0;
        font-size: 12px;
        gap: 7px;
    }

    .breadcrumb span {
        display: none;
    }

    .breadcrumb b {
        display: none;
    }

    .breadcrumb strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;

        z-index: 999;

        background: rgba(0,0,0,.62);
        backdrop-filter: blur(3px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity .22s ease,
            visibility .22s ease;
    }

    .mobile-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar {
        width: min(310px, 84vw);
        padding: 18px 14px;

        box-shadow:
            18px 0 50px rgba(0,0,0,.42);
    }

    .brand {
        min-height: 62px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        font-size: 8px;
    }

    .workspace {
        padding: 13px;
    }

    .workspace small {
        font-size: 8px;
    }

    .workspace strong {
        font-size: 13px;
    }

    .nav-link {
        min-height: 50px;
        padding: 0 14px;
        gap: 12px;
        font-size: 15px;
        font-weight: 600;
    }

    .nav-link span {
        width: 24px;
        font-size: 17px;
    }

    .sidebar-bottom strong {
        font-size: 12px;
    }

    .sidebar-bottom small {
        font-size: 9px;
    }

    .content {
        width: min(100% - 24px, 1500px);
        padding: 24px 0 50px;
    }

    .heading h1,
    .heading h2 {
        font-size: clamp(22px, 6vw, 30px);
        line-height: 1.15;
    }

    .heading p {
        font-size: 14px;
        line-height: 1.5;
    }

    .eyebrow {
        font-size: 10px;
        letter-spacing: .11em;
    }

    .panel-head h2 {
        font-size: 18px;
        line-height: 1.25;
    }

    .panel-head .count {
        font-size: 12px;
    }

    .panel {
        border-radius: 15px;
    }

    .metric,
    .metric-card,
    .transaction-summary-card {
        padding: 15px;
    }

    .metric strong,
    .metric-card strong {
        font-size: 23px;
    }

    .metric span,
    .metric-card span,
    .transaction-summary-card span {
        font-size: 11px;
    }

    button,
    .button,
    .text-button {
        min-height: 44px;
    }

    input,
    select,
    textarea {
        min-height: 46px;
        font-size: 16px !important;
        line-height: 1.35;
    }

    textarea {
        min-height: 110px;
    }

    input::placeholder,
    textarea::placeholder {
        font-size: 15px !important;
        opacity: .72;
    }

    label,
    .form-field label,
    .customer-form-field label,
    .invoice-field label,
    .settings-field label,
    .ledger-payment-field label {
        font-size: 13px;
        line-height: 1.35;
    }

    .form-field,
    .customer-form-field,
    .invoice-field,
    .settings-field,
    .ledger-payment-field {
        gap: 7px;
    }

    .form-field input,
    .form-field select,
    .form-field textarea,
    .customer-form-field input,
    .customer-form-field textarea,
    .invoice-field input,
    .invoice-field select,
    .invoice-field textarea,
    .settings-field input,
    .settings-field select,
    .ledger-payment-field input,
    .ledger-payment-field select,
    .ledger-payment-field textarea {
        color: var(--text);
        background: rgba(255,255,255,.045);
        border-color: var(--line-2);
    }

    .settings button,
    .data-tool-card button,
    .ledger-payments-card-header button {
        font-size: 13px;
    }

    .transaction,
    .dashboard-recent,
    .customer-card,
    .invoice-card {
        font-size: 13px;
    }

    .transaction strong,
    .customer-card strong,
    .invoice-card strong {
        font-size: 14px;
    }

    .transaction small,
    .customer-card small,
    .invoice-card small {
        font-size: 11px;
    }

    .table,
    table {
        font-size: 12px;
    }

    th {
        font-size: 10px;
    }

    td {
        font-size: 12px;
    }

    .modal {
        padding: 12px;
    }

    .modal > div,
    .modal-content {
        width: min(100%, 560px);
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .modal input,
    .modal select,
    .modal textarea {
        font-size: 16px !important;
        min-height: 46px;
    }

    .top-actions {
        margin-left: auto;
        gap: 5px;
    }

    .top-actions button,
    .profile {
        width: 39px;
        height: 39px;
    }

}

@media (max-width: 600px) {

    .topbar {
        height: 64px;
        padding: 0 12px;
    }

    .content {
        width: calc(100% - 20px);
        padding-top: 20px;
    }

    .heading-actions {
        gap: 8px;
    }

    .heading-actions .button {
        min-height: 46px;
        font-size: 13px;
    }

    .metrics {
        gap: 9px;
    }

    .metric,
    .metric-card {
        min-height: 95px;
    }

    .panel {
        padding: 14px;
    }

    .panel-head {
        gap: 10px;
    }

    .panel-head h2 {
        font-size: 17px;
    }

    .form-grid {
        gap: 12px;
    }

    .transaction-form-actions .button,
    .customer-form-actions .button,
    .invoice-form-actions .button,
    .ledger-payment-actions button,
    .settings-actions button {
        width: 100%;
        min-height: 46px;
        font-size: 13px;
    }

    .search-input-wrap input {
        font-size: 16px !important;
    }

}


/* ============================================================
   LEDGER V1 — MOBILE UX 2
   Clean navigation, back behavior, quick actions
   ============================================================ */

.mobile-sidebar-close {
    display: none;
}

.mobile-quick-actions {
    display: none;
}

@media (max-width: 850px) {

    .mobile-sidebar-close {
        display: flex;

        position: absolute;
        top: 14px;
        right: 12px;

        width: 40px;
        height: 40px;

        align-items: center;
        justify-content: center;

        border: 1px solid var(--line-2);
        border-radius: 11px;

        background: rgba(255,255,255,.045);
        color: var(--text);

        font-size: 26px;
        line-height: 1;

        z-index: 1200;
    }

    .sidebar {
        z-index: 1100;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;

        transform: translateX(-105%);
        transition:
            transform .24s ease,
            box-shadow .24s ease;

        overflow-y: auto;
    }

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

    .mobile-overlay {
        z-index: 1000;
    }

    body.mobile-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .mobile-quick-actions {
        display: block;

        margin: 0 0 18px;
    }

    .mobile-welcome {
        padding: 17px;

        border: 1px solid var(--line-2);
        border-radius: 17px;

        background:
            linear-gradient(
                135deg,
                rgba(255,255,255,.055),
                rgba(255,255,255,.018)
            );

        box-shadow:
            0 10px 34px rgba(0,0,0,.16);
    }

    .mobile-welcome h2 {
        margin: 5px 0 4px;

        font-size: 23px;
        line-height: 1.15;
    }

    .mobile-welcome p {
        margin: 0;

        font-size: 13px;
        line-height: 1.48;

        opacity: .67;
    }

    .mobile-action-grid {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;

        margin-top: 11px;
    }

    .mobile-action-card {
        min-height: 126px;

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        padding: 14px;

        text-align: left;

        border: 1px solid var(--line-2);
        border-radius: 15px;

        background:
            rgba(255,255,255,.028);

        color: var(--text);

        transition:
            transform .16s ease,
            background .16s ease;
    }

    .mobile-action-card:active {
        transform: scale(.98);
    }

    .mobile-action-icon {
        display: grid;
        place-items: center;

        width: 36px;
        height: 36px;

        margin-bottom: 9px;

        border-radius: 10px;

        background:
            rgba(255,255,255,.065);

        font-size: 18px;
    }

    .mobile-action-card strong {
        font-size: 14px;
        line-height: 1.2;
    }

    .mobile-action-card small {
        margin-top: 5px;

        font-size: 10px;
        line-height: 1.35;

        opacity: .58;
    }

    .content {
        padding-top: 19px;
    }

    .page {
        min-width: 0;
    }

    .panel {
        overflow: hidden;
    }

    .panel-head {
        align-items: flex-start;
    }

    .heading-actions {
        width: 100%;
    }

    .heading-actions > * {
        flex: 1;
    }

    .modal {
        align-items: flex-end;
    }

    .modal > div,
    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }

}

@media (max-width: 430px) {

    .mobile-action-grid {
        grid-template-columns: 1fr;
    }

    .mobile-action-card {
        min-height: 88px;

        flex-direction: row;
        align-items: center;
        gap: 11px;
    }

    .mobile-action-icon {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .mobile-action-card small {
        margin-top: 2px;
    }

}


/* ============================================================
   LEDGER V1 — MOBILE CLEAN HOME
   ============================================================ */

.mobile-sidebar-close {
    display: none;
}

.mobile-quick-actions {
    display: none;
}

@media (max-width: 850px) {

    .main {
        margin-left: 0;
    }

    .sidebar {
        position: fixed;

        left: 0;
        top: 0;
        bottom: 0;

        width: min(310px, 84vw);

        z-index: 1100;

        transform: translateX(-105%);

        transition:
            transform .24s ease;
    }

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

    .mobile-sidebar-close {
        display: flex;

        position: absolute;

        top: 14px;
        right: 12px;

        width: 40px;
        height: 40px;

        align-items: center;
        justify-content: center;

        border: 1px solid var(--line-2);
        border-radius: 11px;

        background: rgba(255,255,255,.055);
        color: var(--text);

        font-size: 25px;
        line-height: 1;

        z-index: 1200;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;

        z-index: 1000;

        display: block;

        background:
            rgba(0,0,0,.58);

        backdrop-filter:
            blur(2px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity .2s ease,
            visibility .2s ease;
    }

    .mobile-overlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-quick-actions {
        display: block;

        margin-bottom: 16px;
    }

    .mobile-home-intro {
        padding: 15px 16px;

        margin-bottom: 10px;

        border:
            1px solid var(--line);

        border-radius: 16px;

        background:
            linear-gradient(
                145deg,
                rgba(255,255,255,.042),
                rgba(255,255,255,.018)
            );
    }

    .mobile-home-intro h2 {
        margin: 7px 0 5px;

        font-size: 23px;
        line-height: 1.14;

        letter-spacing: -.035em;
    }

    .mobile-home-intro p {
        margin: 0;

        font-size: 12px;
        line-height: 1.45;

        color: var(--muted);
    }

    .mobile-home-actions {
        display: grid;

        gap: 9px;
    }

    .mobile-home-action {
        width: 100%;
        min-height: 70px;

        display: grid;

        grid-template-columns:
            42px minmax(0,1fr) 18px;

        align-items: center;

        gap: 11px;

        padding: 11px 13px;

        border:
            1px solid var(--line);

        border-radius: 14px;

        background:
            rgba(255,255,255,.025);

        color: var(--text);

        text-align: left;

        box-shadow:
            0 8px 22px rgba(0,0,0,.09);
    }

    .mobile-home-action:active {
        transform: scale(.985);
    }

    .mobile-home-action-icon {
        width: 42px;
        height: 42px;

        display: grid;
        place-items: center;

        border-radius: 12px;

        background:
            rgba(130,170,255,.075);

        font-size: 17px;
    }

    .mobile-home-action strong {
        display: block;

        font-size: 14px;
        line-height: 1.2;
    }

    .mobile-home-action small {
        display: block;

        margin-top: 3px;

        font-size: 10px;
        line-height: 1.25;

        color: var(--muted);
    }

    .mobile-home-action b {
        color: var(--muted-2);
        font-size: 21px;
        font-weight: 400;
        text-align: center;
    }

    /*
      The mobile dashboard deliberately shows fewer
      sections so the first screen feels calm rather
      than like a desktop dashboard squeezed into a phone.
    */

    #page-dashboard .heading {
        margin-bottom: 13px;

        display: block;
    }

    #page-dashboard .heading .eyebrow {
        font-size: 9px;
    }

    #page-dashboard .heading h1 {
        margin-top: 5px;

        font-size: 24px;
        line-height: 1.12;
    }

    #page-dashboard .heading p {
        display: none;
    }

    #page-dashboard .heading-actions {
        margin-top: 10px;

        display: grid;
        grid-template-columns: 1fr;
    }

    #page-dashboard
    .heading-actions
    .dashboard-range {
        display: none;
    }

    #page-dashboard
    .heading-actions
    #add-transaction {
        width: 100%;
        min-height: 46px;

        font-size: 13px;
    }

    #page-dashboard .metrics {
        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap: 9px;

        margin-bottom: 14px;
    }

    #page-dashboard .metric {
        min-height: 104px;

        padding: 14px;
    }

    #page-dashboard .metric > span {
        font-size: 8px;
    }

    #page-dashboard .metric strong {
        margin-top: 14px;

        font-size: 22px;
    }

    #page-dashboard .metric small {
        margin-top: 7px;

        font-size: 8px;
    }

    #page-dashboard > .grid,
    #page-dashboard > .grid.lower {
        display: none;
    }

    .content {
        width:
            min(
                calc(100% - 22px),
                1500px
            );

        padding:
            18px 0 45px;
    }

    .topbar {
        height: 64px;

        padding:
            0 11px;
    }

    .breadcrumb {
        min-width: 0;

        font-size: 11px;
    }

    .top-actions {
        gap: 4px;
    }

    .top-actions button,
    .profile {
        width: 38px;
        height: 38px;
    }

    .nav-link {
        min-height: 49px;

        padding:
            0 13px;

        font-size: 14px;

        gap: 11px;
    }

    input,
    select,
    textarea {
        min-height: 46px;

        font-size: 16px !important;
    }

    textarea {
        min-height: 105px;
    }

    button,
    .button {
        min-height: 44px;
    }

    .panel {
        padding: 15px;
        border-radius: 15px;
    }

    .panel-head h2 {
        font-size: 17px;
    }

}

@media (max-width: 430px) {

    #page-dashboard .metrics {
        gap: 8px;
    }

    #page-dashboard .metric {
        min-height: 96px;
        padding: 12px;
    }

    #page-dashboard .metric strong {
        font-size: 20px;
    }

    .mobile-home-intro {
        padding: 14px;
    }

    .mobile-home-intro h2 {
        font-size: 21px;
    }

    .mobile-home-action {
        min-height: 66px;
    }
}



/* ============================================================
   LEDGER V1 SETTINGS — FORM CLARITY
   ============================================================ */

.settings-field-hint {
    display: block;

    margin-top: 4px;

    font-size: 10px;

    line-height: 1.35;

    color: var(--muted);

    opacity: .8;
}

@media (max-width: 850px) {

    .settings-field-hint {
        font-size: 11px;
    }

    .settings-field input,
    .settings-field select {
        min-height: 48px;
    }

}
