:root {
    --navy: #0b2545;
    --navy-2: #13315c;
    --teal: #0e9aa7;
    --teal-dark: #0b7c86;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1b2433;
    --muted: #64748b;
    --border: #e2e8f0;
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --warn: #a16207;
    --warn-bg: #fef9c3;
    --bad: #b91c1c;
    --bad-bg: #fee2e2;
    --info-bg: #e0f2fe;
    --info: #0369a1;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--teal-dark); }
h1 { font-size: 22px; margin: 0 0 4px; }
h1:focus { outline: none; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; flex-shrink: 0; background: var(--navy); color: #cbd5e1;
    padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 18px; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 8px; background: var(--teal); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: #94a3b8; font-size: 12px; }
.nav-group { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #7c8ba1; padding: 16px 10px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 7px;
    color: #cbd5e1; text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--teal); color: #fff; }
.soon { margin-left: auto; font-size: 10px; background: #334155; color: #cbd5e1; padding: 1px 6px; border-radius: 99px; }
.content { flex: 1; padding: 28px 32px; min-width: 0; max-width: 1200px; }

@media (max-width: 800px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content { padding: 20px 16px; }
}

/* ── Building blocks ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 18px; }
.grid .card { margin-bottom: 0; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 14px; }

.btn {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff;
    color: var(--text); padding: 7px 13px; border-radius: 7px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f1f5f9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.grey { background: #e2e8f0; color: #475569; }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
label.field > small { display: block; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=time], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* Interview detail */
.qa { border-top: 1px solid var(--border); padding: 12px 0; }
.qa:first-of-type { border-top: none; }
.qa .q { font-weight: 600; margin-bottom: 4px; }
.qa .a { white-space: pre-wrap; }
.media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.media img { height: 110px; border-radius: 6px; border: 1px solid var(--border); object-fit: cover; }
.media .file { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; }
.progress { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; width: 120px; }
.progress > div { height: 100%; background: var(--teal); }

.module-tile { display: block; text-decoration: none; color: inherit; }
.module-tile:hover { border-color: var(--teal); }
.module-tile .icon { font-size: 26px; }
.module-tile h2 { margin: 8px 0 4px; }

/* Blazor */
#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none;
    left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--bad-bg); color: var(--bad); padding: 1rem; border-radius: 8px; }
.blazor-error-boundary::after { content: "An error has occurred." }

/* Content ideas */
.idea-grid { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.idea-grid .label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.followup { color: var(--teal-dark); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Operations: Telegram message preview */
.tg-preview {
    white-space: pre-wrap; word-break: break-word; background: #eef6ff; border: 1px solid #d6e6f7;
    border-radius: 12px 12px 12px 4px; padding: 10px 12px; min-height: 60px; line-height: 1.45;
}
.tg-preview code { background: #dbe8f5; }

/* Dropdown with a "+ New" button and its inline quick-add form */
.field-label { display: block; font-weight: 600; margin-bottom: 5px; }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn select { flex: 1; min-width: 0; }
.quick-add { margin-top: 8px; padding: 10px; border: 1px dashed var(--teal); border-radius: 8px; background: #f0fbfc; display: grid; gap: 6px; }

/* Signed-in user at the bottom of the sidebar */
.signed-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.signed-in .small { opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
