:root {
    --bg: #f4f7fb;
    --bg-strong: #eaf0f8;
    --card: #ffffff;
    --card-alt: #f6f9ff;
    --line: #dfe7f4;
    --text: #14213d;
    --text-soft: #5c6b86;
    --primary: #2f6fed;
    --primary-soft: rgba(47, 111, 237, 0.12);
    --success: #17b26a;
    --success-soft: rgba(23, 178, 106, 0.12);
    --warning: #f79009;
    --warning-soft: rgba(247, 144, 9, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button, input, select {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex: 0 0 248px;
    background: rgba(17, 24, 39, 0.96);
    color: rgba(255, 255, 255, 0.9);
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    margin: 0 0 24px;
    padding: 8px 4px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #7dd3fc, #2563eb);
    font-weight: 700;
    color: white;
}

.brand-logo-frame {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
}

.brand-logo {
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
}

.brand-product-logo-frame {
    display: grid;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: #fff;
}

.brand-product-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
    flex: 1;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 0.86rem;
    line-height: 1.4;
    overflow-wrap: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.brand span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.76);
    padding: 11px 12px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.84rem;
    transition: 0.2s ease;
}

.nav-link .icon {
    flex: 0 0 22px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.icon {
    width: 22px;
    display: inline-block;
    text-align: center;
}

.sidebar-card {
    margin-top: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 18px 16px;
}

.sidebar-card p,
.sidebar-card span {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-card strong {
    display: block;
    margin: 8px 0;
    font-size: 1.5rem;
}

.main-panel {
    flex: 1;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: var(--text-soft);
    font-weight: 700;
}

.topbar-left h2,
.dashboard-header h1,
.panel-header h3 {
    margin: 0;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-button {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
}

.action-button.muted {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
}

.action-button.primary {
    background: linear-gradient(135deg, var(--primary), #4d8af0);
    color: white;
    box-shadow: 0 12px 30px rgba(47, 111, 237, 0.28);
}

.page-content {
    display: grid;
    gap: 22px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.dashboard-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.header-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(47, 111, 237, 0.08);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 600;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(23, 178, 106, 0.12);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.metric-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 20px;
    box-shadow: var(--shadow);
}

.metric-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-bottom: 18px;
}

.metric-value {
    font-size: clamp(1.8rem, 2.8vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.metric-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.72rem;
}

.trend.up {
    background: var(--success-soft);
    color: var(--success);
}

.trend.down {
    background: var(--danger-soft);
    color: var(--danger);
}

.panel-grid,
.bottom-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.85fr;
    gap: 20px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 20px 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-header a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
    min-height: 220px;
    padding-top: 14px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.stacked-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 7px;
    height: 170px;
    width: 100%;
}

.bar {
    display: block;
    width: 20px;
    border-radius: 10px 10px 0 0;
    min-height: 18px;
}

.bar.incoming {
    background: linear-gradient(180deg, #9ad0ff, #3b82f6);
}

.bar.outgoing {
    background: linear-gradient(180deg, #b6efc7, #16a34a);
}

.bar-group label {
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 600;
}

.goal-list {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}

.goal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 14px;
    background: var(--card-alt);
}

.goal-item span,
.goal-item small {
    display: block;
    color: var(--text-soft);
}

.goal-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1.15rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th {
    color: var(--text-soft);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.amount-col {
    text-align: right;
    font-weight: 700;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.tag.entrée {
    background: var(--success-soft);
    color: var(--success);
}

.tag.sortie {
    background: var(--danger-soft);
    color: var(--danger);
}

.expense-list {
    display: grid;
    gap: 18px;
    margin-top: 8px;
}

.expense-item {
    display: grid;
    gap: 10px;
}

.expense-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-soft);
}

.expense-label strong {
    color: var(--text);
}

.progress {
    height: 10px;
    background: #edf2ff;
    border-radius: 999px;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed 0%, #2f6fed 100%);
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.account-card {
    background: linear-gradient(135deg, #0f172a, #111827);
    color: white;
    border-radius: 22px;
    padding: 22px 20px;
    box-shadow: var(--shadow);
}

.account-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255, 255, 255, 0.72);
}

.account-card h4 {
    margin: 22px 0 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.72rem;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
}

.text-muted {
    color: var(--text-soft);
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 100;
        width: min(78vw, 300px);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-panel {
        padding: 18px 16px 28px;
    }

    .menu-button {
        display: inline-grid;
        place-items: center;
    }

    .topbar,
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .action-button {
        flex: 1;
    }

    .metrics-grid,
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern dashboard refresh */
:root {
    --bg: #f5f7fb;
    --bg-strong: #edf1f7;
    --card: #ffffff;
    --card-alt: #f6f8fc;
    --line: #e8edf4;
    --text: #172033;
    --text-soft: #7b8497;
    --primary: #5653e8;
    --primary-soft: rgba(86, 83, 232, 0.1);
    --success: #159a72;
    --success-soft: rgba(21, 154, 114, 0.1);
    --danger: #df5b68;
    --danger-soft: rgba(223, 91, 104, 0.1);
    --shadow: 0 8px 28px rgba(25, 35, 58, 0.045);
}

html,
body {
    background: var(--bg);
}

.app-shell {
    max-width: 1800px;
    margin: 0 auto;
    background: var(--bg);
}

.sidebar {
    width: 248px;
    flex: 0 0 248px;
    background: #171a2b;
    padding: 28px 18px;
}

.brand {
    margin-bottom: 42px;
    padding: 4px 8px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(145deg, #8d88ff, #5653e8);
    box-shadow: 0 7px 18px rgba(86, 83, 232, 0.35);
}

.nav {
    gap: 6px;
}

.nav-link {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.87rem;
    color: #a4a9ba;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
}

.nav-link.active {
    background: rgba(125, 120, 255, 0.16);
    border-color: rgba(148, 144, 255, 0.12);
    color: #fff;
}

.nav-link.active .icon {
    color: #aaa7ff;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-card {
    margin-top: auto;
    padding: 17px;
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    border-radius: 14px;
}

.sidebar-card strong {
    color: #74d5b2;
    font-size: 1.3rem;
}

.sidebar-card span {
    font-size: 0.76rem;
    line-height: 1.6;
}

.main-panel {
    min-width: 0;
    padding: 28px clamp(22px, 3.2vw, 52px) 48px;
}

.topbar {
    min-height: 58px;
    margin-bottom: 38px;
}

.topbar-left h2 {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.eyebrow {
    margin-bottom: 6px;
    font-size: 0.66rem;
    letter-spacing: 0.13em;
    color: #929bad;
}

.action-button {
    min-height: 42px;
    border-radius: 10px;
    padding: 0 15px;
    font-size: 0.8rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-button:hover {
    transform: translateY(-1px);
}

.action-button.muted {
    background: #fff;
    border: 1px solid var(--line);
    color: #596174;
}

.action-button.primary {
    background: #5653e8;
    box-shadow: 0 6px 14px rgba(86, 83, 232, 0.2);
}

.page-content {
    gap: 20px;
}

.dashboard-header {
    margin-bottom: 2px;
}

.dashboard-header h1 {
    font-size: clamp(1.75rem, 3vw, 2.2rem);
    letter-spacing: -0.055em;
}

.header-tag {
    padding: 9px 13px;
    background: #fff;
    border: 1px solid var(--line);
    color: #5a6477;
    font-size: 0.78rem;
    box-shadow: var(--shadow);
}

.dot {
    width: 7px;
    height: 7px;
}

.metrics-grid {
    gap: 14px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 156px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover,
.account-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(25, 35, 58, 0.09);
}

.metric-card::after {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    content: "€";
    font-size: 1rem;
    font-weight: 700;
}

.metric-card:nth-child(2)::after {
    background: var(--success-soft);
    color: var(--success);
    content: "↙";
}

.metric-card:nth-child(3)::after {
    background: var(--danger-soft);
    color: var(--danger);
    content: "↗";
}

.metric-card:nth-child(4)::after {
    background: #fff4e5;
    color: #d78b28;
    content: "◉";
}

.metric-topline {
    min-height: 36px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-right: 38px;
    font-size: 0.77rem;
}

.trend {
    min-width: auto;
    padding: 5px 8px;
    font-size: 0.68rem;
}

.metric-value {
    margin-bottom: 6px;
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
    letter-spacing: -0.055em;
}

.metric-card p {
    font-size: 0.74rem;
}

.panel-grid,
.bottom-grid {
    gap: 16px;
}

.panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 18px;
}

.panel-header h3 {
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.panel-header a {
    font-size: 0.76rem;
    color: var(--primary);
}

.chart {
    position: relative;
    min-height: 226px;
    padding: 18px 8px 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, #eef1f6 56px, transparent 57px);
    border-bottom: 1px solid var(--line);
}

.bar-group {
    justify-content: flex-end;
}

.stacked-bars {
    height: 174px;
    align-items: flex-end;
    gap: 5px;
}

.bar {
    width: min(22px, 34%);
    border-radius: 6px 6px 2px 2px;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.bar:hover {
    filter: saturate(1.3);
    transform: scaleX(1.08);
}

.bar.incoming {
    background: linear-gradient(180deg, #918eff, #625fee);
}

.bar.outgoing {
    background: linear-gradient(180deg, #9de4cb, #48bd95);
}

.bar-group label {
    font-size: 0.71rem;
    font-weight: 500;
}

.goal-list {
    gap: 10px;
}

.goal-item {
    min-height: 62px;
    padding: 12px 13px;
    border: 1px solid #edf0f6;
    border-radius: 12px;
    background: #fafbfe;
}

.goal-item span,
.goal-item small {
    font-size: 0.73rem;
}

.goal-item strong {
    font-size: 1.05rem;
}

table {
    min-width: 590px;
}

th,
td {
    padding: 13px 10px;
}

th {
    border-bottom-color: var(--line);
    font-size: 0.65rem;
}

td {
    color: #4f596c;
    font-size: 0.78rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fafbfe;
}

.tag {
    padding: 6px 9px;
    font-size: 0.67rem;
}

.expense-list {
    gap: 17px;
}

.expense-label {
    font-size: 0.76rem;
}

.progress {
    height: 7px;
    background: #eff0fb;
}

.progress span {
    background: linear-gradient(90deg, #8581f7, #5653e8);
}

.accounts-grid {
    gap: 14px;
}

.account-card {
    min-height: 142px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: linear-gradient(145deg, #272b43, #191c2f);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-header {
    align-items: center;
    font-size: 0.76rem;
}

.account-card h4 {
    margin-top: 20px;
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
}

.status-badge {
    color: #b8c1d4;
    font-size: 0.66rem;
}

.menu-button {
    color: var(--text);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(86, 83, 232, 0.35);
    outline-offset: 3px;
}

@media (max-width: 1100px) {
    .panel-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        flex: none;
    }

    .main-panel {
        padding: 18px 16px 30px;
    }

    .topbar {
        margin-bottom: 26px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .panel {
        padding: 18px 15px;
    }
}

@media (max-width: 520px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .action-button {
        padding: 0 10px;
        font-size: 0.72rem;
    }

    .chart {
        gap: 7px;
        min-height: 196px;
        padding-right: 0;
        padding-left: 0;
    }

    .stacked-bars {
        height: 145px;
    }

    .bar {
        width: 15px;
    }
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.management-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.4fr);
    align-items: start;
    gap: 16px;
}

.account-movement-link {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.account-movement-link:hover {
    text-decoration: underline;
}

.account-delete-form {
    margin: 0;
}

.account-delete-button {
    padding: 0;
    border: 0;
    background: none;
    color: #b43d4b;
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
}

.account-delete-button:hover {
    text-decoration: underline;
}

.settings-grid {
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.4fr);
}

.settings-tabs {
    display: grid;
    width: min(100%, 560px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 20px;
    padding: 5px;
    border: 1px solid #e6eaf2;
    border-radius: 13px;
    background: #f0f2f7;
    box-shadow: inset 0 1px 2px rgba(20, 33, 61, 0.04);
}

.settings-tabs a {
    display: inline-flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.settings-tabs a.active {
    border-color: #e7eaf2;
    background: #fff;
    color: #333b50;
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.07);
}

.settings-tabs a:not(.active):hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
}

.settings-tab-icon {
    color: var(--primary);
    font-size: 0.95rem;
}

.settings-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-single-column {
    display: grid;
    width: min(100%, 620px);
    grid-template-columns: minmax(0, 1fr);
}

.company-settings-form {
    width: min(100%, 440px);
    gap: 14px;
}

.cross-rate-panel {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card-alt);
}

.cross-rate-panel .eyebrow,
.cross-rate-panel h4,
.cross-rate-panel .form-help {
    margin: 0;
}

.cross-rate-panel h4 {
    color: var(--text);
    font-size: 0.95rem;
}

.cross-rate-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cross-rate-values > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
}

.cross-rate-values span {
    color: var(--text-soft);
    font-size: 0.72rem;
}

.cross-rate-values strong {
    overflow-wrap: anywhere;
    color: var(--primary);
    font-size: 0.85rem;
}

.company-settings-form .form-submit {
    width: fit-content;
    min-width: 205px;
    padding: 0 18px;
}

.analytical-settings-grid {
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 16px;
}

.analytical-codes-panel {
    min-width: 0;
}

.analytical-code-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.analytical-code-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.analytical-code-table th {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.analytical-code-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 0.78rem;
    vertical-align: middle;
}

.analytical-code-table tbody tr:last-child td {
    border-bottom: 0;
}

.analytical-code-badge {
    display: inline-flex;
    max-width: 180px;
    padding: 6px 9px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytical-label {
    min-width: 130px;
    overflow-wrap: anywhere;
}

.analytical-usage {
    width: 110px;
    color: var(--text-soft) !important;
    text-align: center;
}

.analytical-actions {
    width: 120px;
    text-align: right;
}

.analytical-actions form {
    margin: 0;
}

.delete-code-button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #f0cfd3;
    border-radius: 9px;
    background: #fff;
    color: #b43d4b;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
}

.delete-code-button:hover:not(:disabled) {
    background: #fff5f6;
}

.delete-code-button:disabled {
    border-color: var(--line);
    color: #9aa2b1;
    cursor: not-allowed;
}

.delete-code-help {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.63rem;
}

.movement-layout {
    grid-template-columns: minmax(290px, 0.75fr) minmax(0, 1.55fr);
}

.page-intro {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.6;
}

.data-form {
    display: grid;
    gap: 16px;
}

.data-form label {
    display: grid;
    gap: 8px;
    color: #424b5d;
    font-size: 0.77rem;
    font-weight: 600;
}

.opening-balance-label {
    white-space: nowrap;
}

.data-form label[hidden] {
    display: none;
}

.data-form input,
.data-form select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 0.83rem;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.data-form input:focus,
.data-form select:focus {
    border-color: #8581f7;
    box-shadow: 0 0 0 3px rgba(86, 83, 232, 0.1);
}

.data-form input::placeholder {
    color: #a0a8b7;
}

.optional {
    color: #9aa2b1;
    font-weight: 400;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-help {
    margin: -3px 0 0;
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.6;
}

.data-form input[type="file"] {
    height: auto;
    padding: 10px;
}

.company-logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-soft);
    font-size: 0.75rem;
}

.company-logo-preview img {
    width: 56px;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.analytical-code-form {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.analytical-code-list {
    display: grid;
}

.analytical-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 0.8rem;
}

.analytical-code-row:last-child {
    border-bottom: 0;
}

.analytical-code-row strong {
    color: var(--primary);
}

.analytical-code-row span {
    color: var(--text-soft);
    text-align: right;
}

.form-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 2px;
}

.form-submit:disabled,
.data-form select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.notice {
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.notice-dismissing {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.notice a {
    color: inherit;
    font-weight: 700;
}

.notice-success {
    border-color: #cceee0;
    background: #effaf5;
    color: #167a5a;
}

.notice-error {
    border-color: #f5d1d5;
    background: #fff5f6;
    color: #aa3543;
}

.notice-info {
    border-color: #d7defb;
    background: #f3f5ff;
    color: #4c4cb2;
}

.account-table {
    display: grid;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 2px;
    border-bottom: 1px solid var(--line);
}

.account-row:last-child {
    border-bottom: 0;
}

.account-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.account-row-info {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 5px;
}

.account-row-info strong,
.account-row-balance strong {
    overflow: hidden;
    color: var(--text);
    font-size: 0.83rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-row-info span,
.account-row-balance span {
    color: var(--text-soft);
    font-size: 0.7rem;
}

.account-row-balance {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.status-badge.status-active {
    color: #16835f;
    background: #e9f8f1;
}

.status-badge.status-inactive {
    color: #71798a;
    background: #f0f2f6;
}

.empty-state {
    display: grid;
    justify-items: center;
    padding: 48px 18px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 15px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.4rem;
}

.empty-state strong {
    font-size: 0.88rem;
}

.empty-state p,
.empty-inline,
.account-empty p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 0.76rem;
    line-height: 1.6;
}

.movements-table {
    min-width: 820px;
}

.movement-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfe;
}

.movement-filters label {
    display: grid;
    gap: 5px;
    color: var(--text-soft);
    font-size: 0.68rem;
}

.movement-filters input,
.movement-filters select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.movement-filters .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    text-decoration: none;
}

.movement-filter-separator {
    padding: 0 2px 11px;
    color: var(--text-soft);
    font-size: 0.72rem;
}

.report-panel {
    margin-bottom: 18px;
}

.report-panel .panel-header {
    align-items: flex-start;
}

.report-panel .panel-header h3 {
    margin: 0;
}

.report-note,
.report-empty {
    color: var(--text-soft);
    font-size: 0.73rem;
}

.report-empty {
    margin: 0;
    padding: 18px 0;
}

.report-table {
    min-width: 680px;
}

.report-table tfoot th {
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 0.76rem;
    text-transform: none;
    letter-spacing: normal;
}

.report-panel > .report-note {
    display: block;
    margin: 12px 0 0;
}

.report-ledger-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 22px 0 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.report-ledger-heading h4 {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
}

.budget-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.5fr);
}

.budget-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.budget-summary > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfe;
}

.budget-summary span,
.budget-summary small {
    color: var(--text-soft);
    font-size: 0.68rem;
}

.budget-summary strong {
    color: var(--text);
    font-size: 0.92rem;
}

.budget-summary > small {
    grid-column: 1 / -1;
}

.budget-list {
    display: grid;
    gap: 12px;
}

.budget-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 4px solid #22a36a;
    border-radius: 11px;
    background: #fff;
}

.budget-item.warning {
    border-left-color: #e2a126;
}

.budget-item.over {
    border-left-color: #d34a55;
    background: #fffafa;
}

.budget-item-heading,
.budget-item-totals,
.budget-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.budget-item-heading > div {
    display: grid;
    gap: 4px;
}

.budget-item-heading strong {
    color: var(--text);
    font-size: 0.83rem;
}

.budget-item-heading span,
.budget-item-totals,
.budget-item-footer {
    color: var(--text-soft);
    font-size: 0.7rem;
}

.budget-item-totals strong {
    color: var(--text);
}

.budget-item-heading form {
    margin: 0;
}

.budget-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 20px;
    background: #edf0f5;
}

.budget-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #22a36a;
}

.budget-item.warning .budget-progress-track span {
    background: #e2a126;
}

.budget-item.over .budget-progress-track span {
    background: #d34a55;
}

.movements-table tbody tr.movement-income > td {
    background-color: #effaf3;
}

.movements-table tbody tr.movement-expense > td {
    background-color: #fff1f1;
}

.movements-table tbody tr.movement-income:hover > td {
    background-color: #e4f6ea;
}

.movements-table tbody tr.movement-expense:hover > td {
    background-color: #ffe6e6;
}

.movement-actions {
    white-space: nowrap;
}

.movement-actions form {
    display: inline-block;
    margin-left: 4px;
}

.movement-actions a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.movement-actions .action-button {
    min-height: 30px;
    border-radius: 7px;
    padding: 0 8px;
    font-size: 0.68rem;
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar-actions,
    .menu-button,
    .report-period-filter {
        display: none !important;
    }

    .period-balance-document .topbar {
        display: none !important;
    }

    .app-shell,
    .main-panel,
    .page-content {
        display: block;
        width: 100%;
        max-width: none;
        padding: 0;
        box-shadow: none;
    }

    .report-panel {
        break-inside: avoid;
        border: 1px solid #d1d5db;
        box-shadow: none;
    }

    .table-wrap {
        overflow: visible;
    }

    .report-table {
        min-width: 0;
        font-size: 9pt;
    }

    @page balance {
        size: portrait;
        margin: 14mm 10mm 12mm;

        @top-left {
            color: #172033;
            content: "Steromoney";
            font-family: Arial, sans-serif;
            font-size: 8pt;
            font-weight: 700;
        }

        @top-right {
            color: #68738a;
            content: "Propriété de CICAF-SAS";
            font-family: Arial, sans-serif;
            font-size: 8pt;
        }

        @bottom-left {
            color: #68738a;
            content: "Steromoney · CICAF-SAS";
            font-family: Arial, sans-serif;
            font-size: 7pt;
        }

        @bottom-right {
            color: #68738a;
            content: counter(page) " / " counter(pages);
            font-family: Arial, sans-serif;
            font-size: 7pt;
        }
    }

    .period-balance-page {
        color: #30343b;
        font-family: Arial, sans-serif;
    }

    .period-balance-document {
        page: balance;
    }

    .period-balance-page .print-balance-header {
        display: block;
        margin: 0 0 17px;
        padding: 0 0 2px;
    }

    .print-balance-topline {
        display: flex;
        min-height: 52px;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }

    .print-company-overline,
    .print-balance-kicker,
    .print-period-label {
        display: block;
        color: #68738a;
        font-size: 7pt;
        font-weight: 700;
        letter-spacing: 0.1em;
    }

    .print-company-overline {
        margin-bottom: 5px;
    }

    .print-company-name {
        margin: 0;
        color: #172033;
        font-size: 13pt;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .print-balance-title-row {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 18px;
        margin-top: 15px;
    }

    .print-balance-kicker {
        margin-bottom: 4px;
        color: #5653e8;
    }

    .print-balance-title-row h1 {
        margin: 0;
        color: #5653e8;
        font-size: 24pt;
        font-weight: 800;
        letter-spacing: -0.045em;
        line-height: 1.08;
    }

    .print-period-card {
        min-width: 175px;
        padding: 9px 12px;
        border: 1px solid #dce2ee;
        border-left: 3px solid #5653e8;
        border-radius: 4px;
        background: #fff;
    }

    .print-period-label {
        margin-bottom: 5px;
        color: #7b8497;
        font-size: 6.5pt;
    }

    .print-period-card strong {
        display: block;
        color: #172033;
        font-size: 9pt;
        font-weight: 700;
        white-space: nowrap;
    }

    .print-company-logo,
    .print-company-mark {
        display: grid;
        width: 54px;
        height: 54px;
        flex: 0 0 54px;
        place-items: center;
        border-radius: 12px;
        object-fit: contain;
        border: 1px solid #e1e6ef;
        background: #fff;
    }

    .print-company-mark {
        border: 0;
        background: #5653e8 !important;
        color: #fff;
        font-size: 20pt;
        font-weight: 800;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-balance-rule {
        height: 2px;
        margin-top: 13px;
        background: #5653e8 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-balance-generated {
        margin: 6px 0 0;
        color: #7b8497;
        font-size: 7pt;
        text-align: right;
    }

    @media (max-width: 650px) {
        .print-balance-title-row {
            align-items: flex-start;
            flex-direction: column;
        }

        .print-period-card {
            width: 100%;
        }
    }

    .period-balance-page .dashboard-header,
    .period-balance-page .screen-only,
    .period-balance-page .panel-header,
    .period-balance-page .empty-state {
        display: none !important;
    }

    .period-balance-page .report-panel {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .period-balance-page .table-wrap {
        overflow: visible;
    }

    .period-balance-page .period-balance-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        font-size: 7.5pt;
        border: 1px solid #cfd6e2;
        border-collapse: collapse;
    }

    .period-balance-page .period-balance-table th:nth-child(1) {
        width: 13%;
    }

    .period-balance-page .period-balance-table th:nth-child(2) {
        width: 30%;
    }

    .period-balance-page .period-balance-table th:nth-child(n+3) {
        width: 14.25%;
    }

    .period-balance-page .period-balance-table th,
    .period-balance-page .period-balance-table td {
        padding: 7px 6px;
        border: 1px solid #d8deea;
        color: #172033;
        font-size: 7.5pt;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .period-balance-page .period-balance-table thead th {
        border: 1px solid #cfd6e2;
        border-bottom: 2px solid #5653e8;
        background: #f3f5fb !important;
        color: #5653e8;
        font-size: 7pt;
        font-weight: 700;
        text-transform: none;
        vertical-align: bottom;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .period-balance-page .period-balance-table tbody tr:nth-child(even) td {
        background: #fafbfe !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .period-balance-page .period-balance-table tfoot th,
    .period-balance-page .period-balance-table tfoot td {
        border: 1px solid #cfd6e2;
        border-top: 2px solid #5653e8;
        background: #f3f5fb !important;
        color: #3432a5;
        font-weight: 800;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .period-balance-page .period-balance-table .amount-col {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .period-balance-page .report-note {
        display: none !important;
    }
}

.movement-title,
.movement-reference {
    display: block;
}

.movement-title {
    max-width: 220px;
    overflow: hidden;
    color: var(--text);
    font-size: 0.77rem;
    text-overflow: ellipsis;
}

.movement-reference {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.67rem;
}

.tag.income {
    background: var(--success-soft);
    color: var(--success);
}

.tag.expense {
    background: var(--danger-soft);
    color: var(--danger);
}

.tag.transfer {
    background: var(--primary-soft);
    color: var(--primary);
}

.table-empty {
    padding: 30px 10px;
    color: var(--text-soft);
    text-align: center;
}

.chart-legend {
    display: flex;
    gap: 14px;
    color: var(--text-soft);
    font-size: 0.7rem;
}

.chart-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.incoming-dot {
    background: #6966ed;
}

.outgoing-dot {
    background: #48bd95;
}

.account-empty {
    display: grid;
    align-content: start;
    gap: 6px;
}

.account-empty a {
    margin-top: 4px;
    color: #c2c1ff;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .management-grid,
    .movement-layout,
    .treasury-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .analytical-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .cross-rate-values {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .account-row {
        gap: 9px;
    }

    .account-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .account-row-info strong,
    .account-row-balance strong {
        font-size: 0.75rem;
    }

    .account-row-info span,
    .account-row-balance span {
        font-size: 0.65rem;
    }
}

.analytical-code-table-wrap table {
    min-width: 0;
    table-layout: fixed;
}

.analytical-code-table th:first-child,
.analytical-code-table td:first-child {
    width: 22%;
}

.analytical-code-table th:nth-child(2),
.analytical-code-table td:nth-child(2) {
    width: auto;
}

@media (max-width: 640px) {
    .settings-tabs {
        width: 100%;
    }

    .settings-tabs a {
        gap: 6px;
        padding: 0 7px;
        font-size: 0.7rem;
    }

    .company-settings-form {
        width: 100%;
    }

    .company-settings-form .form-submit {
        width: 100%;
    }

    .analytical-code-table-wrap {
        overflow: visible;
    }

    .analytical-code-table-wrap .analytical-code-table {
        display: block;
        min-width: 0;
    }

    .analytical-code-table thead {
        display: none;
    }

    .analytical-code-table tbody {
        display: grid;
        gap: 10px;
    }

    .analytical-code-table tbody tr {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 12px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }

    .analytical-code-table tbody td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 7px 0;
        border: 0;
        text-align: left;
        white-space: normal;
    }

    .analytical-code-table td::before {
        display: block;
        margin-bottom: 4px;
        color: var(--text-soft);
        content: attr(data-label);
        font-size: 0.63rem;
        font-weight: 600;
    }

    .analytical-code-table td:first-child {
        grid-column: 1;
    }

    .analytical-code-table td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .analytical-code-table td.analytical-usage {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
    }

    .analytical-code-table td.analytical-actions {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
        text-align: right;
    }

    .analytical-code-table td.analytical-actions form {
        display: flex;
        justify-content: flex-end;
    }
}

.settings-single-column {
    max-width: 560px;
}

.company-settings-card {
    padding: 22px 24px;
}

.company-settings-card .panel-header {
    margin-bottom: 14px;
}

.company-settings-form {
    max-width: 390px;
    gap: 13px;
}

.company-settings-form label {
    gap: 6px;
}

.company-settings-form input:not([type="file"]) {
    min-height: 40px;
}

.company-settings-form input[type="file"] {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 0.74rem;
}

.company-settings-form .form-submit {
    width: fit-content;
    min-width: 0;
    min-height: 40px;
    margin-top: 0;
    padding: 0 16px;
}

.company-settings-card .company-logo-preview {
    width: fit-content;
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-alt);
}

.company-settings-card .company-logo-preview img {
    width: 48px;
    height: 48px;
}

@media (max-width: 640px) {
    .company-settings-card {
        padding: 18px 15px;
    }

    .company-settings-form .form-submit {
        width: fit-content;
    }
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 460px);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.auth-brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, #7dd3fc, #2563eb);
    color: #fff;
    font-weight: 800;
}

.auth-brand strong,
.auth-brand span:not(.auth-brand-mark) {
    display: block;
}

.auth-brand strong {
    color: var(--text);
    font-size: 0.88rem;
}

.auth-brand span:not(.auth-brand-mark) {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.75rem;
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.55rem;
}

.auth-heading > p:last-child {
    margin: 9px 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.6;
}

.auth-form {
    gap: 15px;
}

.auth-form .form-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-page {
    min-height: 100vh;
    padding: 34px;
    background:
        radial-gradient(ellipse at 12% 8%, rgba(89, 153, 255, 0.17), transparent 34%),
        radial-gradient(ellipse at 90% 90%, rgba(69, 112, 228, 0.12), transparent 32%),
        #f1f5fb;
}

.auth-shell {
    display: grid;
    width: min(100%, 1120px);
    min-height: min(760px, calc(100vh - 68px));
    grid-template-columns: minmax(0, 0.92fr) minmax(470px, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(207, 218, 235, 0.9);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(29, 53, 91, 0.14);
}

.auth-visual {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 44px;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 15% 95%, rgba(43, 102, 226, 0.45), transparent 54%),
        linear-gradient(145deg, #102447 0%, #152e56 58%, #1b3a6b 100%);
    color: #fff;
}

.auth-visual::before,
.auth-visual::after {
    position: absolute;
    z-index: -1;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(190, 216, 255, 0.13);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-visual::before {
    right: -205px;
    bottom: -98px;
}

.auth-visual::after {
    right: -146px;
    bottom: -40px;
    width: 270px;
    height: 270px;
}

.auth-visual-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-product-logo {
    display: block;
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.auth-visual-brand > div,
.auth-mobile-brand > div {
    display: grid;
    gap: 4px;
}

.auth-visual-brand strong {
    color: #fff;
    font-size: 0.9rem;
}

.auth-mobile-brand .auth-product-logo {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
}

.auth-visual-brand > div > span {
    color: rgba(228, 238, 255, 0.68);
    font-size: 0.7rem;
}

.auth-visual-copy {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 50px 0;
}

.auth-visual-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #b9d3ff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.auth-visual-kicker > span,
.auth-footer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #73d6b2;
    box-shadow: 0 0 0 4px rgba(115, 214, 178, 0.12);
}

.auth-visual-copy h2 {
    max-width: 430px;
    margin: 22px 0 15px;
    color: #fff;
    font-size: clamp(2.1rem, 3.7vw, 3.15rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1.12;
}

.auth-visual-copy p {
    max-width: 390px;
    margin: 0;
    color: rgba(229, 238, 253, 0.73);
    font-size: 0.9rem;
    line-height: 1.8;
}

.auth-visual-note {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 390px;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border: 1px solid rgba(210, 226, 255, 0.16);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(10px);
}

.auth-shield {
    display: grid;
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    place-items: center;
    border-radius: 12px;
    background: rgba(125, 211, 252, 0.16);
    color: #a8e3ff;
    font-size: 1rem;
    font-weight: 700;
}

.auth-visual-note strong,
.auth-visual-note div > span {
    display: block;
}

.auth-visual-note strong {
    margin-bottom: 4px;
    color: #fff;
    font-size: 0.76rem;
}

.auth-visual-note div > span {
    color: rgba(229, 238, 253, 0.7);
    font-size: 0.68rem;
    line-height: 1.5;
}

.auth-orbit {
    position: absolute;
    z-index: -1;
    top: 34%;
    right: -92px;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(200, 221, 255, 0.12);
    border-radius: 50%;
}

.auth-orbit-two {
    top: 41%;
    right: -38px;
    width: 160px;
    height: 160px;
    border-color: rgba(200, 221, 255, 0.1);
}

.auth-card {
    display: flex;
    width: auto;
    flex-direction: column;
    justify-content: center;
    padding: 62px clamp(38px, 6vw, 76px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-mobile-brand {
    display: none;
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading .eyebrow {
    margin-bottom: 12px;
    color: var(--primary);
    letter-spacing: 0.1em;
}

.auth-heading h1 {
    font-size: clamp(1.7rem, 2.8vw, 2.15rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1.18;
}

.auth-heading > p:last-child {
    margin-top: 11px;
    font-size: 0.84rem;
}

.auth-form {
    gap: 17px;
}

.auth-form label {
    gap: 8px;
    color: #35445c;
    font-size: 0.76rem;
}

.auth-form input {
    min-height: 49px;
    padding: 0 14px;
    border-color: #dce5f1;
    border-radius: 11px;
    background: #fbfcfe;
    font-size: 0.82rem;
}

.auth-form input:focus {
    border-color: #6794f2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(70, 121, 235, 0.12);
}

.auth-form input::placeholder {
    color: #9ba8ba;
}

.auth-form .optional {
    margin-left: 3px;
    font-size: 0.66rem;
}

.auth-form .form-submit {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
    border-radius: 11px;
    background: linear-gradient(105deg, #326ce1, #4d7ff0);
    box-shadow: 0 9px 20px rgba(50, 108, 225, 0.2);
    font-size: 0.82rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-form .form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(50, 108, 225, 0.27);
}

.auth-form .form-submit span {
    font-size: 1.1rem;
    line-height: 1;
}

.auth-principal-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #dce8ff;
    border-radius: 12px;
    background: #f4f7ff;
    color: #48638e;
}

.auth-principal-note > span {
    color: #4c78d2;
    font-size: 1rem;
}

.auth-principal-note p {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.55;
}

.auth-principal-note strong {
    color: #26477c;
    font-size: 0.75rem;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 30px;
    color: #8996a9;
    font-size: 0.66rem;
}

.auth-platform-link {
    align-self: center;
    margin-top: 18px;
    color: #8996a9;
    font-size: 0.68rem;
    text-decoration: none;
    transition: color 0.18s ease;
}

.auth-platform-link:hover,
.auth-platform-link:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.auth-footer-dot {
    width: 6px;
    height: 6px;
    background: #4db890;
    box-shadow: none;
}

.signed-in-email {
    max-width: 190px;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    margin: 0;
}

.logout-form .action-button {
    white-space: nowrap;
}

.admin-management-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 18px;
}

.admin-list-panel {
    min-width: 0;
}

.admin-hours-panel {
    grid-column: 1 / -1;
}

.deletion-requests-panel {
    grid-column: 1 / -1;
}

.dashboard-deletion-requests,
.dashboard-deletion-notifications {
    margin-bottom: 18px;
}

.deletion-request-list {
    display: grid;
    gap: 12px;
}

.deletion-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffaf0;
}

.deletion-request > div:first-child {
    display: grid;
    gap: 5px;
}

.deletion-request strong {
    color: var(--text);
    font-size: 0.82rem;
}

.deletion-request span,
.deletion-request small {
    color: var(--text-soft);
    font-size: 0.71rem;
}

.deletion-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deletion-request-actions form {
    margin: 0;
}

.deletion-decision {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.deletion-decision > div {
    display: grid;
    gap: 5px;
}

.deletion-decision strong {
    font-size: 0.8rem;
}

.deletion-decision span,
.deletion-decision small {
    color: var(--text-soft);
    font-size: 0.71rem;
}

.decision-approved {
    border-color: #ccebd8;
    background: #f2fbf5;
}

.decision-rejected {
    border-color: #f2d7d4;
    background: #fff7f6;
}

.deletion-decision form {
    margin: 0;
}

.audit-panel {
    min-width: 0;
}

.audit-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.audit-filters label {
    display: grid;
    min-width: 150px;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 600;
}

.audit-filters input,
.audit-filters select {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
}

.audit-limit {
    margin: 12px 0;
}

.audit-table {
    min-width: 920px;
}

.audit-table td {
    vertical-align: top;
}

.audit-secondary {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

.audit-agent {
    max-width: 250px;
    overflow-wrap: anywhere;
    font-size: 0.68rem;
}

.audit-outcome {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.audit-success {
    background: #e9f7ef;
    color: #217a49;
}

.audit-failure {
    background: #fff0ef;
    color: #b43a34;
}

.movement-layout.movement-readonly,
.management-grid.account-readonly {
    grid-template-columns: minmax(0, 1fr);
}

.admin-hours-panel .notice {
    margin-bottom: 14px;
}

.admin-hours-form {
    max-width: 580px;
}

.admin-hours-form .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-permission-option {
    display: flex !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px !important;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8faff;
}

.admin-permission-option span,
.admin-permission-option strong,
.admin-permission-option small {
    display: block;
}

.admin-permission-option strong {
    color: var(--text);
    font-size: 0.75rem;
}

.admin-permission-option small {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.66rem;
    font-weight: 400;
    line-height: 1.5;
}

.admin-permission-option input[type="checkbox"] {
    width: 19px;
    min-height: 19px;
    flex: 0 0 19px;
    accent-color: var(--primary);
}

.admin-list {
    display: grid;
}

.admin-account {
    display: grid;
    gap: 13px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.admin-account:first-child {
    padding-top: 0;
}

.admin-account:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.admin-account-heading,
.admin-account-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-account-heading > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.admin-account-heading strong {
    color: var(--text);
    font-size: 0.83rem;
}

.admin-account-heading > div span {
    overflow-wrap: anywhere;
    color: var(--text-soft);
    font-size: 0.72rem;
}

.admin-account-heading > div .principal-admin-badge {
    width: fit-content;
    margin-top: 3px;
    padding: 4px 8px;
    border: 1px solid #dce8ff;
    border-radius: 999px;
    background: #f1f6ff;
    color: #3764ad;
    font-size: 0.62rem;
    font-weight: 700;
}

.admin-account-heading > div .temporary-password-badge {
    width: fit-content;
    margin-top: 3px;
    padding: 4px 8px;
    border: 1px solid #f1dfb8;
    border-radius: 999px;
    background: #fff9eb;
    color: #946c1a;
    font-size: 0.62rem;
    font-weight: 700;
}

.admin-inline-form {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(140px, 1fr) minmax(175px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.admin-inline-form label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 600;
}

.admin-inline-form input {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font-size: 0.75rem;
}

.admin-inline-form .action-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.admin-password-form {
    grid-template-columns: minmax(180px, 0.8fr) auto;
    justify-content: start;
}

.admin-account-actions {
    justify-content: flex-start;
}

.admin-account-actions form {
    margin: 0;
}

.text-action {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
}

.danger-action {
    color: var(--danger);
}

@media (max-width: 1100px) {
    .admin-management-grid {
        grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    }

    .admin-inline-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .admin-permission-option {
        grid-column: 1 / -1;
    }

    .admin-inline-form .action-button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 820px) {
    .auth-page {
        padding: 20px;
    }

    .auth-shell {
        width: min(100%, 620px);
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-visual {
        min-height: 250px;
        padding: 27px 34px;
    }

    .auth-visual-copy {
        margin: 34px 0 22px;
    }

    .auth-visual-copy h2 {
        max-width: 500px;
        margin: 15px 0 8px;
        font-size: clamp(1.8rem, 5vw, 2.4rem);
    }

    .auth-visual-copy p {
        font-size: 0.8rem;
    }

    .auth-visual-note {
        display: none;
    }

    .auth-card {
        padding: 42px clamp(34px, 8vw, 70px);
    }

    .admin-management-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .deletion-request {
        align-items: flex-start;
        flex-direction: column;
    }

    .deletion-decision {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .auth-page {
        padding: 0;
        background: #fff;
    }

    .auth-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-visual {
        display: none;
    }

    .auth-card {
        padding: 29px 23px 24px;
    }

    .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 46px;
    }

    .auth-mobile-brand strong {
        color: var(--text);
        font-size: 0.83rem;
    }

    .auth-mobile-brand > div > span {
        color: var(--text-soft);
        font-size: 0.68rem;
    }

    .admin-inline-form,
    .admin-password-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-hours-form .form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-inline-form .action-button {
        grid-column: auto;
    }

    .admin-account-heading {
        align-items: flex-start;
    }
}

.sidebar {
    background:
        radial-gradient(ellipse at 8% 0%, rgba(110, 104, 255, 0.22), transparent 38%),
        linear-gradient(180deg, #191c32 0%, #111426 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-dashboard {
    box-shadow: 12px 0 40px rgba(24, 27, 49, 0.08);
}

.page-stack {
    display: grid;
    gap: 18px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.page-description {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.6;
}

.movement-history-table {
    min-width: 1040px;
}

.movement-history-table td {
    max-width: 310px;
    white-space: normal;
    vertical-align: top;
}

.movement-history-table td:first-child,
.movement-history-table td:nth-child(2),
.movement-history-table td:nth-child(3) {
    white-space: nowrap;
}

.history-event {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.history-event-created {
    border-color: #c8ead8;
    background: #effaf4;
    color: #26734c;
}

.history-event-updated {
    border-color: #d9d5ff;
    background: #f3f1ff;
    color: #5145b8;
}

.history-event-deleted {
    border-color: #f4d1d1;
    background: #fff3f3;
    color: #a33f3f;
}

.history-values,
.history-origin {
    min-width: 160px;
}

.history-values summary,
.history-origin summary {
    color: #5349be;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 700;
}

.history-values dl {
    display: grid;
    grid-template-columns: minmax(95px, auto) minmax(90px, 1fr);
    gap: 5px 9px;
    min-width: 280px;
    margin: 10px 0 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfe;
    font-size: 0.72rem;
}

.history-values dt {
    grid-column: 1 / -1;
    color: var(--text-soft);
    font-weight: 700;
}

.history-values dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.history-old {
    color: #a33f3f;
}

.history-new {
    color: #26734c;
}

.history-origin span {
    display: block;
    max-width: 250px;
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: var(--text-soft);
    font-size: 0.68rem;
    line-height: 1.5;
}

.period-balance-table {
    min-width: 850px;
}

.period-balance-table tfoot th,
.period-balance-table tfoot td {
    border-top: 2px solid var(--line);
    background: #f7f8fc;
    font-weight: 700;
}

.balance-currency-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 18px 0 6px;
    color: #008f96;
    font-size: 0.76rem;
}

.balance-currency-heading span {
    color: var(--text-soft);
    font-size: 0.68rem;
}

.print-balance-header {
    display: none;
}

@media (max-width: 680px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

.sidebar {
    scrollbar-color: rgba(151, 144, 255, 0.38) transparent;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
    width: 7px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(177, 172, 255, 0.52), rgba(113, 105, 245, 0.34));
    background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(193, 189, 255, 0.82), rgba(137, 128, 255, 0.68));
    background-clip: padding-box;
}

.sidebar .brand {
    margin-bottom: 30px;
    padding: 4px 7px 22px;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.sidebar .brand-mark {
    border-radius: 14px;
    background: linear-gradient(145deg, #a6a0ff, #6158e9);
    box-shadow: 0 8px 20px rgba(98, 88, 233, 0.35);
}

.sidebar .brand-copy strong {
    font-size: 0.88rem;
    letter-spacing: -0.02em;
}

.sidebar .brand-copy span {
    margin-top: 3px;
    color: #9da3bd;
    font-size: 0.68rem;
}

.nav-section-label {
    margin: 0 10px 10px;
    color: #737b99;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.sidebar .nav {
    gap: 5px;
}

.sidebar .nav-group {
    min-width: 0;
}

.sidebar .nav-group > summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.018);
    color: #aeb3c7;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    list-style: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .nav-group > summary::-webkit-details-marker {
    display: none;
}

.sidebar .nav-group > summary::marker {
    content: "";
}

.sidebar .nav-group > summary:hover,
.sidebar .nav-group-active > summary {
    border-color: rgba(151, 144, 255, 0.13);
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.sidebar .nav-group[open] > summary {
    border-color: rgba(151, 144, 255, 0.19);
    background: linear-gradient(105deg, rgba(113, 105, 245, 0.19), rgba(113, 105, 245, 0.055));
    box-shadow: inset 2px 0 rgba(177, 172, 255, 0.85);
}

.sidebar .nav-group > summary:focus-visible {
    outline: 3px solid rgba(177, 172, 255, 0.55);
    outline-offset: 2px;
}

.sidebar .nav-group > summary .icon {
    color: #8b91ac;
    font-size: 1rem;
}

.sidebar .nav-group-active > summary .icon {
    color: #b1acff;
}

.nav-chevron {
    display: grid;
    width: 23px;
    height: 23px;
    margin-left: auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #8b91ac;
    font-size: 0.82rem;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-group[open] .nav-chevron {
    transform: rotate(180deg);
    background: rgba(177, 172, 255, 0.1);
    color: #c1bdff;
}

.nav-group-links {
    display: grid;
    gap: 4px;
    margin: 5px 0 7px 12px;
    padding: 5px 0 5px 10px;
    border-left: 1px solid rgba(177, 172, 255, 0.18);
}

.nav-group:not([open]) > .nav-group-links {
    display: none;
}

.sidebar .nav-link {
    min-height: 44px;
    border-radius: 11px;
    color: #aeb3c7;
    font-size: 0.8rem;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-group-links .nav-link {
    min-height: 39px;
    gap: 9px;
    padding-right: 9px;
    padding-left: 11px;
    border-radius: 10px;
    font-size: 0.74rem;
}

.sidebar .nav-link .icon {
    color: #8b91ac;
    font-size: 1rem;
    transition: color 0.18s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.065);
    color: #fff;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    border-color: rgba(151, 144, 255, 0.24);
    background: linear-gradient(100deg, rgba(113, 105, 245, 0.28), rgba(113, 105, 245, 0.1));
    box-shadow: inset 2px 0 #9992ff;
    color: #fff;
    font-weight: 600;
}

.sidebar .nav-link.active .icon {
    color: #b1acff;
}

.sidebar-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 3px 10px;
    margin-top: auto;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
}

.sidebar-owner-mark {
    display: grid;
    width: 34px;
    height: 34px;
    grid-row: span 2;
    place-items: center;
    border: 1px solid rgba(181, 176, 255, 0.25);
    border-radius: 10px;
    background: rgba(113, 105, 245, 0.17);
    color: #c1bdff;
    font-size: 0.9rem;
    font-weight: 800;
}

.sidebar-owner-copy strong,
.sidebar-owner-copy span {
    display: block;
}

.sidebar-owner-copy strong {
    color: #f6f6ff;
    font-size: 0.74rem;
}

.sidebar-owner-copy span,
.software-version {
    color: #939ab4;
    font-size: 0.61rem;
}

.software-version {
    grid-column: 2;
    padding-top: 1px;
}

.dashboard-main {
    background:
        radial-gradient(ellipse at 92% 0%, rgba(222, 220, 255, 0.4), transparent 28%),
        #f5f6fb;
}

.dashboard-main .topbar {
    min-height: 54px;
    margin-bottom: 28px;
    padding: 0 0 15px;
    border-bottom: 1px solid rgba(218, 222, 236, 0.8);
}

.admin-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.admin-overview-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 16px 19px;
    border: 1px solid #e8e9f2;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 18px rgba(39, 43, 79, 0.035);
}

.admin-overview-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 12px;
    background: #f0efff;
    color: #655ee5;
    font-size: 1rem;
}

.admin-online-card .admin-overview-icon {
    background: #e8f8f1;
    color: #1a9b69;
    font-size: 0.72rem;
    box-shadow: inset 0 0 0 1px rgba(26, 155, 105, 0.1);
}

.admin-overview-card p {
    margin: 0 0 4px;
    color: #737991;
    font-size: 0.72rem;
    font-weight: 600;
}

.admin-overview-card strong {
    display: inline-block;
    margin-right: 7px;
    color: #202443;
    font-size: 1.28rem;
    letter-spacing: -0.04em;
}

.admin-overview-card small {
    color: #9298ad;
    font-size: 0.65rem;
}

.dashboard-main .signed-in-email {
    padding: 9px 12px;
    border: 1px solid #e7e8f1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
}

.dashboard-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 174px;
    margin-bottom: 4px;
    padding: 30px 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 21px;
    background:
        radial-gradient(circle at 85% 5%, rgba(164, 157, 255, 0.38), transparent 29%),
        linear-gradient(115deg, #26294a 0%, #454078 57%, #5d58a5 100%);
    box-shadow: 0 18px 38px rgba(45, 43, 91, 0.17);
}

.dashboard-hero::after {
    position: absolute;
    z-index: -1;
    top: -105px;
    right: 15%;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 0 32px rgba(255, 255, 255, 0.025), 0 0 0 64px rgba(255, 255, 255, 0.02);
    content: "";
}

.dashboard-hero .eyebrow {
    color: #c4c1f7;
}

.dashboard-hero h1 {
    color: #fff;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    letter-spacing: -0.055em;
}

.dashboard-hero-copy {
    max-width: 620px;
    margin: 9px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.81rem;
    line-height: 1.65;
}

.dashboard-hero .dashboard-header-actions {
    position: relative;
    z-index: 1;
}

.dashboard-hero .header-tag {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.dashboard-hero .dot {
    background: #66ddb0;
    box-shadow: 0 0 0 5px rgba(102, 221, 176, 0.15);
}

.dashboard-hero .action-button.primary {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #fff;
    box-shadow: 0 8px 20px rgba(18, 20, 44, 0.16);
    color: #35316f;
}

.dashboard-main .metrics-grid {
    gap: 16px;
}

.dashboard-main .metric-card {
    min-height: 150px;
    border-color: #e8e9f2;
    border-radius: 16px;
    background: linear-gradient(150deg, #fff 0%, #fff 68%, #fafaff 100%);
    box-shadow: 0 7px 22px rgba(39, 43, 79, 0.045);
}

.dashboard-main .metric-card:hover {
    border-color: #d9d7ff;
    box-shadow: 0 15px 30px rgba(50, 47, 105, 0.1);
}

.dashboard-main .metric-card::after {
    top: 20px;
    right: 20px;
    border: 1px solid rgba(105, 98, 222, 0.08);
}

.dashboard-main .metric-topline {
    color: #737991;
    font-weight: 600;
}

.dashboard-main .metric-value {
    color: #202443;
}

.dashboard-main .panel {
    border-color: #e8e9f2;
    border-radius: 17px;
    box-shadow: 0 7px 22px rgba(39, 43, 79, 0.045);
}

.dashboard-main .chart {
    border-radius: 12px 12px 0 0;
    background-color: #fcfcff;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, #eff0f7 56px, transparent 57px);
}

.dashboard-main .bar.incoming {
    background: linear-gradient(180deg, #a8a4ff, #645be9);
}

.dashboard-main .bar.outgoing {
    background: linear-gradient(180deg, #9fe3c9, #49bd91);
}

.dashboard-main .account-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(129, 122, 255, 0.2);
    border-radius: 17px;
    background:
        radial-gradient(circle at 95% 0%, rgba(151, 143, 255, 0.24), transparent 34%),
        linear-gradient(140deg, #292c4d, #191c32);
    box-shadow: 0 10px 24px rgba(35, 37, 68, 0.12);
}

.dashboard-main .account-card h4 {
    color: #fff;
    letter-spacing: -0.045em;
}

.dashboard-main .status-badge {
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-brand-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 5px 2px 0;
    color: #9298ad;
    font-size: 0.67rem;
}

.dashboard-brand-footer strong {
    color: #646b83;
    font-weight: 700;
}

@media (max-width: 820px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 25px;
    }

    .dashboard-hero .dashboard-header-actions {
        flex-wrap: wrap;
    }

    .dashboard-main .topbar {
        margin-bottom: 20px;
    }
}

@media (max-width: 520px) {
    .admin-overview {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .dashboard-hero {
        padding: 22px 19px;
        border-radius: 16px;
    }

    .dashboard-hero .dashboard-header-actions {
        align-items: stretch;
        width: 100%;
    }

    .dashboard-hero .header-tag,
    .dashboard-hero .action-button {
        justify-content: center;
        width: 100%;
    }

    .dashboard-brand-footer {
        flex-direction: column;
    }
}

.reconciliation-account-filter {
    align-items: end;
}

.reconciliation-account-filter label {
    display: grid;
    min-width: min(100%, 320px);
    gap: 8px;
    color: #424b5d;
    font-size: 0.77rem;
    font-weight: 600;
}

.reconciliation-account-filter select,
.reconciliation-match-form select {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 0.8rem;
}

.reconciliation-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.reconciliation-stat {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.reconciliation-stat span {
    color: var(--text-soft);
    font-size: 0.75rem;
}

.reconciliation-stat strong {
    font-size: 1.25rem;
}

.reconciliation-import-panel,
.report-panel {
    margin-bottom: 20px;
}

.reconciliation-import-form {
    grid-template-columns: minmax(200px, 1fr) auto;
    align-items: end;
}

.reconciliation-import-form .form-help {
    grid-column: 1 / -1;
    grid-row: 2;
}

.reconciliation-import-form .action-button {
    grid-column: 2;
    grid-row: 1;
}

.reconciliation-import-form input[type="file"] {
    height: auto;
    min-height: 44px;
    padding: 9px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fff;
}

.reconciliation-table {
    min-width: 760px;
}

.reconciliation-table td {
    white-space: normal;
}

.reconciliation-table td:first-child,
.reconciliation-table .amount-col {
    white-space: nowrap;
}

.reconciliation-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.reconciliation-status.matched {
    background: var(--success-soft);
    color: #087443;
}

.reconciliation-status.pending {
    background: var(--warning-soft);
    color: #9a5b00;
}

.reconciliation-action-cell {
    min-width: 260px;
}

.reconciliation-action-cell form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reconciliation-match-form select {
    min-width: 190px;
    max-width: 300px;
}

.reconciliation-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 0.75rem;
}

@media (max-width: 760px) {
    .reconciliation-summary {
        grid-template-columns: 1fr;
    }

    .reconciliation-import-form {
        grid-template-columns: 1fr;
    }

    .reconciliation-import-form .action-button,
    .reconciliation-import-form .form-help {
        grid-column: 1;
        grid-row: auto;
    }

    .reconciliation-action-cell form {
        align-items: stretch;
        flex-direction: column;
    }

    .reconciliation-pagination {
        flex-wrap: wrap;
    }
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.platform-sidebar-card {
    margin-top: auto;
}

.platform-sidebar-card .sidebar-owner-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 11px;
    background: rgba(125, 120, 255, 0.2);
    color: #c1bfff;
    font-weight: 800;
}

.platform-sidebar-card .sidebar-owner-copy strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.platform-sidebar-card .sidebar-owner-copy span,
.platform-sidebar-card .software-version {
    display: block;
    color: #a4a9ba;
    font-size: 0.73rem;
}

.platform-sidebar-card .software-version {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-logout-form {
    margin-top: 12px;
}

.platform-logout-form .action-button {
    width: 100%;
}

.platform-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.platform-metrics .metric-card:nth-child(1)::after {
    content: "▦";
}

.platform-metrics .metric-card:nth-child(2)::after {
    content: "✓";
}

.platform-metrics .metric-card:nth-child(3)::after {
    background: var(--warning-soft);
    color: var(--warning);
    content: "Ⅱ";
}

.platform-metrics .metric-card:nth-child(4)::after {
    background: var(--primary-soft);
    color: var(--primary);
    content: "♙";
}

.platform-create-panel,
.platform-company-list {
    margin-bottom: 0;
}

.platform-form-intro {
    max-width: 850px;
    margin: -4px 0 18px;
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.6;
}

.platform-company-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.platform-module-options {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.platform-module-options > .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.platform-modules-form .platform-module-options {
    width: 100%;
}

.platform-modules-form .platform-form-intro {
    margin: 0;
}

.platform-form-actions {
    grid-column: 1 / -1;
}

.platform-form-actions .action-button {
    min-width: 230px;
}

.platform-company-table {
    min-width: 820px;
}

.platform-company-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-company-actions .action-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
}

.platform-admin-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.platform-admin-list {
    display: grid;
}

.platform-admin-row {
    display: grid;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.platform-admin-row > form {
    margin: 0;
}

.platform-admin-row > form > .action-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
}

.platform-admin-row:first-child {
    padding-top: 0;
}

.platform-admin-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.platform-admin-identity strong,
.platform-admin-identity span {
    display: block;
}

.platform-admin-identity strong {
    color: var(--text);
    font-size: 0.82rem;
}

.platform-admin-identity span {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.72rem;
}

.platform-admin-permissions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.platform-admin-permission {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.68rem;
}

.platform-admin-permission input,
.platform-module-options .admin-permission-option input {
    accent-color: var(--primary);
}

.platform-company-table td:first-child {
    min-width: 220px;
}

.platform-company-avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-right: 10px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    vertical-align: middle;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-active {
    background: var(--success-soft);
    color: var(--success);
}

.status-inactive {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.platform-action-column {
    text-align: right;
}

.platform-action-column form {
    display: inline-block;
    margin: 0;
}

.platform-action-column .action-button {
    min-height: 36px;
    font-size: 0.72rem;
}

.platform-empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 34px 16px 28px;
    color: var(--text-soft);
    text-align: center;
}

.platform-empty-state strong {
    color: var(--text);
    font-size: 0.88rem;
}

.platform-empty-state p {
    margin: 0;
    font-size: 0.78rem;
}

.platform-empty-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 5px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.2rem;
}

@media (max-width: 760px) {
    .platform-company-form {
        grid-template-columns: 1fr;
    }

    .platform-admin-form {
        grid-template-columns: 1fr;
    }

    .platform-module-options {
        grid-template-columns: 1fr;
    }

    .platform-module-options > .eyebrow {
        grid-column: 1;
    }

    .platform-form-actions {
        grid-column: 1;
    }

    .platform-badge,
    .main-panel .signed-in-email {
        display: none;
    }
}

@media (max-width: 1000px) {
    .platform-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .platform-metrics {
        grid-template-columns: 1fr;
    }

    .platform-main .dashboard-header-actions {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .platform-main .dashboard-header-actions .header-tag {
        max-width: 100%;
    }
}

.forecast-section,
.forecast-form-panel,
.forecast-action-panel,
.forecast-list-panel {
    margin-bottom: 20px;
}

.forecast-section {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.forecast-table {
    min-width: 790px;
}

.forecast-table td:first-child,
.forecast-table td:nth-child(2),
.forecast-entries-table td:nth-child(2),
.forecast-entries-table td:nth-child(3),
.forecast-entries-table td:nth-child(5) {
    white-space: normal;
}

.forecast-table tfoot th {
    border-top: 2px solid var(--line);
    color: var(--text);
}

.forecast-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.forecast-form label {
    display: grid;
    gap: 8px;
    color: #424b5d;
    font-size: 0.77rem;
    font-weight: 600;
}

.forecast-form input,
.forecast-form select,
.forecast-realize-form select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: 0.83rem;
}

.forecast-form input:focus,
.forecast-form select:focus,
.forecast-realize-form select:focus {
    border-color: #8581f7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(86, 83, 232, 0.1);
}

.forecast-form label[hidden] {
    display: none;
}

.forecast-description-field,
.forecast-form-help,
.forecast-form-actions {
    grid-column: 1 / -1;
}

.forecast-form-actions,
.forecast-realize-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.forecast-realize-form label {
    display: grid;
    min-width: min(100%, 420px);
    flex: 1;
    gap: 8px;
    color: #424b5d;
    font-size: 0.77rem;
    font-weight: 600;
}

.forecast-actions {
    min-width: 230px;
}

.forecast-actions > a,
.forecast-actions > form {
    display: inline-flex;
    margin: 2px;
}

.forecast-actions .action-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.68rem;
}

.forecast-overdue {
    color: #b54708;
    font-weight: 700;
}

.forecast-cancelled-status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f3f6;
    color: #687385;
    font-size: 0.68rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .forecast-section {
        padding: 16px;
    }

    .forecast-form {
        grid-template-columns: 1fr;
    }

    .forecast-description-field,
    .forecast-form-help,
    .forecast-form-actions {
        grid-column: 1;
    }

    .forecast-actions {
        min-width: 180px;
    }
}
