:root {
    --bg: #f4f7f9;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #687789;
    --line: #dde6ed;
    --brand: #1f6f8b;
    --brand-dark: #164d63;
    --accent: #c1743b;
    --ok: #1f7a4d;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--bg);
}

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

button,
input {
    font: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    padding: 22px 16px;
    overflow-y: auto;
    color: #eaf4f7;
    background: #17394a;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 20px;
}

.brand-mark,
.profile-chip span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    font-weight: 800;
    background: var(--accent);
    border-radius: 8px;
}

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

.brand small {
    color: #afc6d1;
    font-size: 12px;
}

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

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
    color: #d6e7ee;
    border-radius: 7px;
}

.nav a span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #17394a;
    font-size: 11px;
    font-weight: 800;
    background: #d7e8ef;
    border-radius: 6px;
}

.nav a:hover,
.nav a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.app-shell {
    min-height: 100vh;
    margin-left: 264px;
    padding: 26px;
}

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

.topbar h1,
.module-hero h2,
.hero-band h2 {
    margin: 0;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.icon-button {
    width: 40px;
    height: 40px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 5px 12px 5px 5px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-chip span {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

.hero-band,
.module-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    margin-bottom: 18px;
    color: #fff;
    background: linear-gradient(135deg, #1f6f8b, #19485d);
    border-radius: 8px;
}

.hero-band h2 {
    max-width: 760px;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.08;
}

.module-hero {
    align-items: flex-start;
}

.module-hero p {
    max-width: 720px;
    margin-bottom: 0;
    color: #d7e8ef;
}

.hero-band .eyebrow,
.module-hero .eyebrow {
    color: #b9d8e2;
}

.primary-action,
.secondary-action,
.inline-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
    background: var(--accent);
    border: 0;
    border-radius: 7px;
}

.secondary-action {
    color: var(--brand-dark);
    background: #e9f3f6;
}

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

.stat-card,
.mini-stat-grid article,
.panel,
.module-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 18px;
}

.stat-card span,
.mini-stat-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card strong,
.mini-stat-grid strong {
    display: block;
    margin: 8px 0 2px;
    font-size: 30px;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr;
    gap: 16px;
    margin-bottom: 18px;
}

.panel {
    padding: 18px;
}

.panel-wide {
    grid-row: span 2;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-header h3 {
    margin: 0;
}

.panel-header a {
    color: var(--brand);
    font-weight: 800;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

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

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    color: var(--ok);
    font-size: 12px;
    font-weight: 800;
    background: #e7f6ee;
    border-radius: 99px;
}

.progress {
    height: 10px;
    overflow: hidden;
    background: #e5edf2;
    border-radius: 99px;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--brand);
}

.split-list,
.money-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.split-list span,
.money-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.split-list strong,
.money-list strong {
    color: var(--ink);
}

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

.module-card {
    display: grid;
    gap: 10px;
    min-height: 172px;
    padding: 18px;
}

.module-card > span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    background: var(--brand);
    border-radius: 8px;
}

.module-card strong {
    font-size: 18px;
}

.module-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.mini-stat-grid article {
    padding: 16px;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.inline-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.inline-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    color: var(--ink);
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.empty-state {
    display: grid;
    gap: 10px;
    place-items: start;
}

.empty-state p {
    max-width: 560px;
    color: var(--muted);
}

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

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

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

@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: auto;
        max-height: 320px;
    }

    .app-shell {
        margin-left: 0;
        padding: 16px;
    }

    .topbar,
    .hero-band,
    .module-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .stat-grid,
    .mini-stat-grid,
    .module-grid,
    .inline-form {
        grid-template-columns: 1fr;
    }
}
