* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --ink: #000;
    --ink-soft: #1a1a1a;
    --paper: #fff;
    --bg: #f4efe6;
    --muted: #6b6b6b;
    --accent: #6366f1;
    --accent-2: #4f46e5;
    --success: #22c55e;
    --info: #3b82f6;
    --warn: #facc15;
    --danger: #ef4444;
    --shadow: 4px 4px 0 var(--ink);
    --shadow-hover: 6px 6px 0 var(--ink);
}

html,
body {
    font-family: "JetBrains Mono", "Courier New", monospace;
    background: var(--bg);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none
}

h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em
}

h2 {
    font-size: 15px;
    font-weight: 700
}

.app {
    display: flex;
    min-height: 100vh
}

.main {
    flex: 1;
    padding: 28px 32px;
    margin-left: 280px;
    min-width: 0
}

/* ===== SIDEBAR ===== */
.sb {
    width: 264px;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow);
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px 12px;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 8px
}

.sb-logo {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow)
}

.sb-brand b {
    font-weight: 700;
    display: block;
    letter-spacing: .02em
}

.sb-brand small {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.nav:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow)
}

.nav.active {
    background: var(--ink-soft);
    color: #fff;
    box-shadow: var(--shadow)
}

.nav svg {
    flex-shrink: 0
}

.sb-user {
    margin-top: auto;
    border: 3px solid var(--ink);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--paper)
}

.av {
    width: 34px;
    height: 34px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700
}

.sb-user .nm {
    font-weight: 700;
    font-size: 12px
}

.sb-user .rl {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase
}

/* ===== PAGE HEADER ===== */
.ph {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px
}

.ph .sub {
    color: var(--muted);
    margin-top: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em
}

.ph-actions {
    display: flex;
    gap: 8px;
    align-items: center
}

/* ===== CARD ===== */
.card {
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.card-h {
    padding: 14px 18px;
    border-bottom: 3px solid var(--ink);
    background: var(--paper)
}

.card-h h2 {
    font-size: 14px;
    letter-spacing: .02em;
    text-transform: uppercase
}

.card-b {
    padding: 18px
}

.card-b.np {
    padding: 0
}

/* ===== GRID ===== */
.row {
    display: grid;
    gap: 16px
}

.r-stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 24px
}

.r-2-1 {
    grid-template-columns: 2fr 1fr
}

.r-1-1 {
    grid-template-columns: 1fr 1fr
}

@media(max-width:960px) {

    .r-2-1,
    .r-1-1 {
        grid-template-columns: 1fr
    }
}

/* ===== STAT TILE ===== */
.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px
}

.stat-ic {
    width: 48px;
    height: 48px;
    border: 3px solid var(--ink);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow)
}

.stat-ic.blue {
    background: var(--info)
}

.stat-ic.emerald {
    background: var(--success)
}

.stat-ic.violet {
    background: var(--accent)
}

.stat-ic.amber {
    background: var(--warn);
    color: #000
}

.stat-l {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700
}

.stat-v {
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
    word-break: break-all
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--ink);
    font-size: 12px;
    vertical-align: top
}

th {
    font-weight: 700;
    color: var(--ink);
    background: var(--bg);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 3px solid var(--ink)
}

tr:last-child td {
    border-bottom: none
}

.tr {
    text-align: right
}

.tc {
    text-align: center
}

.tm {
    color: var(--muted)
}

.tx {
    font-size: 11px
}

/* ===== BADGE ===== */
.bd {
    display: inline-block;
    padding: 3px 9px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--paper);
    color: var(--ink);
}

.bd.outline {
    background: var(--paper)
}

.bd.secondary {
    background: var(--bg)
}

.bd.success {
    background: var(--success);
    color: #000
}

.bd.info {
    background: var(--info);
    color: #fff
}

.bd.warn {
    background: var(--warn);
    color: #000
}

.bd.danger {
    background: var(--danger);
    color: #fff
}

/* ===== BUTTON ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background: var(--paper);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover)
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: none
}

.btn-p {
    background: var(--accent);
    color: #fff
}

.btn-d {
    background: var(--danger);
    color: #fff
}

/* ===== FORM ===== */
.f {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px
}

.f label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap
}

label .bd {
    margin-left: auto;
    font-weight: 700;
    font-size: 9px;
    padding: 1px 6px;
    text-transform: none
}

.f-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

input,
select,
textarea {
    padding: 10px 12px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: var(--paper);
    width: 100%;
    transition: box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 4px 4px 0 var(--accent);
}

/* ===== HEALTH / SUMMARY ===== */
.health {
    border: 3px solid var(--ink);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--paper);
    box-shadow: var(--shadow)
}

.health-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700
}

.health-g {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.health-c {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 11px
}

.sum {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.sum-t {
    border: 3px solid var(--ink);
    border-radius: 10px;
    padding: 14px;
    background: var(--paper);
    box-shadow: var(--shadow)
}

.sum-t .l {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700
}

.sum-t .v {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.toolbar select {
    width: auto;
    min-width: 220px
}

/* ===== LOGIN ===== */
.lg-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
    padding: 20px
}

.lg-card {
    width: 100%;
    max-width: 420px;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 8px 8px 0 var(--ink)
}

.lg-ic {
    width: 60px;
    height: 60px;
    border: 3px solid var(--ink);
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    box-shadow: var(--shadow)
}

.lg-card h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 4px
}

.lg-card .lg-sub {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em
}

.alert {
    padding: 10px 12px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background: #fee2e2;
    font-size: 12px;
    margin-bottom: 14px;
    font-weight: 600
}

/* ===== ENTRY ANIMATIONS ===== */
@keyframes pop {
    from {
        opacity: 0;
        transform: translate(-4px, -4px)
    }

    to {
        opacity: 1;
        transform: translate(0, 0)
    }
}

.card,
.health,
.sum-t,
.sb {
    animation: pop .25s ease-out both
}

/* ===== PRINT ===== */
@media print {

    .sb,
    .no-print {
        display: none !important
    }

    .main {
        margin-left: 0;
        padding: 0
    }

    .card {
        box-shadow: none
    }

    * {
        animation: none !important;
        transition: none !important
    }
}

/* ===== REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}
