/* ==========================================================================
   Index Panel — stylesheet
   One dark UI for every page. No external fonts, no CDN.
   ========================================================================== */

:root {
    --bg: #0e1016;
    --bg-2: #141822;
    --panel: #171b25;
    --panel-2: #1d222e;
    --line: #262c39;
    --line-2: #303747;
    --text: #e7eaf2;
    --muted: #939bb0;
    --dim: #6b7385;
    --brand: #4f8cff;
    --brand-2: #2f6fe4;
    --ok: #35c37d;
    --warn: #e0a83c;
    --bad: #ef5a5a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Bengali", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .code, .mini {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code, .code {
    background: #0b0d13;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 12px;
    color: #cfd6e6;
}

code.mini, .mini {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 11.5px;
    color: var(--muted);
}

pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- layout */

.shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.side {
    width: 244px;
    flex: 0 0 244px;
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 4px 6px 18px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--brand), #7a4dff);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .5px;
}

.brand strong { display: block; font-size: 14px; }
.brand small { display: block; color: var(--dim); font-size: 11.5px; }

.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}
.nav:hover { background: #1c2130; color: var(--text); text-decoration: none; }
.nav.active { background: #1f2a44; color: #fff; }
.nav svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

.mini-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
}
.mini-card span { display: block; color: var(--muted); font-size: 11.5px; }
.mini-card strong { display: block; font-size: 19px; line-height: 1.2; }
.mini-card small { color: var(--dim); font-size: 11px; }

.who { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }

.main {
    flex: 1;
    min-width: 0;
    padding: 22px 26px 60px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.2px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.topbadges { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.badge.ok { color: var(--ok); border-color: #23543c; background: #12251c; }
.badge.bad { color: var(--bad); border-color: #5a2727; background: #261414; }

/* ---------------------------------------------------------------- alerts */

.alert {
    background: #16202f;
    border: 1px solid #26405e;
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #cfdcf0;
}
.alert strong { color: #fff; }
.alert.ok { background: #12251c; border-color: #23543c; border-left-color: var(--ok); color: #cfeedf; }
.alert.warn { background: #262012; border-color: #5c4a1f; border-left-color: var(--warn); color: #f0e0bd; }
.alert.bad { background: #261414; border-color: #5a2727; border-left-color: var(--bad); color: #f3cccc; }

.ajax-result { margin-top: 10px; }
.ajax-result p { margin: 6px 0; font-size: 13px; }
.ajax-result .line-ok { color: var(--ok); }
.ajax-result .line-bad { color: var(--bad); }
.ajax-result .line-warn { color: var(--warn); }

/* ----------------------------------------------------------------- cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 15px;
}
.card-label { display: block; color: var(--muted); font-size: 12px; }
.card-value { display: block; font-size: 22px; line-height: 1.25; margin-top: 3px; }
.card-sub { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.card.tone-ok { border-color: #23543c; }
.card.tone-ok .card-value { color: var(--ok); }
.card.tone-warn { border-color: #5c4a1f; }
.card.tone-warn .card-value { color: var(--warn); }
.card.tone-bad { border-color: #5a2727; }
.card.tone-bad .card-value { color: var(--bad); }

/* ---------------------------------------------------------------- panels */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack .panel { margin-bottom: 0; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head.spaced { margin-top: 18px; }
.panel-head .hint { text-align: right; }

.hint { color: var(--muted); font-size: 12px; }
.hint code { font-size: 11.5px; }
.good { color: var(--ok); }
.bad { color: var(--bad); }

/* ---------------------------------------------------------------- tables */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 500;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid var(--line);
    padding: 7px 9px;
    white-space: nowrap;
}
.table td {
    border-bottom: 1px solid #20252f;
    padding: 7px 9px;
    vertical-align: top;
}
.table tbody tr:hover { background: #1a1f2a; }
.table.compact td, .table.compact th { padding: 5px 7px; }
.table .num { text-align: right; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table .trunc {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table input[type="text"] { min-width: 90px; }
.row-bad { background: #201416; }

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: #23543c; background: #12251c; }
.pill.warn { color: var(--warn); border-color: #5c4a1f; background: #262012; }
.pill.bad { color: var(--bad); border-color: #5a2727; background: #261414; }

.bar-cell { width: 120px; }
.bar { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand), #7a4dff); }

.pager { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pager a {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--muted);
}
.pager a.active { background: #1f2a44; color: #fff; border-color: #2f4a7a; }

/* ----------------------------------------------------------------- forms */

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
    width: 100%;
    background: #0f121a;
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font: inherit;
    font-size: 13px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, .16);
}
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: none; }
input[readonly], textarea[readonly] { color: #c7cfdf; }

label.field { display: block; }
label.field > span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}
label.field > span em { color: var(--dim); font-style: normal; }
label.field.small { max-width: 150px; }
label.field.grow { flex: 1; min-width: 180px; }

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
}

.check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-size: 13px;
    color: #cdd4e2;
    margin: 8px 0;
}
.check input[type="checkbox"] { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--brand); }
.check.inline-check { margin: 0; white-space: nowrap; }
.check span code { font-size: 11px; }

form.inline { display: inline-block; }

.row-line {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0 4px;
    flex-wrap: wrap;
}
.counter { color: var(--muted); font-size: 12px; margin-left: auto; }

.file-btn {
    display: inline-block;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
}
.file-btn:hover { border-color: var(--brand); color: var(--text); }

.filterbar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.verifybar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick input[type="text"] { flex: 1; min-width: 220px; }
.quick select { max-width: 210px; }

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    background: #232a39;
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { background: #2a3243; text-decoration: none; }
.btn.primary {
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    border-color: #3d76d8;
    color: #fff;
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #1c2130; color: var(--text); }
.btn.danger { color: #f7c4c4; border-color: #5a2727; }
.btn.danger:hover { background: #2a1616; }
.btn.big { padding: 11px 22px; font-size: 14px; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn[disabled], .btn.loading { opacity: .55; cursor: progress; }

.mini-btn {
    background: #232a39;
    border: 1px solid var(--line-2);
    color: var(--muted);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 11.5px;
    cursor: pointer;
    font: inherit;
    font-size: 11.5px;
}
.mini-btn:hover { color: var(--text); }

.actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

.engines { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.engines .check { margin: 0; }

/* ------------------------------------------------------------- progress */

.progress { margin-top: 14px; }
.progress-bar { height: 7px; background: #10141c; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand), #7a4dff);
    transition: width .25s ease;
}
.progress-text { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------------------------------------------------------------- lists */

.rows { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.rows .row { display: flex; justify-content: space-between; gap: 12px; }
.rows .row > span:first-child { color: var(--muted); }
.rows .row strong { font-weight: 600; }

.totals { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tot {
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    color: var(--muted);
}
.tot.ok { color: var(--ok); border-color: #23543c; background: #12251c; }
.tot.bad { color: var(--bad); border-color: #5a2727; background: #261414; }

.result-list { max-height: 340px; overflow-y: auto; }
.result-list .item {
    border-bottom: 1px solid #20252f;
    padding: 7px 0;
    font-size: 12.5px;
}
.result-list .item code { display: inline-block; max-width: 100%; }
.result-list .item .msg { color: var(--muted); }

.email-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.emailbox {
    background: #0b0d13;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    max-height: 300px;
    overflow: auto;
}
.emailbox pre { font-size: 12px; color: #cfd6e6; }

.copybox {
    background: #0b0d13;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: 12.5px;
    cursor: pointer;
    overflow-x: auto;
}
.copybox:hover { border-color: var(--brand); }

.sources { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.sources .src {
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11.5px;
    color: var(--muted);
}
.sources .src b { color: var(--text); font-weight: 500; }

.cronline {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.cronline .code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ login page */

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(900px 500px at 50% -10%, #1b2334 0%, var(--bg) 60%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card p.sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.login-card label.field { margin-bottom: 12px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-foot { margin-top: 16px; color: var(--dim); font-size: 11.5px; text-align: center; }

/* ---------------------------------------------------------- small print */

@media (max-width: 980px) {
    .shell { flex-direction: column; }
    .side { width: auto; flex: none; height: auto; position: static; }
    .side nav { flex-direction: row; flex-wrap: wrap; }
    .grid2 { grid-template-columns: 1fr; }
    .main { padding: 16px 14px 50px; }
}
