:root {
    --accent: #c8102e;
    --ink: #111111;
    --muted: #8a8a8a;
    --line: #ececec;
    --bg: #fafafa;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'Space Mono', monospace; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }

input, button, select, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
::placeholder { color: #b3b3b3; }
button { cursor: pointer; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 380px; }
.brand { font-family: 'Space Mono', monospace; font-size: 21px; font-weight: 700; letter-spacing: .02em; }
.brand span { color: #b3b3b3; }
.brand-sub { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #9a9a9a; margin-top: 5px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.tabs { display: flex; gap: 3px; background: #f4f4f4; border-radius: 4px; padding: 3px; margin-bottom: 22px; }
.tab { flex: 1; padding: 8px 10px; border: none; border-radius: 3px; font-size: 13px; font-weight: 600; background: transparent; color: #9a9a9a; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.07); }
.field { display: block; font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #8a8a8a; }
.input { margin-top: 7px; width: 100%; padding: 11px 12px; border: 1px solid #e2e2e2; border-radius: 4px; font-size: 14px; background: #fff; color: var(--ink); outline: none; }
.btn-primary { padding: 10px 16px; background: var(--accent); color: #fff; border: none; border-radius: 4px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn-wide { width: 100%; padding: 12px 16px; margin-top: 4px; }
.btn-ghost { padding: 10px 16px; background: #fff; border: 1px solid #e2e2e2; border-radius: 4px; font-size: 14px; font-weight: 600; color: #444; }
.alert-err { font-size: 13px; color: #b3261e; background: #fdf0ef; border: 1px solid #f5d6d2; padding: 9px 11px; border-radius: 4px; }
.alert-ok { font-size: 13px; color: #0f7b46; background: #eef7f1; border: 1px solid #cfe8d8; padding: 9px 11px; border-radius: 4px; }
.hint { font-size: 12px; color: #9a9a9a; line-height: 1.5; }
.cred { margin-top: 16px; font-size: 12.5px; color: #9a9a9a; text-align: center; line-height: 1.7; }
.cred .mono { color: #6f6f6f; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.nav { display: flex; flex-direction: column; }
.nav-item { display: flex; align-items: center; width: 100%; padding: 10px 14px; margin-bottom: 2px; border-radius: 4px; font-size: 14px; text-align: left; background: transparent; border: none; border-left: 2px solid transparent; color: #6f6f6f; font-weight: 500; }
.nav-item.active { background: #f4f4f4; color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: 'Space Mono', monospace; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: #f0f0f0; color: #555; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-family: 'Space Mono', monospace; }
.usercard { margin-top: auto; display: flex; align-items: center; gap: 11px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 32px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { margin-top: 4px; font-size: 13px; color: #8a8a8a; }
.content { flex: 1; padding: 28px 32px; }
.select, .search { padding: 9px 12px; border: 1px solid #e2e2e2; border-radius: 4px; font-size: 13px; background: #fff; color: var(--ink); outline: none; }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.stat { padding: 18px 20px; }
.stat .label { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #9a9a9a; }
.stat .num { font-family: 'Space Mono', monospace; font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin-top: 8px; }
.bar-track { height: 10px; background: #f0f0f0; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; margin-top: 20px; }
.chart .chart-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.chart .bar { width: 100%; border-radius: 2px 2px 0 0; background: #c9c9c9; }
.dash-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f3f3f3; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 880px; font-variant-numeric: tabular-nums; }
thead th { padding: 13px 14px; font-weight: 400; border-bottom: 1px solid var(--line); text-align: left; color: #9a9a9a; font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
tbody td { padding: 13px 14px; border-bottom: 1px solid #f4f4f4; }
.chip { display: inline-block; padding: 3px 9px; border: 1px solid #e2e2e2; border-radius: 20px; font-size: 11.5px; color: #555; white-space: nowrap; }
.tbtn { background: none; border: 1px solid #e2e2e2; border-radius: 4px; padding: 5px 9px; font-size: 12px; color: #444; }
.tbtn.danger { color: #b3261e; }

/* ---------- Funil ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px; min-height: 220px; }
.col.over { background: #f3f3f3; border: 1px dashed #b8b8b8; }
.col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.col-count { font-family: 'Space Mono', monospace; font-size: 12px; color: #9a9a9a; background: #f4f4f4; border-radius: 20px; padding: 2px 9px; }
.kcard { background: #fff; border: 1px solid #e8e8e8; border-radius: 5px; padding: 13px 14px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.03); margin-bottom: 10px; }
.move { width: 24px; height: 24px; border: 1px solid #e2e2e2; background: #fff; border-radius: 4px; font-size: 14px; color: #444; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.move:disabled { opacity: .3; cursor: default; }
.empty-col { border: 1px dashed #e2e2e2; border-radius: 5px; padding: 18px; text-align: center; color: #b3b3b3; font-size: 12.5px; }

/* ---------- Approvals ---------- */
.req { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17,17,17,.32); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.col-span { grid-column: 1 / -1; }
.empty-box { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 44px 20px; text-align: center; color: #9a9a9a; font-size: 14px; }

@media (max-width: 720px) {
    .sidebar { display: none; }
    .dash-2 { grid-template-columns: 1fr; }
}
