/* SmsBlast — operations-console look: deep indigo rail, paper content,
   violet action color, monospace for anything numeric (units, phone numbers, timestamps). */

:root {
    --ink: #1c1b22;
    --paper: #f6f6f8;
    --card: #ffffff;
    --rail: #17122e;
    --rail-text: #b8b2d4;
    --accent: #5b3df5;
    --accent-soft: #ece8ff;
    --ok: #157f3d;
    --ok-soft: #e2f5e9;
    --warn: #9a6700;
    --warn-soft: #fff3d6;
    --fail: #b3261e;
    --fail-soft: #fde8e7;
    --info: #0b5cab;
    --info-soft: #e3eefc;
    --muted: #6b6a76;
    --line: #e4e3ea;
    --radius: 10px;
    --font-display: "Sora", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
}

h1, h2, h3, .brand { font-family: var(--font-display); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 0.6rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.small { font-size: 0.82rem; }
.muted { color: var(--muted); }
.pos { color: var(--ok); }
.neg { color: var(--fail); }

/* ---- Shell ---- */
.shell { display: flex; min-height: 100vh; }
.content { flex: 1; padding: 1.6rem 2rem 3rem; max-width: 1200px; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--rail);
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.9rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem 1rem;
}

.brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 61, 245, 0.35);
}

.nav-section {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7d76a3;
    margin: 1.1rem 0.5rem 0.3rem;
}

.nav-link {
    display: block;
    color: var(--rail-text);
    padding: 0.42rem 0.6rem;
    border-radius: 7px;
    font-size: 0.9rem;
}

.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--accent); color: #fff; }

.sidebar-footer { margin-top: auto; padding: 0.6rem 0.5rem 0; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { font-size: 0.78rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 0.4rem; }

/* ---- Auth ---- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-brand {
    flex: 1;
    background: var(--rail);
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}
.auth-mark { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: #fff; }
.auth-panel { width: min(440px, 100%); background: var(--card); padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-alt { margin-top: 1.2rem; font-size: 0.88rem; }

@media (max-width: 760px) {
    .auth-brand { display: none; }
    .auth-panel { width: 100%; }
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content { padding: 1rem; }
}

/* ---- Forms ---- */
label { display: block; font-size: 0.85rem; font-weight: 500; margin: 0.7rem 0; }
input, textarea, select {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.7rem;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
input:focus, textarea:focus, select:focus, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
textarea { resize: vertical; }
.input-sm { width: 90px; display: inline-block; padding: 0.3rem 0.5rem; }

.choice-set { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.9rem 0.9rem; margin: 0.8rem 0; }
.choice-set legend { font-size: 0.8rem; font-weight: 600; padding: 0 0.3rem; }
.choice { display: flex; align-items: flex-start; gap: 0.55rem; font-weight: 400; margin: 0.45rem 0; }
.choice input { width: auto; margin-top: 0.2rem; }
.choice-lg span { display: flex; flex-direction: column; gap: 0.15rem; }

.row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 160px; }
.row-inline { display: flex; gap: 0.4rem; align-items: center; }
.filter-row { margin-top: 1rem; align-items: center; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4a2fe0; text-decoration: none; }
.btn-primary:disabled { background: #b9aef7; cursor: not-allowed; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.78rem; }
.btn-block { width: 100%; margin-top: 0.8rem; }
.danger { color: var(--fail); }
.link-btn { background: none; border: none; font: inherit; color: var(--ink); cursor: pointer; padding: 0.1rem 0; }
.link-btn.active { color: var(--accent); font-weight: 600; }

/* ---- Cards / stats ---- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    margin: 0.9rem 0;
}

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.stat-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 600; }
.stat-value-sm { font-size: 1.05rem; font-weight: 600; }

.compose-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 980px) { .compose-grid { grid-template-columns: 1fr; } }

.estimate { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin: 0.8rem 0; font-size: 0.9rem; }
.estimate div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 0.25rem; }

.message-body { white-space: pre-wrap; background: var(--paper); border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.92rem; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th {
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: #fbfbfd;
}
.table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

/* ---- Badges / alerts / progress ---- */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail { background: var(--fail-soft); color: var(--fail); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-processing { background: var(--accent-soft); color: var(--accent); }
.badge-scheduled { background: #eef0f4; color: #4a5568; }
.badge-muted { background: #eef0f4; color: var(--muted); }

.alert { border-radius: 8px; padding: 0.65rem 0.9rem; font-size: 0.88rem; margin: 0.7rem 0; }
.alert-error { background: var(--fail-soft); color: var(--fail); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.progress { height: 8px; background: #edecf4; border-radius: 99px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.6s ease; }
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }

.job-live-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.4rem; text-align: center; margin: 1rem 0; }
.plain-list { list-style: none; padding: 0; margin: 0.4rem 0; }
.plain-list li { padding: 0.2rem 0; }
.gateway-card .choice-lg { padding: 0.5rem; border-radius: 8px; }
.gateway-card .choice-lg:hover { background: var(--accent-soft); }
