:root {
    --ink: #163c38;
    --ink-deep: #0d2c2a;
    --ink-soft: #315b56;
    --coral: #ef795f;
    --coral-soft: #fff0eb;
    --mint: #bfe9d6;
    --mint-soft: #e9f8f1;
    --cream: #f5f2e9;
    --paper: #fffefa;
    --white: #ffffff;
    --text: #1e2e2c;
    --muted: #75827f;
    --line: #dde5e1;
    --danger: #c9423a;
    --shadow: 0 18px 50px rgba(22, 60, 56, .09);
    --radius-lg: 24px;
    --radius-md: 16px;
    --sidebar: 252px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        radial-gradient(circle at 95% 5%, rgba(239, 121, 95, .10), transparent 28rem),
        linear-gradient(135deg, rgba(22, 60, 56, .025) 25%, transparent 25%) 0 0 / 32px 32px,
        var(--cream);
    font-family: "DM Sans", "Avenir Next", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

svg {
    display: block;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar);
    padding: 28px 20px 20px;
    flex-direction: column;
    color: rgba(255, 255, 255, .78);
    background:
        radial-gradient(circle at 10% 90%, rgba(191, 233, 214, .16), transparent 17rem),
        var(--ink-deep);
    overflow-y: auto;
}

.brand {
    display: flex;
    margin: 0 8px 48px;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--coral);
    place-items: center;
    box-shadow: 0 9px 24px rgba(239, 121, 95, .24);
}

.brand-mark svg {
    width: 24px;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font: 800 18px/1.1 "Manrope", sans-serif;
    letter-spacing: -.4px;
}

.brand small {
    margin-top: 4px;
    color: rgba(255, 255, 255, .48);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.main-nav {
    display: grid;
    gap: 7px;
}

.nav-label {
    margin: 0 12px 8px;
    color: rgba(255, 255, 255, .34);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 48px;
    padding: 0 14px;
    align-items: center;
    gap: 13px;
    border-radius: 12px;
    color: rgba(255, 255, 255, .64);
    font-weight: 600;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.nav-link svg {
    width: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    transform: translateX(2px);
}

.nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.nav-link.is-active::before {
    position: absolute;
    left: -20px;
    width: 4px;
    height: 27px;
    border-radius: 0 5px 5px 0;
    background: var(--coral);
    content: "";
}

.sidebar-note {
    display: flex;
    margin-top: auto;
    padding: 16px 14px;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
}

.note-icon {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 50%;
    color: var(--ink-deep);
    background: var(--mint);
    font-size: 12px;
    font-weight: 800;
    place-items: center;
}

.sidebar-note p {
    margin: 0;
    color: rgba(255, 255, 255, .51);
    font-size: 11px;
    line-height: 1.55;
}

.sidebar-note strong {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .86);
}

.sidebar-footer {
    margin-top: 18px;
    color: rgba(255, 255, 255, .25);
    font-size: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.page-shell {
    min-height: 100vh;
    margin-left: var(--sidebar);
}

.topbar {
    display: flex;
    min-height: 84px;
    padding: 0 clamp(24px, 4vw, 58px);
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(22, 60, 56, .08);
    background: rgba(245, 242, 233, .77);
    backdrop-filter: blur(15px);
}

.topbar .eyebrow {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
    color: var(--ink);
    font: 800 20px/1.2 "Manrope", sans-serif;
    letter-spacing: -.45px;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-meta span:last-child {
    display: grid;
}

.topbar-meta small {
    color: var(--muted);
    font-size: 10px;
}

.topbar-meta strong {
    color: var(--ink);
    font: 700 14px "Manrope", sans-serif;
}

.status-dot {
    width: 9px;
    height: 9px;
    border: 2px solid var(--cream);
    border-radius: 50%;
    background: #45a57a;
    box-shadow: 0 0 0 3px rgba(69, 165, 122, .15);
}

.page-content {
    width: min(100%, 1660px);
    margin: 0 auto;
    padding: 42px clamp(24px, 4vw, 58px) 64px;
}

.page-content--budgets {
    width: 100%;
    max-width: none;
    padding-right: clamp(14px, 2vw, 30px);
    padding-left: clamp(14px, 2vw, 30px);
}

.hero-row,
.page-heading {
    display: flex;
    margin-bottom: 30px;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.hero-row h2,
.page-heading h2 {
    max-width: 720px;
    margin: 7px 0 8px;
    color: var(--ink-deep);
    font: 800 clamp(27px, 3vw, 40px)/1.12 "Manrope", sans-serif;
    letter-spacing: -1.25px;
}

.hero-row p,
.page-heading p {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.section-kicker {
    color: var(--coral);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.button {
    display: inline-flex;
    min-height: 45px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

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

.button--primary {
    color: #fff;
    background: var(--coral);
    box-shadow: 0 11px 24px rgba(239, 121, 95, .22);
}

.button--primary:hover {
    background: #e96b51;
    box-shadow: 0 14px 29px rgba(239, 121, 95, .29);
}

.button--dark {
    color: #fff;
    background: var(--ink);
}

.button--ghost {
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--white);
}

.button-icon {
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
}

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

.metric-card {
    position: relative;
    min-height: 158px;
    padding: 22px;
    border: 1px solid rgba(22, 60, 56, .08);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.metric-card::after {
    position: absolute;
    right: -24px;
    bottom: -40px;
    width: 118px;
    height: 118px;
    border: 18px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    content: "";
}

.metric-card--ink {
    color: #fff;
    border-color: var(--ink);
    background: var(--ink);
}

.metric-card--coral {
    color: #692d23;
    border-color: #f4b3a2;
    background: #f8b19f;
}

.metric-card--mint {
    color: var(--ink);
    border-color: #a9ddc5;
    background: var(--mint);
}

.metric-card--progress {
    display: grid;
    background: var(--paper);
    grid-template-columns: 1fr auto;
    align-items: center;
}

.metric-card--progress::after {
    border-color: rgba(22, 60, 56, .04);
}

.metric-top {
    position: relative;
    z-index: 1;
    display: flex;
    margin-bottom: 26px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.metric-card--progress .metric-top {
    align-self: start;
    grid-column: 1 / -1;
    margin-bottom: -7px;
}

.metric-glyph {
    display: grid;
    width: 27px;
    height: 27px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: .65;
    place-items: center;
}

.metric-card > strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 8px;
    font: 800 clamp(19px, 1.6vw, 27px)/1.15 "Manrope", sans-serif;
    letter-spacing: -.8px;
}

.metric-card > small {
    position: relative;
    z-index: 1;
    font-size: 10px;
    opacity: .64;
}

.progress-ring {
    --progress: 0;
    display: grid;
    width: 67px;
    height: 67px;
    border-radius: 50%;
    background: conic-gradient(var(--coral) calc(var(--progress) * 1%), #e8ede9 0);
    place-items: center;
}

.progress-ring::before {
    width: 51px;
    height: 51px;
    border-radius: 50%;
    background: var(--paper);
    content: "";
}

.progress-ring span {
    position: absolute;
    color: var(--ink);
    font: 800 12px "Manrope", sans-serif;
}

.panel {
    border: 1px solid rgba(22, 60, 56, .09);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    padding: 25px 26px 20px;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.panel-header h3 {
    margin: 5px 0 0;
    color: var(--ink);
    font: 800 20px "Manrope", sans-serif;
    letter-spacing: -.5px;
}

.panel-header p {
    margin: 5px 0 0;
    color: var(--muted);
}

.data-count {
    padding: 6px 10px;
    border-radius: 20px;
    color: var(--ink-soft);
    background: var(--mint-soft);
    font-size: 11px;
    font-weight: 700;
}

.filter-bar {
    display: flex;
    padding: 0 26px 20px;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.search-control {
    position: relative;
    min-width: 210px;
    flex: 1 1 240px;
}

.search-control svg,
.table-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 17px;
    transform: translateY(-50%);
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
}

.search-control input,
.table-search input {
    width: 100%;
    height: 43px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fff;
}

.search-control input:focus,
.table-search input:focus {
    border-color: var(--ink-soft);
    box-shadow: 0 0 0 3px rgba(22, 60, 56, .07);
}

.select-control {
    display: grid;
    min-width: 170px;
    gap: 5px;
}

.select-control--compact {
    min-width: 145px;
}

.select-control span {
    margin-left: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.select-control select {
    height: 43px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fff;
}

.button--filter {
    min-height: 43px;
}

.table-wrap {
    width: 100%;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow-x: auto;
}

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

.budget-table {
    min-width: 1580px;
}

.data-table th,
.data-table td {
    padding: 15px 13px;
    border-bottom: 1px solid #e9eeeb;
    text-align: left;
    vertical-align: middle;
}

.data-table th:first-child,
.data-table td:first-child {
    padding-left: 26px;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-right: 26px;
}

.data-table th {
    color: var(--muted);
    background: #f8faf7;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .65px;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr:not(:has(.empty-state)) {
    transition: background .15s ease;
}

.data-table tbody tr:not(:has(.empty-state)):hover {
    background: #fbfcf8;
}

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

.data-table code,
.text-code {
    color: var(--ink-soft);
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .3px;
}

.numeric {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.text-strong {
    color: var(--text);
    font-weight: 700;
}

.text-muted {
    color: var(--muted);
}

.text-wide {
    min-width: 190px;
}

.value-positive {
    color: #267e5a;
    font-weight: 800;
}

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

.month-chip,
.function-badge {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    white-space: nowrap;
}

.month-chip {
    color: #9b4a38;
    background: var(--coral-soft);
    font-weight: 700;
}

.function-badge {
    color: var(--ink);
    background: var(--mint-soft);
    font-weight: 700;
}

.action-column {
    width: 86px;
    text-align: center !important;
}

.row-actions {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.row-actions form {
    margin: 0;
}

.row-action {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink);
    background: #fff;
    font-size: 15px;
    text-decoration: none;
    place-items: center;
    transition: background .15s ease, border .15s ease;
}

.row-action:hover {
    border-color: var(--ink);
    background: var(--mint-soft);
}

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

.row-action--danger:hover {
    border-color: #f1bbb6;
    background: #fff2f0;
}

.empty-state {
    padding: 54px 20px;
    text-align: center;
}

.empty-state > span {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 13px;
    border-radius: 17px;
    color: var(--coral);
    background: var(--coral-soft);
    font-size: 27px;
    place-items: center;
}

.empty-state h4 {
    margin: 0 0 5px;
    color: var(--ink);
    font: 800 16px "Manrope", sans-serif;
}

.empty-state p {
    margin: 0 0 14px;
    color: var(--muted);
}

.empty-state a {
    color: var(--coral);
    font-weight: 800;
    text-decoration: none;
}

.empty-state--small {
    padding: 28px;
}

.toast {
    position: fixed;
    z-index: 80;
    top: 22px;
    right: 24px;
    display: flex;
    width: min(390px, calc(100vw - 40px));
    min-height: 58px;
    padding: 11px 12px;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(22, 60, 56, .12);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(13, 44, 42, .18);
    animation: toast-in .35s ease both;
}

.toast > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    color: #fff;
    background: #3d9a72;
    font-weight: 800;
    place-items: center;
}

.toast--error > span {
    background: var(--danger);
}

.toast p {
    margin: 0;
    flex: 1;
    font-weight: 600;
}

.toast button {
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 20px;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
    transition: .25s ease;
}

.back-link {
    display: block;
    margin-bottom: 22px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.error-box {
    margin-bottom: 18px;
    padding: 16px 20px;
    border: 1px solid #f3c0ba;
    border-radius: 13px;
    color: #86362e;
    background: #fff1ef;
}

.error-box ul {
    margin: 7px 0 0;
    padding-left: 19px;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.budget-form {
    padding: 4px 28px 28px;
}

.form-section {
    padding: 27px 0 30px;
    border-bottom: 1px solid var(--line);
}

.form-section-title {
    display: flex;
    margin-bottom: 22px;
    align-items: start;
    gap: 12px;
}

.form-section-title > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    color: #a44934;
    background: var(--coral-soft);
    font: 800 10px "Manrope", sans-serif;
    place-items: center;
}

.form-section-title h3 {
    margin: 0 0 3px;
    color: var(--ink);
    font: 800 16px "Manrope", sans-serif;
}

.form-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.form-grid {
    display: grid;
    gap: 17px;
}

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

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

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

.field > span {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
}

.field > span b {
    color: var(--coral);
}

.field input,
.field select {
    width: 100%;
    height: 47px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fff;
    transition: border .15s ease, box-shadow .15s ease;
}

.field select {
    padding-right: 35px;
}

.field input:focus,
.field select:focus {
    border-color: var(--ink-soft);
    box-shadow: 0 0 0 3px rgba(22, 60, 56, .07);
}

.field--readonly input {
    color: var(--muted);
    background: #f3f5f1;
    cursor: default;
}

.field small {
    color: var(--muted);
    font-size: 10px;
}

.currency-field > div {
    position: relative;
}

.currency-field i {
    position: absolute;
    left: 13px;
    top: 50%;
    color: var(--muted);
    font-style: normal;
    font-weight: 700;
    transform: translateY(-50%);
}

.currency-field input {
    padding-left: 38px;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.form-helper {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.form-helper a {
    color: var(--coral);
    font-weight: 800;
}

.form-actions {
    display: flex;
    padding-top: 26px;
    justify-content: flex-end;
    gap: 10px;
}

.calculation-card {
    position: sticky;
    top: 20px;
    padding: 26px;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 100% 100%, rgba(191, 233, 214, .18), transparent 15rem),
        var(--ink-deep);
    box-shadow: 0 22px 50px rgba(13, 44, 42, .18);
}

.calculation-card h3 {
    margin: 7px 0 8px;
    font: 800 22px "Manrope", sans-serif;
}

.calculation-card > p {
    margin: 0 0 26px;
    color: rgba(255, 255, 255, .5);
    font-size: 12px;
    line-height: 1.55;
}

.calc-block,
.calc-result,
.calc-available {
    display: grid;
    gap: 5px;
}

.calc-block {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.calc-block span,
.calc-formula span,
.calc-result span,
.calc-available span {
    color: rgba(255, 255, 255, .48);
    font-size: 10px;
    font-weight: 700;
}

.calc-block strong {
    font: 800 20px "Manrope", sans-serif;
}

.calc-formula {
    display: grid;
    padding: 18px 0;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 8px;
}

.calc-formula div {
    display: grid;
    gap: 4px;
}

.calc-formula b {
    font-size: 12px;
}

.calc-formula em {
    color: var(--coral);
    font-style: normal;
    font-size: 20px;
}

.calc-result {
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
}

.calc-result strong {
    font: 800 18px "Manrope", sans-serif;
}

.calc-available {
    margin-top: 20px;
    padding-top: 19px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.calc-available strong {
    color: var(--mint);
    font: 800 27px "Manrope", sans-serif;
    letter-spacing: -.8px;
}

.calc-available strong.is-negative {
    color: #ff9e8a;
}

.calc-note {
    display: block;
    margin-top: 9px;
    color: rgba(255, 255, 255, .34);
    font-size: 9px;
}

.master-hero {
    margin-bottom: 24px;
}

.master-stats {
    display: grid;
    margin-bottom: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.master-stat {
    display: grid;
    min-height: 105px;
    padding: 18px;
    align-items: center;
    border: 1px solid rgba(22, 60, 56, .09);
    border-radius: var(--radius-md);
    background: rgba(255, 254, 250, .75);
    grid-template-columns: auto 1fr auto;
    gap: 13px;
    text-decoration: none;
    transition: transform .2s ease, border .2s ease, box-shadow .2s ease;
}

.master-stat:hover,
.master-stat.is-active {
    border-color: rgba(22, 60, 56, .22);
    box-shadow: 0 12px 28px rgba(22, 60, 56, .08);
    transform: translateY(-2px);
}

.master-stat.is-active {
    background: var(--mint-soft);
}

.master-stat > span {
    display: grid;
    width: 49px;
    height: 49px;
    border-radius: 14px;
    color: #9d4836;
    background: var(--coral-soft);
    font: 800 18px "Manrope", sans-serif;
    place-items: center;
}

.master-stat strong,
.master-stat small {
    display: block;
}

.master-stat strong {
    margin-bottom: 5px;
    color: var(--ink);
    font: 800 14px "Manrope", sans-serif;
}

.master-stat small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.master-stat > b {
    color: var(--coral);
    font-size: 18px;
}

.master-panel-header {
    align-items: center;
}

.table-search {
    position: relative;
    width: min(260px, 100%);
}

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

.number-column {
    width: 68px;
    color: var(--muted);
}

.modal {
    width: min(510px, calc(100vw - 28px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: 0 28px 80px rgba(13, 44, 42, .28);
}

.modal::backdrop {
    background: rgba(8, 29, 27, .68);
    backdrop-filter: blur(4px);
}

.modal[open] {
    animation: modal-in .22s ease both;
}

.modal-card {
    background: var(--paper);
}

.modal-header {
    display: flex;
    padding: 25px 26px 18px;
    align-items: start;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.modal-header h3 {
    margin: 5px 0 0;
    color: var(--ink);
    font: 800 21px "Manrope", sans-serif;
}

.modal-close {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    background: #fff;
    font-size: 20px;
    place-items: center;
}

.modal-body {
    display: grid;
    padding: 24px 26px 13px;
    gap: 17px;
}

.modal-hint {
    margin: 0;
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--ink-soft);
    background: var(--mint-soft);
    font-size: 11px;
}

.modal-actions {
    display: flex;
    padding: 18px 26px 26px;
    justify-content: flex-end;
    gap: 9px;
}

.icon-button {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: #fff;
    place-items: center;
}

.icon-button svg {
    width: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.sidebar-backdrop {
    display: none;
}

.reveal {
    animation: reveal .55s cubic-bezier(.2, .75, .25, 1) both;
}

.reveal-delay-1 {
    animation-delay: .08s;
}

.reveal-delay-2 {
    animation-delay: .16s;
}

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

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-13px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

    .form-layout {
        grid-template-columns: minmax(0, 1fr) 285px;
    }

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

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

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

    .page-shell {
        margin-left: 0;
    }

    .icon-button {
        display: grid;
    }

    .topbar {
        justify-content: flex-start;
        gap: 15px;
    }

    .topbar-meta {
        margin-left: auto;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 20;
        inset: 0;
        background: rgba(8, 29, 27, .55);
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open .sidebar-backdrop {
        display: block;
    }

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

    .calculation-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: 72px;
        padding: 0 18px;
    }

    .topbar .eyebrow,
    .topbar-meta {
        display: none;
    }

    .topbar h1 {
        font-size: 17px;
    }

    .page-content {
        padding: 29px 15px 45px;
    }

    .hero-row,
    .page-heading {
        display: grid;
        align-items: start;
    }

    .hero-row h2,
    .page-heading h2 {
        font-size: 27px;
        letter-spacing: -.8px;
    }

    .hero-row .button {
        width: 100%;
    }

    .metric-grid,
    .master-stats {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 145px;
    }

    .panel {
        border-radius: 18px;
    }

    .panel-header,
    .master-panel-header {
        display: grid;
        padding: 21px 18px 16px;
        align-items: start;
    }

    .filter-bar {
        padding: 0 18px 18px;
    }

    .search-control,
    .select-control,
    .select-control--compact {
        width: 100%;
        min-width: 100%;
        flex-basis: 100%;
    }

    .button--filter {
        flex: 1;
    }

    .budget-form {
        padding: 0 18px 20px;
    }

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

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

    .calculation-card {
        padding: 23px;
    }

    .master-stat {
        min-height: 88px;
    }

    .table-search {
        width: 100%;
    }

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

    .modal-header,
    .modal-body,
    .modal-actions {
        padding-right: 20px;
        padding-left: 20px;
    }
}

/* Reusable loading states */
.button.is-loading,
.row-action.is-loading,
.logout-button.is-loading,
[data-loading-link].is-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.button.is-loading::after,
.row-action.is-loading::after,
.logout-button.is-loading::after,
[data-loading-link].is-loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(22, 60, 56, .22);
    border-top-color: var(--ink);
    border-radius: 50%;
    content: "";
    animation: button-spin .65s linear infinite;
}

.button--primary.is-loading::after,
.button--dark.is-loading::after,
.nav-link.is-loading::after {
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #fff;
}

.nav-link.is-loading::after {
    left: auto;
    right: 14px;
    margin-left: 0;
}

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

/* Dashboard */
.dashboard-hero {
    margin-bottom: 20px;
}

.period-banner {
    display: flex;
    margin-bottom: 16px;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid rgba(22, 60, 56, .09);
    border-radius: 13px;
    background: rgba(255, 254, 250, .72);
}

.period-banner > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.period-banner span:not(.status-dot) {
    color: var(--muted);
    font-size: 11px;
}

.period-banner strong {
    color: var(--ink);
    font: 800 12px "Manrope", sans-serif;
}

.period-banner a {
    color: var(--coral);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 16px;
}

.insight-panel {
    padding-bottom: 22px;
}

.month-trend-list,
.function-progress-list {
    display: grid;
    padding: 0 26px;
    gap: 20px;
}

.month-trend-item {
    display: grid;
    grid-template-columns: 105px minmax(120px, 1fr) 155px;
    align-items: center;
    gap: 15px;
}

.trend-label,
.trend-value {
    display: grid;
    gap: 3px;
}

.trend-label strong,
.trend-value strong {
    color: var(--ink);
    font-size: 11px;
}

.trend-label span,
.trend-value span {
    color: var(--muted);
    font-size: 9px;
}

.trend-value {
    text-align: right;
}

.trend-bars {
    display: grid;
    gap: 6px;
}

.trend-bar {
    display: block;
    height: 7px;
    border-radius: 8px;
    background: #e9eeeb;
    overflow: hidden;
}

.trend-bar i {
    display: block;
    width: var(--width);
    height: 100%;
    border-radius: inherit;
    animation: bar-grow .75s cubic-bezier(.2, .75, .25, 1) both;
}

.trend-bar--budget i {
    background: var(--mint);
}

.trend-bar--consumed i {
    background: var(--coral);
}

@keyframes bar-grow {
    from { width: 0; }
}

.chart-legend {
    display: flex;
    margin: 25px 26px 0;
    padding-top: 17px;
    gap: 18px;
    border-top: 1px solid var(--line);
}

.chart-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.chart-legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
}

.legend-budget { background: var(--mint); }
.legend-consumed { background: var(--coral); }

.function-progress-item {
    display: grid;
    grid-template-columns: 31px 1fr;
    align-items: start;
    gap: 12px;
}

.function-rank {
    display: grid;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    color: #9b4a38;
    background: var(--coral-soft);
    font: 800 9px "Manrope", sans-serif;
    place-items: center;
}

.function-progress-label {
    display: flex;
    margin-bottom: 7px;
    justify-content: space-between;
    gap: 10px;
}

.function-progress-label strong {
    color: var(--ink);
    font-size: 11px;
}

.function-progress-label span {
    color: var(--coral);
    font-size: 10px;
    font-weight: 800;
}

.function-track {
    display: block;
    height: 6px;
    margin-bottom: 6px;
    border-radius: 7px;
    background: #e9eeeb;
    overflow: hidden;
}

.function-track i {
    display: block;
    width: var(--width);
    height: 100%;
    border-radius: inherit;
    background: var(--ink);
    animation: bar-grow .75s ease both;
}

.function-progress-item small {
    color: var(--muted);
    font-size: 9px;
}

/* AJAX DataTables */
.data-panel-header {
    align-items: center;
}

.data-panel-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-source-badge {
    display: flex;
    padding: 7px 11px;
    align-items: center;
    gap: 7px;
    border-radius: 18px;
    color: var(--ink-soft);
    background: var(--mint-soft);
    font-size: 10px;
    font-weight: 800;
}

.data-source-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #45a57a;
    box-shadow: 0 0 0 3px rgba(69, 165, 122, .14);
}

.datatable-toolbar {
    display: flex;
    padding: 0 26px 20px;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.datatable-search-control {
    min-width: 250px;
}

.datatable-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

.datatable-wrap .dataTables_wrapper {
    position: relative;
}

.table-boot-status {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.table-boot-status span {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(22, 60, 56, .18);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: button-spin .65s linear infinite;
}

table.dataTable.ajax-table {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

table.dataTable.ajax-table.no-footer {
    border-bottom: 0;
}

table.dataTable.ajax-table thead th,
table.dataTable.ajax-table thead td {
    border-bottom: 1px solid var(--line);
}

table.dataTable.ajax-table tbody td {
    box-sizing: border-box;
}

.dataTables_wrapper .dataTables_processing {
    z-index: 5;
    top: 65px;
    left: 50%;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateX(-50%);
}

.datatable-loader {
    display: inline-flex;
    padding: 10px 14px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow);
    font-size: 11px;
    font-weight: 700;
}

.datatable-loader i {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(22, 60, 56, .2);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: button-spin .65s linear infinite;
}

.datatable-footer {
    display: flex;
    padding: 18px 26px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
}

.datatable-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    float: none;
    padding: 0;
    color: var(--muted);
    font-size: 10px;
}

.dataTables_wrapper .dataTables_length select {
    height: 32px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
}

.dataTables_length .select2-container {
    width: 72px !important;
    margin: 0 4px;
    vertical-align: middle;
}

.dataTables_length .select2-container .select2-selection--single {
    height: 32px;
    border-radius: 8px;
}

.dataTables_length .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 9px;
    line-height: 30px;
}

.dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 3px;
}

.dataTables_wrapper .dataTables_paginate {
    float: none;
    padding: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    min-width: 32px;
    height: 32px;
    margin: 0 2px;
    padding: 6px 9px;
    border: 1px solid var(--line) !important;
    border-radius: 8px;
    color: var(--ink) !important;
    background: #fff !important;
    box-shadow: none;
    font-size: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    border-color: var(--ink) !important;
    color: #fff !important;
    background: var(--ink) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: .35;
}

.master-table.ajax-table {
    min-width: 720px;
}

/* Import module and reusable progress */
.import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 18px;
}

.import-card {
    padding: 28px;
}

.import-year-field {
    max-width: 270px;
    margin-bottom: 30px;
}

.import-step {
    padding-top: 27px;
    border-top: 1px solid var(--line);
}

.upload-dropzone {
    display: grid;
    min-height: 220px;
    padding: 28px;
    border: 1.5px dashed #b8c7c1;
    border-radius: 17px;
    cursor: pointer;
    background: #fafbf7;
    text-align: center;
    place-items: center;
    align-content: center;
    transition: border .2s ease, background .2s ease, transform .2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging,
.upload-dropzone.has-file {
    border-color: var(--coral);
    background: var(--coral-soft);
    transform: translateY(-2px);
}

.upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-icon {
    display: grid;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 17px;
    color: var(--ink);
    background: var(--mint);
    place-items: center;
}

.upload-icon svg {
    width: 25px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.upload-dropzone strong {
    margin-bottom: 5px;
    color: var(--ink);
    font: 800 14px "Manrope", sans-serif;
}

.upload-dropzone small {
    color: var(--muted);
    font-size: 10px;
}

.progress-component {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8faf7;
}

.progress-component__header {
    display: flex;
    margin-bottom: 10px;
    justify-content: space-between;
    gap: 10px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
}

.progress-component__track {
    height: 8px;
    border-radius: 9px;
    background: #e3eae6;
    overflow: hidden;
}

.progress-component__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--coral);
    transition: width .28s ease;
}

.progress-component.is-processing .progress-component__track span {
    background: linear-gradient(90deg, var(--coral), #f7b09f, var(--coral));
    background-size: 200% 100%;
    animation: progress-shimmer 1.1s linear infinite;
}

.progress-component.is-complete .progress-component__track span { background: #45a57a; }
.progress-component.is-error .progress-component__track span { background: var(--danger); }

.progress-component p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 10px;
}

@keyframes progress-shimmer {
    to { background-position: -200% 0; }
}

.import-result {
    margin-top: 15px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 12px;
}

.import-result--success {
    border-color: #b8dfcd;
    color: var(--ink);
    background: var(--mint-soft);
}

.import-result--error {
    border-color: #efbeb7;
    color: #89372f;
    background: #fff1ef;
}

.import-result strong,
.import-result p {
    display: block;
    margin: 0;
}

.import-result p {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.5;
}

.import-result a {
    display: inline-block;
    margin-top: 9px;
    color: var(--coral);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.import-actions {
    padding-top: 20px;
}

.import-guide {
    padding: 25px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--ink-deep);
    box-shadow: 0 22px 50px rgba(13, 44, 42, .17);
}

.import-guide h3 {
    margin: 7px 0 7px;
    font: 800 21px "Manrope", sans-serif;
}

.import-guide > p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, .48);
    font-size: 11px;
    line-height: 1.6;
}

.column-guide {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    list-style: none;
}

.column-guide li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .7);
    font-size: 9px;
}

.column-guide span {
    display: grid;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    border-radius: 6px;
    color: var(--ink-deep);
    background: var(--mint);
    font-weight: 800;
    place-items: center;
}

.guide-note {
    display: flex;
    margin-top: 23px;
    padding: 14px;
    align-items: start;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
}

.guide-note > span {
    display: grid;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    border-radius: 7px;
    color: var(--ink-deep);
    background: var(--mint);
    font-weight: 800;
    place-items: center;
}

.guide-note p {
    margin: 0;
    color: rgba(255, 255, 255, .47);
    font-size: 10px;
    line-height: 1.5;
}

.guide-note strong {
    display: block;
    margin-bottom: 2px;
    color: #fff;
}

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

    .import-guide {
        order: -1;
    }
}

@media (max-width: 760px) {
    .period-banner,
    .datatable-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid {
        display: grid;
    }

    .month-trend-item {
        grid-template-columns: 90px 1fr;
    }

    .trend-value {
        display: none;
    }

    .datatable-toolbar {
        display: grid;
        padding: 0 18px 18px;
        grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
        align-items: end;
    }

    .datatable-toolbar .datatable-search-control {
        width: 100%;
        min-width: 0;
        grid-column: 1 / -1;
    }

    .datatable-toolbar .select-control {
        width: auto;
        min-width: 0;
    }

    .datatable-toolbar .button {
        width: auto;
        min-width: 78px;
    }

    .datatable-wrap {
        overflow-x: auto;
    }

    .datatable-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .dataTables_wrapper .dataTables_paginate {
        align-self: stretch;
        overflow-x: auto;
        white-space: nowrap;
    }

    .import-card,
    .import-guide {
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .datatable-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .datatable-toolbar .datatable-search-control {
        grid-column: 1 / -1;
    }

    .datatable-toolbar .select-control,
    .datatable-toolbar .button {
        width: 100%;
    }
}

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

/* Global application controls */
.topbar-actions {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 17px;
}

.user-chip {
    display: flex;
    padding-left: 17px;
    align-items: center;
    gap: 9px;
    border-left: 1px solid rgba(22, 60, 56, .12);
}

.user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: var(--ink);
    font: 800 13px "Manrope", sans-serif;
    place-items: center;
}

.user-chip > span:last-child {
    display: grid;
}

.user-chip small {
    color: var(--muted);
    font-size: 9px;
}

.user-chip strong {
    max-width: 130px;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions form {
    margin: 0;
}

.logout-button {
    display: grid;
    width: 37px;
    height: 37px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
    color: var(--muted);
    background: rgba(255, 255, 255, .65);
    place-items: center;
    transition: color .2s ease, border .2s ease, background .2s ease;
}

.logout-button:hover {
    border-color: #efb4ad;
    color: var(--danger);
    background: #fff2f0;
}

.logout-button svg {
    width: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.select2-container {
    max-width: 100%;
    text-align: left;
}

.select2-container .select2-selection--single {
    height: 47px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fff;
    transition: border .15s ease, box-shadow .15s ease;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--ink-soft);
    box-shadow: 0 0 0 3px rgba(22, 60, 56, .07);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 38px 0 13px;
    color: var(--text);
    line-height: 45px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #96a09d;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 10px;
    right: 9px;
}

.select2-dropdown {
    z-index: 1000;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(13, 44, 42, .14);
    overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    height: 39px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}

.select2-container--default .select2-results__option {
    padding: 10px 12px;
    font-size: 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff;
    background: var(--ink);
}

.filter-bar .select2-container .select2-selection--single {
    height: 43px;
}

.filter-bar .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 41px;
}

.filter-bar .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 8px;
}

/* Login uses the same global layout and visual language as the application. */
.auth-page {
    min-height: 100vh;
    background: var(--cream);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(400px, .95fr) minmax(480px, 1.05fr);
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    padding: clamp(30px, 5vw, 66px);
    flex-direction: column;
    color: #fff;
    background:
        linear-gradient(rgba(13, 44, 42, .12), rgba(13, 44, 42, .44)),
        radial-gradient(circle at 80% 18%, rgba(239, 121, 95, .27), transparent 18rem),
        radial-gradient(circle at 15% 86%, rgba(191, 233, 214, .18), transparent 22rem),
        var(--ink-deep);
    overflow: hidden;
}

.auth-visual::before,
.auth-visual::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}

.auth-visual::before {
    top: -15vw;
    right: -16vw;
    width: 38vw;
    height: 38vw;
}

.auth-visual::after {
    right: -8vw;
    bottom: -14vw;
    width: 30vw;
    height: 30vw;
    border-width: 50px;
}

.auth-brand {
    position: relative;
    z-index: 1;
    margin: 0;
}

.auth-copy {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.auth-copy h1 {
    margin: 13px 0 20px;
    font: 800 clamp(37px, 4.5vw, 67px)/1.05 "Manrope", sans-serif;
    letter-spacing: -2.5px;
}

.auth-copy h1 em {
    color: var(--coral);
    font-style: normal;
}

.auth-copy p {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, .58);
    font-size: 15px;
    line-height: 1.7;
}

.auth-visual-footer {
    position: relative;
    z-index: 1;
    display: flex;
    padding-top: 25px;
    gap: 30px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.auth-visual-footer span {
    color: rgba(255, 255, 255, .43);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.auth-visual-footer b {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font: 800 18px "Manrope", sans-serif;
}

.auth-content {
    display: grid;
    min-height: 100vh;
    padding: 45px clamp(28px, 7vw, 105px);
    background:
        radial-gradient(circle at 100% 0, rgba(239, 121, 95, .11), transparent 25rem),
        linear-gradient(135deg, rgba(22, 60, 56, .025) 25%, transparent 25%) 0 0 / 30px 30px,
        var(--cream);
    place-items: center;
}

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

.login-heading {
    margin-bottom: 30px;
}

.login-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 27px;
    border-radius: 16px;
    color: var(--ink);
    background: var(--mint);
    box-shadow: 0 12px 30px rgba(22, 60, 56, .1);
    place-items: center;
}

.login-icon svg {
    width: 24px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-heading h2 {
    margin: 8px 0 8px;
    color: var(--ink-deep);
    font: 800 clamp(28px, 3vw, 38px)/1.15 "Manrope", sans-serif;
    letter-spacing: -1.2px;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field > div {
    position: relative;
}

.login-field > div > svg {
    position: absolute;
    z-index: 1;
    left: 15px;
    top: 50%;
    width: 19px;
    stroke: var(--muted);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: translateY(-50%);
}

.login-field input {
    height: 52px;
    padding-left: 45px;
    padding-right: 58px;
    border-color: rgba(22, 60, 56, .14);
    background: rgba(255, 255, 255, .84);
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    padding: 6px;
    border: 0;
    cursor: pointer;
    color: var(--coral);
    background: transparent;
    font-size: 10px;
    font-weight: 800;
    transform: translateY(-50%);
}

.login-submit {
    min-height: 52px;
    margin-top: 5px;
}

.login-error {
    display: flex;
    margin-bottom: 20px;
    padding: 12px 14px;
    align-items: center;
    gap: 10px;
    border: 1px solid #efbeb7;
    border-radius: 11px;
    color: #89372f;
    background: #fff1ef;
    font-size: 12px;
    font-weight: 600;
}

.login-error span {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 7px;
    color: #fff;
    background: var(--danger);
    place-items: center;
}

.login-footnote {
    display: flex;
    margin: 27px 0 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.login-footnote span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #45a57a;
    box-shadow: 0 0 0 3px rgba(69, 165, 122, .13);
}

@media (max-width: 1120px) {
    .user-chip small,
    .topbar-actions .topbar-meta {
        display: none;
    }

    .user-chip {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 310px;
        padding: 28px;
    }

    .auth-copy {
        margin: 48px 0 32px;
    }

    .auth-copy h1 {
        font-size: 38px;
        letter-spacing: -1.4px;
    }

    .auth-copy p,
    .auth-visual-footer {
        display: none;
    }

    .auth-content {
        min-height: auto;
        padding: 45px 22px 65px;
    }
}

@media (max-width: 760px) {
    .topbar-actions {
        gap: 8px;
    }

    .user-chip > span:last-child {
        display: none;
    }

    .user-avatar,
    .logout-button {
        width: 35px;
        height: 35px;
    }
}
