:root {
    --ink: #18212f;
    --muted: #697386;
    --line: #e4e8ef;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --navy: #14233b;
    --teal: #1e7d73;
    --gold: #b88935;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #f4f6f9;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 0.82fr) 1.18fr;
    background: #eef2f6;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--surface);
}

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

.login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: 100vh;
    padding: 56px;
    color: #fff;
    background:
        linear-gradient(130deg, rgba(20, 35, 59, 0.94), rgba(30, 125, 115, 0.88)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' viewBox='0 0 1200 900'%3E%3Crect width='1200' height='900' fill='%2314233b'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1'%3E%3Cpath d='M120 180h960M120 300h960M120 420h960M120 540h960M120 660h960M240 120v660M420 120v660M600 120v660M780 120v660M960 120v660'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.11'%3E%3Crect x='210' y='190' width='210' height='120' rx='10'/%3E%3Crect x='470' y='250' width='300' height='170' rx='10'/%3E%3Crect x='820' y='360' width='190' height='240' rx='10'/%3E%3Crect x='245' y='500' width='430' height='120' rx='10'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    background: var(--navy);
    font-weight: 800;
    letter-spacing: 0;
}

.eyebrow {
    color: var(--teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.field {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.field:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(30, 125, 115, 0.14);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    color: #fff;
    background: var(--navy);
}

.btn-secondary {
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 24px;
    color: #dbe4ef;
    background: #111b2d;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 8px;
    padding: 0 12px;
    color: #dbe4ef;
    font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.main {
    min-width: 0;
    padding: 28px;
}

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

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.card-pad {
    padding: 18px;
}

.metric-value {
    margin-top: 10px;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
}

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

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

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

.table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
}

.badge-green {
    color: #0b5f56;
    background: #dff5ef;
}

.badge-blue {
    color: #1f4e79;
    background: #e3eef9;
}

.badge-gold {
    color: #75510d;
    background: #fff2d7;
}

.progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9edf3;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--teal);
}

.invoice-paper {
    max-width: 920px;
    margin: 0 auto;
    padding: 44px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

    .login-visual,
    .sidebar {
        display: none;
    }

    .main {
        padding: 18px;
    }

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

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