:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #eef3f7;
    --panel: #ffffff;
    --panel-soft: #f8fbff;
    --line: #d7e2ee;
    --text: #162033;
    --muted: #64748b;
    --navy: #08213f;
    --blue: #0b5cad;
    --blue-strong: #073d7a;
    --cyan: #0f9f9a;
    --gold: #e9aa15;
    --green: #15803d;
    --amber: #b45309;
    --red: #b91c1c;
    --purple: #6d28d9;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(238, 243, 247, 0.72)),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 48%, #edf6f4 100%);
    color: var(--text);
}

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

button {
    line-height: 1.2;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 2rem;
    line-height: 1.1;
}

h2 {
    margin-bottom: 6px;
    font-size: 1.08rem;
}

h3 {
    margin-bottom: 10px;
    color: #40516a;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hidden {
    display: none !important;
}

.print-frame {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.compact-summary {
    margin-bottom: 18px;
}

.periodic-filters {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.kpi-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-soft);
}

.kpi-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.kpi-card strong {
    color: var(--blue);
    font-size: 1.8rem;
    line-height: 1;
}

.kpi-card.warning strong {
    color: var(--amber);
}

.kpi-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.kpi-track span {
    display: block;
    width: var(--value);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.reconciliation-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.reconciliation-card {
    align-items: flex-start;
}

.permission-matrix {
    overflow-x: auto;
}

.permission-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.permission-table th,
.permission-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.permission-table th:first-child,
.permission-table td:first-child {
    text-align: left;
}

.permission-table input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.reconciliation-approved {
    background: rgba(21, 128, 61, 0.1);
    color: var(--green);
}

.reconciliation-revision,
.reconciliation-pending {
    background: rgba(180, 83, 9, 0.1);
    color: var(--amber);
}

.reconciliation-rejected {
    background: rgba(185, 28, 28, 0.1);
    color: var(--red);
}

.reconciliation-not_required {
    background: rgba(100, 116, 139, 0.12);
    color: var(--muted);
}

.auth-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(7, 27, 61, 0.92), rgba(13, 71, 161, 0.86)),
        url("assets/flowchart-imifix.png");
    background-size: cover;
    background-position: center;
}

.auth-card {
    width: min(860px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.auth-brand,
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand {
    margin-bottom: 20px;
}

.auth-install-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    margin: -4px 0 16px;
    padding: 10px;
    background: #f8fbff;
}

.auth-install-actions span {
    color: var(--muted);
    font-size: 0.86rem;
}

.auth-install-actions .install-ready {
    border-color: rgba(21, 128, 61, 0.35);
    background: rgba(21, 128, 61, 0.08);
    color: var(--green);
}

.auth-brand strong,
.brand strong {
    display: block;
    font-size: 1.25rem;
}

.auth-brand span,
.brand span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-brand .version-badge,
.brand .version-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    border: 1px solid rgba(233, 170, 21, 0.42);
    border-radius: 999px;
    padding: 3px 9px;
    background: rgba(233, 170, 21, 0.12);
    color: #6f4a00;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
}

.imifix-logo,
.brand-mark {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: #ffffff;
}

.imifix-logo svg,
.brand-mark svg,
.imifix-logo img,
.brand-mark img {
    width: 44px;
    height: 44px;
}

.imifix-logo img,
.brand-mark img {
    display: block;
}

.setup-notice {
    display: grid;
    gap: 4px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #eff6ff;
}

.setup-notice span,
.auth-message,
.topbar-subtitle,
.panel-heading p,
.muted-line {
    color: var(--muted);
}

.auth-form,
.report-form,
.settings-form {
    display: grid;
    gap: 14px;
}

.auth-message {
    min-height: 20px;
    margin: 14px 0 0;
}

.public-intake {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.public-intake h2 {
    font-size: 0.95rem;
}

.status-check-form {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
}

.public-status-result {
    margin-top: 12px;
}

.qr-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 164px;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 14px;
    background: #f8fafc;
}

.qr-card h3 {
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 0.9rem;
    text-transform: none;
}

.qr-card p {
    margin-bottom: 12px;
    color: var(--muted);
}

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

.receipt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.qr-box {
    display: grid;
    min-height: 148px;
    place-items: center;
    border: 1px dashed #b6c5d8;
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
}

.install-qr-card {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.install-qr-card .qr-box {
    border-color: #93c5fd;
}

.qr-svg {
    width: 132px;
    height: 132px;
}

.qr-placeholder {
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(7, 27, 61, 0.12) 50%, transparent 0) 0 0 / 18px 18px,
        linear-gradient(rgba(13, 71, 161, 0.12) 50%, transparent 0) 0 0 / 18px 18px,
        #ffffff;
    color: var(--blue);
    font-weight: 900;
}

.settings-qr-card {
    margin-bottom: 4px;
}

.integration-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.panel-heading.compact {
    margin-bottom: 0;
}

.integration-card input[readonly] {
    color: var(--muted);
    background: #eef2f7;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    color: var(--text);
    font-weight: 600;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 18px;
    background:
        linear-gradient(180deg, rgba(8, 33, 63, 0.98), rgba(9, 45, 79, 0.98)),
        var(--navy);
    color: #f8fafc;
    box-shadow: 12px 0 34px rgba(8, 33, 63, 0.12);
}

.brand {
    margin-bottom: 26px;
}

.brand span {
    color: #b8c5d8;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    background: transparent;
    color: #dbe4f0;
    cursor: pointer;
    text-align: left;
    transition:
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    font-weight: 900;
}

.sidebar-panel {
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    padding-top: 18px;
}

.sidebar-panel h2 {
    color: #e7eef8;
    font-size: 0.94rem;
}

.user-panel {
    display: grid;
    gap: 8px;
}

.user-panel span,
.status-flow-list {
    color: #c9d6e6;
    font-size: 0.9rem;
}

.status-flow-list {
    display: grid;
    gap: 10px;
    margin: 10px 0 0;
}

.status-flow-step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.06);
}

.status-flow-step.active {
    border-color: rgba(233, 170, 21, 0.72);
    background: rgba(233, 170, 21, 0.14);
}

.status-flow-index {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 900;
}

.status-flow-step strong {
    display: block;
    color: #ffffff;
    font-size: 0.86rem;
}

.status-flow-step small {
    color: #c9d6e6;
    font-size: 0.74rem;
}

.status-flow-branches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.status-flow-branches span {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
    font-size: 0.68rem;
}

.detail-flow {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    color: var(--text);
}

.detail-flow .status-flow-step {
    border-color: var(--line);
    background: #f8fafc;
}

.detail-flow .status-flow-step.active {
    border-color: rgba(11, 92, 173, 0.45);
    background: #eef7ff;
}

.detail-flow .status-flow-index {
    background: var(--blue);
}

.detail-flow .status-flow-step strong {
    color: var(--text);
}

.detail-flow .status-flow-step small {
    color: var(--muted);
}

.detail-flow .status-flow-branches span {
    border-color: var(--line);
    background: #ffffff;
    color: var(--muted);
}

.main {
    min-width: 0;
    padding: 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
        transparent;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar-actions,
.list-actions,
.dialog-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.network-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 11px;
    background: #eef7ff;
    color: var(--blue);
    font-size: 0.84rem;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.network-pill.offline {
    border-color: #fecaca;
    background: #fff5f5;
    color: var(--red);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96)),
        var(--panel);
    box-shadow: var(--shadow);
}

.metric {
    position: relative;
    overflow: hidden;
    min-height: 108px;
    padding: 18px;
}

.metric::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blue), var(--cyan));
    content: "";
}

.metric span {
    color: var(--muted);
    font-size: 0.88rem;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.65rem;
    line-height: 1.12;
}

.metric small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.35;
}

.metric.warning strong {
    color: var(--red);
}

.metric.success strong {
    color: var(--green);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.workspace.two-columns {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

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

.panel-heading {
    margin-bottom: 16px;
}

.split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.chart-list,
.queue-list,
.account-list,
.detail-body,
.action-panel {
    display: grid;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(105px, 145px) minmax(70px, 1fr) 40px;
    gap: 10px;
    align-items: center;
}

.chart-label {
    color: #334155;
    font-weight: 800;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.bar-fill {
    width: var(--value);
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
}

.queue-item,
.account-item,
.detail-item,
.description-box,
.timeline,
.note-list,
.action-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel-soft);
}

.queue-item {
    display: grid;
    gap: 8px;
}

.queue-meta,
.actions,
.badge-row,
.attachment-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.14);
    background: #fbfdff;
}

.form-row,
.filters,
.settings-grid,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.filters {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 14px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.small-button {
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 9px 13px;
    cursor: pointer;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #ffffff;
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--blue-strong), #087f8c);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(11, 92, 173, 0.18);
}

.ghost-button {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
}

.ghost-button.install-ready {
    border-color: rgba(21, 128, 61, 0.35);
    background: rgba(21, 128, 61, 0.08);
    color: var(--green);
}

.ghost-button:hover,
.small-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.ghost-button.dark {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.danger-button {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff7f7, #fee2e2);
    color: var(--red);
}

.danger-button:hover {
    border-color: #fca5a5;
    transform: translateY(-1px);
}

.icon-button {
    width: 42px;
    padding: 0;
    border-color: var(--line);
    background: #f8fafc;
}

.small-button {
    min-height: 34px;
    border-color: #cbd5e1;
    background: #ffffff;
    color: #1f2937;
    padding: 7px 10px;
}

.small-button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.small-button.danger {
    border-color: #fecaca;
    color: var(--red);
}

.table-actions {
    display: grid;
    gap: 8px;
    min-width: 154px;
}

.quick-action,
.role-action-button {
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.quick-action {
    min-height: 34px;
    padding: 7px 10px;
    text-align: left;
}

.quick-action:hover,
.role-action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11);
}

.role-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.role-action-button {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 4px;
    min-height: 82px;
    padding: 13px 12px 11px;
    text-align: left;
}

.role-action-button::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: currentColor;
    content: "";
    opacity: 0.72;
}

.role-action-button span {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.role-action-button.active {
    outline: 3px solid rgba(11, 92, 173, 0.18);
}

.action-info {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eef7ff, #dff0ff);
    color: var(--blue);
}

.action-success {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #dcfce7);
    color: var(--green);
}

.action-warning {
    border-color: #fde68a;
    background: linear-gradient(180deg, #fff8e3, #fef3c7);
    color: var(--amber);
}

.action-danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff5f5, #fee2e2);
    color: var(--red);
}

.action-muted {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #ffffff, #eef2f7);
    color: #475569;
}

.form-mode,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.form-mode {
    background: #eff6ff;
    color: var(--blue);
}

.badge {
    background: #eef2ff;
    color: #3730a3;
}

.priority-rendah {
    background: #e0f2fe;
    color: #075985;
}

.priority-sedang {
    background: #fef3c7;
    color: var(--amber);
}

.priority-tinggi {
    background: #fee2e2;
    color: var(--red);
}

.status-diajukan,
.status-perlu-perbaikan-data {
    background: #f1f5f9;
    color: #475569;
}

.status-diteruskan-pic,
.status-diterima-admin,
.status-ditugaskan-ke-tim,
.status-ditugaskan-ke-vendor,
.status-dalam-proses-pengerjaan-tim-vendor,
.status-menunggu-verifikasi {
    background: #dbeafe;
    color: var(--blue);
}

.status-menunggu-persetujuan-keuangan,
.status-revisi-anggaran {
    background: #fef3c7;
    color: var(--amber);
}

.status-anggaran-disetujui {
    background: #dcfce7;
    color: var(--green);
}

.status-anggaran-ditolak {
    background: #fee2e2;
    color: var(--red);
}

.status-selesai {
    background: #dcfce7;
    color: var(--green);
}

.status-ditolak-pic,
.status-ditolak-admin {
    background: #fee2e2;
    color: var(--red);
}

.status-arsip {
    background: #e2e8f0;
    color: #475569;
}

.sla-ok {
    background: #eef2ff;
    color: #3730a3;
}

.sla-soon {
    background: #fef3c7;
    color: var(--amber);
}

.sla-late {
    background: #fee2e2;
    color: var(--red);
}

.sla-done {
    background: #dcfce7;
    color: var(--green);
}

.finance-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1.18fr);
    gap: 16px;
    margin-bottom: 18px;
}

.finance-gauge-panel,
.finance-chart-panel {
    display: grid;
    align-content: start;
    gap: 14px;
}

.finance-gauge {
    display: grid;
    width: min(250px, 100%);
    aspect-ratio: 1;
    place-items: center;
    justify-self: center;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    background:
        radial-gradient(circle closest-side, #ffffff 64%, transparent 65%),
        conic-gradient(var(--green) var(--value), #dbe7f1 0);
    box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.68), var(--shadow-soft);
}

.finance-gauge div {
    display: grid;
    place-items: center;
    gap: 2px;
    text-align: center;
}

.finance-gauge strong {
    color: var(--green);
    font-size: 2.25rem;
    line-height: 1;
}

.finance-gauge span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 900;
}

.finance-stat-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.finance-stat-strip span {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.finance-stat-strip strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
}

.finance-bar-stack {
    display: flex;
    min-height: 22px;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #edf3f8;
}

.finance-bar-stack span {
    width: var(--value);
    min-width: 3px;
}

.finance-stack-realized {
    background: var(--green);
}

.finance-stack-commitment {
    background: var(--gold);
}

.finance-stack-remaining {
    background: var(--cyan);
}

.finance-stack-over {
    background: var(--red);
}

.finance-breakdown-list {
    margin-top: 4px;
}

.finance-breakdown-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.6fr) minmax(96px, auto) 56px;
    gap: 10px;
    align-items: center;
}

.finance-breakdown-row strong {
    text-align: right;
}

.finance-breakdown-row em {
    justify-self: end;
    min-width: 46px;
    border-radius: 999px;
    padding: 4px 8px;
    background: #eef2f7;
    color: var(--text);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.finance-kind-realized .bar-fill,
.finance-kind-used .bar-fill {
    background: var(--green);
}

.finance-kind-commitment .bar-fill {
    background: var(--gold);
}

.finance-kind-remaining .bar-fill {
    background: var(--cyan);
}

.finance-kind-over .bar-fill {
    background: var(--red);
}

.finance-kind-total .bar-fill {
    background: var(--blue);
}

.finance-budget-list {
    gap: 12px;
}

.finance-budget-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.finance-budget-card > div:first-child strong,
.finance-budget-card > div:first-child span {
    display: block;
}

.finance-budget-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.finance-budget-card-metrics span {
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.finance-budget-card-metrics strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
}

.finance-budget-chart-list {
    gap: 10px;
}

.table-wrap {
    overflow-x: auto;
    position: relative;
}

table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.facility-cell strong,
.facility-cell span,
.muted-line,
.date-text {
    display: block;
}

.muted-line,
.date-text {
    font-size: 0.86rem;
}

.empty-state {
    display: none;
    padding: 42px 16px;
    text-align: center;
    color: var(--muted);
}

.empty-state strong,
.empty-state span {
    display: block;
}

.detail-dialog {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.25);
}

.detail-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.dialog-shell {
    display: grid;
    gap: 16px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

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

.detail-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.timeline,
.note-list {
    display: grid;
    gap: 10px;
}

.timeline-item,
.note-item {
    border-left: 3px solid var(--blue);
    padding-left: 12px;
}

.attachment-thumb {
    width: 120px;
    height: 88px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

details.description-box summary {
    cursor: pointer;
}

.inline-edit-form {
    margin-top: 12px;
}

.account-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.account-item strong,
.account-item span {
    display: block;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 10;
    min-width: 240px;
    max-width: 380px;
    transform: translateY(16px);
    border-radius: 8px;
    padding: 13px 15px;
    background: #111827;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: 180ms ease;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 1320px) {
    .summary-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

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

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

    .finance-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        position: static;
        height: auto;
    }

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

    .main {
        padding: 22px;
    }

    .topbar,
    .split,
    .dialog-header,
    .account-item {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-grid,
    .insight-grid,
    .finance-dashboard-grid,
    .form-row,
    .filters,
    .settings-grid,
    .qr-card,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions,
    .list-actions,
    .dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions button,
    .list-actions input,
    .list-actions button,
    .qr-actions button,
    .receipt-actions button {
        width: 100%;
    }

    .finance-breakdown-row {
        grid-template-columns: minmax(110px, 1fr) 58px;
    }

    .finance-breakdown-row .bar-track,
    .finance-breakdown-row strong {
        grid-column: 1 / -1;
    }

    .finance-breakdown-row strong {
        text-align: left;
    }

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

@media (max-width: 560px) {
    h1 {
        font-size: 1.55rem;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }
}
