/* Helm - design tokens */
:root {
    --helm-ink: #1d2422;
    --helm-muted: #5c6662;
    --helm-paper: #f4f5f2;
    --helm-card: #ffffff;
    --helm-sidebar: #182b26;
    --helm-sidebar-ink: #c8d4cf;
    --helm-accent: #17685c;
    --helm-accent-dark: #114e45;
    --helm-amber: #a97614;
    --helm-red: #a8433a;
    --helm-line: #dfe3dd;
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    background: var(--helm-paper);
    color: var(--helm-ink);
}

.font-mono, .mono {
    font-family: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
}

/* ---- Shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--helm-sidebar);
    color: var(--helm-sidebar-ink);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-brand {
    padding: 1.4rem 1.5rem 1.1rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-brand .mark {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: .08em;
}
.app-brand .sub {
    display: block;
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    margin-top: .15rem;
}

.app-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.app-nav a {
    display: block;
    padding: .5rem 1.5rem;
    color: var(--helm-sidebar-ink);
    text-decoration: none;
    font-size: .92rem;
    border-left: 3px solid transparent;
}
.app-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-nav a.active {
    color: #fff;
    border-left-color: var(--helm-accent);
    background: rgba(255,255,255,.07);
}
.app-nav .nav-section {
    padding: 1.1rem 1.5rem .35rem;
    font-size: .64rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    font-family: 'IBM Plex Mono', monospace;
}

.app-sidebar .sidebar-foot {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .85rem;
}
.app-sidebar .sidebar-foot a { color: rgba(255,255,255,.55); text-decoration: none; }
.app-sidebar .sidebar-foot a:hover { color: #fff; }

.app-main { flex: 1; min-width: 0; padding: 2rem 2.4rem 4rem; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; height: auto; position: static; }
    .app-nav { display: flex; flex-wrap: wrap; padding: .4rem .6rem; }
    .app-nav a { border-left: none; border-bottom: 3px solid transparent; padding: .45rem .8rem; }
    .app-nav a.active { border-bottom-color: var(--helm-accent); }
    .app-nav .nav-section { display: none; }
    .app-main { padding: 1.25rem 1rem 3rem; }
}

/* ---- Page header ---- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}
.page-head h1 {
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
}
.page-head .eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--helm-muted);
    display: block;
    margin-bottom: .3rem;
}

/* ---- Cards & tables ---- */
.card { border: 1px solid var(--helm-line); border-radius: .5rem; background: var(--helm-card); }
.card-header { background: transparent; border-bottom: 1px solid var(--helm-line); font-weight: 600; font-size: .95rem; }
.table { --bs-table-hover-bg: #f7f8f5; }
.table th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--helm-muted);
    font-weight: 500;
    border-bottom-width: 2px;
}
.table td { vertical-align: middle; }

/* ---- Bootstrap re-tints ---- */
a { color: var(--helm-accent); }
a:hover { color: var(--helm-accent-dark); }

.btn-primary {
    --bs-btn-bg: var(--helm-accent);
    --bs-btn-border-color: var(--helm-accent);
    --bs-btn-hover-bg: var(--helm-accent-dark);
    --bs-btn-hover-border-color: var(--helm-accent-dark);
    --bs-btn-active-bg: var(--helm-accent-dark);
    --bs-btn-active-border-color: var(--helm-accent-dark);
}
.btn-outline-primary {
    --bs-btn-color: var(--helm-accent);
    --bs-btn-border-color: var(--helm-accent);
    --bs-btn-hover-bg: var(--helm-accent);
    --bs-btn-hover-border-color: var(--helm-accent);
    --bs-btn-active-bg: var(--helm-accent-dark);
    --bs-btn-active-border-color: var(--helm-accent-dark);
}
.text-bg-primary { background-color: var(--helm-accent) !important; }
.badge-waiting { background-color: var(--helm-amber); color: #fff; }
.form-control:focus, .form-select:focus {
    border-color: var(--helm-accent);
    box-shadow: 0 0 0 .2rem rgba(23, 104, 92, .15);
}

/* ---- Stat tiles ---- */
.stat-tile { border: 1px solid var(--helm-line); border-radius: .5rem; background: var(--helm-card); padding: 1rem 1.2rem; height: 100%; }
.stat-tile .num { font-family: 'IBM Plex Mono', monospace; font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.stat-tile .lbl { font-size: .78rem; color: var(--helm-muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-tile.warn .num { color: var(--helm-red); }
.stat-tile.amber .num { color: var(--helm-amber); }
.stat-tile.ok .num { color: var(--helm-accent); }

/* ---- Date chip ---- */
.date-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .74rem;
    color: var(--helm-muted);
    white-space: nowrap;
}

/* ---- Ledger (achievements / review) ---- */
.ledger-quarter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--helm-accent);
    border-bottom: 2px solid var(--helm-accent);
    padding-bottom: .35rem;
    margin: 2rem 0 .8rem;
}
.ledger-row { border-bottom: 1px solid var(--helm-line); padding: .85rem .25rem; }
.ledger-row:last-child { border-bottom: none; }
.ledger-row .impact { color: var(--helm-ink); font-size: .92rem; }
.ledger-row .metric {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .8rem;
    color: var(--helm-accent-dark);
    background: rgba(23,104,92,.08);
    padding: .1rem .45rem;
    border-radius: .25rem;
}

/* ---- Idea board ---- */
.idea-col { background: #edefe9; border-radius: .5rem; padding: .8rem; min-height: 10rem; }
.idea-col h6 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--helm-muted);
}
.idea-card { background: #fff; border: 1px solid var(--helm-line); border-radius: .4rem; padding: .65rem .75rem; margin-bottom: .6rem; }
.idea-card .ie {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .7rem;
    color: var(--helm-muted);
}

/* ---- Agenda ---- */
.agenda-item { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--helm-line); }
.agenda-item:last-child { border-bottom: none; }
.agenda-item.done .agenda-text { text-decoration: line-through; color: var(--helm-muted); }
.agenda-item form { margin: 0; }

.notes-area { font-size: .95rem; min-height: 16rem; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--helm-sidebar); }
.login-card { width: 100%; max-width: 380px; }

/* ---- Print (review export) ---- */
@media print {
    .app-sidebar, .page-actions, .no-print { display: none !important; }
    .app-main { padding: 0; }
    body { background: #fff; }
    .card { border: none; }
    a { color: inherit; text-decoration: none; }
}
