:root {
    --bg: #f5f7f8;
    --card: #fff;
    --ink: #1b2528;
    --muted: #6b777a;
    --line: #dfe5e7;
    --accent: #147b72;
    --accent-dark: #0f5f58;
    --warn: #a76b08;
    --danger: #a63b35;
    --good: #27734f;
    --shadow: 0 8px 28px rgba(30, 49, 52, .07);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink)
}

a {
    color: var(--accent-dark);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto
}

.topbar {
    background: #172326;
    color: white;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid #2c3a3d
}

.topbar-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.02em
}

.brand:hover {
    text-decoration: none
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: white
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px
}

.nav>a:not(.button) {
    color: #dfe9e8
}

.inline-form {
    display: inline;
    margin: 0
}

.main {
    padding: 34px 0 50px
}

.footer {
    padding: 10px 0 34px;
    color: var(--muted);
    font-size: 13px
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px
}

.page-head h1 {
    font-size: 36px;
    line-height: 1.05;
    letter-spacing: -.035em;
    margin: 4px 0 8px
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent)
}

.muted {
    color: var(--muted)
}

.small {
    font-size: 13px
}

.tiny {
    font-size: 11px
}

.head-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.button {
    appearance: none;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 9px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.button:hover {
    text-decoration: none;
    filter: brightness(.98)
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white
}

.button-primary:hover {
    background: var(--accent-dark)
}

.button-warn {
    background: #fff8e8;
    border-color: #efd49e;
    color: #7d5209
}

.button-ghost {
    background: transparent
}

.button-small {
    padding: 7px 10px;
    font-size: 13px
}

.button-wide {
    width: 100%
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow)
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 17px 18px
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700
}

.stat strong {
    display: block;
    font-size: 30px;
    letter-spacing: -.04em;
    margin-top: 4px
}

.batch-list {
    display: grid;
    gap: 12px
}

.batch-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden
}

.batch-card>summary {
    list-style: none;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    cursor: pointer
}

.batch-card>summary::-webkit-details-marker {
    display: none
}

.batch-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #97a3a5;
    flex: 0 0 auto
}

.status-running {
    background: #2a9d64;
    box-shadow: 0 0 0 4px #ddf4e8
}

.status-paused {
    background: #e7a52b
}

.status-completed {
    background: #667579
}

.status-draft {
    background: #9aa6a8
}

.batch-summary-stats {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 13px
}

.batch-summary-stats b {
    color: var(--ink)
}

.batch-body {
    border-top: 1px solid var(--line);
    padding: 17px 20px 20px
}

.progress {
    height: 7px;
    background: #edf1f2;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 18px
}

.progress span {
    display: block;
    height: 100%;
    background: var(--accent)
}

.batch-meta {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px
}

.batch-meta span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 4px
}

.batch-meta strong {
    font-size: 14px
}

.pill,
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap
}

.pill {
    padding: 7px 10px;
    font-size: 12px;
    background: #edf1f2
}

.pill-good {
    background: #e4f4eb;
    color: #1f6847
}

.status-pill-running {
    background: #e4f4eb;
    color: #1f6847
}

.status-pill-paused {
    background: #fff2d7;
    color: #7a560c
}

.status-pill-completed {
    background: #e8edef;
    color: #536266
}

.status-pill-draft {
    background: #edf1f2
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
    gap: 20px
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.batch-kpis {
    margin-bottom: 20px
}

.batch-kpis .card {
    padding: 17px 18px
}

.batch-kpis span,
.batch-kpis strong {
    display: block
}

.batch-kpis strong {
    font-size: 22px;
    margin-top: 4px
}

.form-card,
.side-card {
    padding: 22px
}

.stack {
    display: grid;
    gap: 16px
}

.field {
    display: grid;
    gap: 7px
}

.field label,
.test-send label {
    font-size: 13px;
    font-weight: 800
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd8da;
    border-radius: 9px;
    padding: 10px 11px;
    font: inherit;
    background: white;
    color: var(--ink)
}

textarea {
    resize: vertical
}

.field input[type=checkbox] {
    width: auto
}

.field:has(input[type=checkbox]) {
    display: flex;
    align-items: center;
    gap: 9px
}

.field:has(input[type=checkbox]) label {
    order: 2
}

.field:has(input[type=checkbox]) .help {
    order: 3
}

.help {
    font-size: 12px;
    color: var(--muted)
}

.field-error,
.error-text {
    color: var(--danger)
}

.side-card h2,
.section-head h2 {
    font-size: 18px;
    margin: 0 0 12px
}

.side-card h2:not(:first-child) {
    margin-top: 25px
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #f2f5f5;
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 9px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px
}

.token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.token-list code {
    background: #e9f4f2;
    color: #155c55;
    padding: 5px 7px;
    border-radius: 6px
}

.readbox {
    border: 1px solid var(--line);
    background: #f8fafb;
    border-radius: 9px;
    padding: 11px
}

.mail-body {
    min-height: 210px;
    background: #fff
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px
}

.preview-mail {
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 9px;
    overflow: hidden
}

.preview-mail summary {
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700
}

.preview-content {
    border-top: 1px solid var(--line);
    padding: 12px
}

.preview-content pre {
    background: white;
    border: 0;
    padding: 8px 0;
    margin-bottom: 0
}

.test-send {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    margin-top: 14px
}

.table-card {
    margin-top: 20px;
    overflow: visible
}

.table-card>.section-head {
    padding: 18px 18px 0
}

.table-scroll {
    overflow-x: auto
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px
}

th,
td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #e6ebec;
    vertical-align: top
}

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .055em;
    color: var(--muted);
    background: #fafbfb;
}

tbody tr:last-child td {
    border-bottom: 0
}

.badge {
    padding: 5px 8px;
    font-size: 11px;
    background: #edf1f2
}

.badge-sent {
    background: #eaf0f8;
    color: #335b85
}

.badge-replied {
    background: #e3f3ea;
    color: #256446
}

.badge-bounced {
    background: #fae8e6;
    color: #8b332e
}

.badge-skipped {
    background: #f0ece9;
    color: #6f625b
}

.badge-queued {
    background: #eff2f3;
    color: #5d696c
}

.badge-followup {
    background: #fff0cd;
    color: #7d5605
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr)) auto auto;
    gap: 9px;
    padding: 14px;
    margin-bottom: 16px
}

.report-table {
    margin-top: 0
}

.report-table td {
    min-width: 110px
}

.report-table td:nth-child(2) {
    min-width: 210px
}

.report-table td:nth-child(9) {
    min-width: 210px
}

.inline-edit select {
    min-width: 105px;
    padding: 7px
}

.notes-form {
    display: flex;
    gap: 5px
}

.notes-form input {
    min-width: 160px;
    padding: 7px
}

.mini-save {
    border: 1px solid var(--line);
    background: white;
    border-radius: 7px;
    cursor: pointer
}

.row-muted {
    opacity: .6
}

.row-menu {
    position: relative
}

.row-menu summary {
    cursor: pointer;
    list-style: none;
    font-weight: 900
}

.menu-pop {
    position: absolute;
    right: 0;
    top: 24px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 9px;
    padding: 6px;
    min-width: 160px;
    z-index: 10
}

.menu-pop button {
    width: 100%;
    border: 0;
    background: white;
    text-align: left;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer
}

.menu-pop button:hover {
    background: #f2f5f5
}

.table-note {
    padding: 10px 14px;
    color: var(--muted);
    font-size: 12px
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px
}

.message {
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: white
}

.message.success {
    background: #e9f6ee;
    border-color: #bddfc9;
    color: #205e40
}

.message.warning {
    background: #fff5dd;
    border-color: #eed39a;
    color: #74500b
}

.message.error {
    background: #faeae8;
    border-color: #e8bcb8;
    color: #87372f
}

.empty {
    padding: 34px;
    text-align: center
}

.empty-cell {
    text-align: center;
    padding: 34px;
    color: var(--muted)
}

.auth-wrap {
    min-height: 65vh;
    display: grid;
    place-items: center
}

.auth-card {
    width: min(420px, 100%);
    padding: 30px
}

.auth-card h1 {
    font-size: 36px;
    margin: 4px 0
}

.auth-card form p {
    display: grid;
    gap: 6px;
    margin: 0
}

.auth-card label {
    font-weight: 700;
    font-size: 13px
}

@media(max-width:900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .two-col {
        grid-template-columns: 1fr
    }

    .batch-summary-stats {
        display: none
    }

    .batch-meta {
        grid-template-columns: 1fr 1fr
    }

    .filters {
        grid-template-columns: 1fr 1fr
    }

    .filters input[type=search] {
        grid-column: 1/-1
    }

    .page-head {
        align-items: flex-start
    }

    .three-col {
        grid-template-columns: 1fr
    }

    .nav>a:not(.button) {
        display: none
    }
}

@media(max-width:600px) {
    .shell {
        width: min(100% - 20px, 1240px)
    }

    .main {
        padding-top: 22px
    }

    .page-head {
        display: grid
    }

    .page-head h1 {
        font-size: 30px
    }

    .topbar-inner {
        height: 58px
    }

    .nav {
        gap: 7px
    }

    .nav .button {
        padding: 7px 9px
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr
    }

    .stat strong {
        font-size: 25px
    }

    .batch-card>summary {
        padding: 15px
    }

    .batch-body {
        padding: 15px
    }

    .batch-meta {
        grid-template-columns: 1fr
    }

    .filters {
        grid-template-columns: 1fr
    }

    .filters input[type=search] {
        grid-column: auto
    }

    .test-send {
        grid-template-columns: 1fr
    }

    .test-send label {
        display: block
    }

    .report-table th {
        top: 58px
    }
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line)
}

.pagination>div {
    display: flex;
    gap: 7px
}
/* =========================================================
   ECHOLOG DUSK THEME
   Source-of-truth version of the production look.
   ========================================================= */

:root {
    --bg: #222a30;
    --card: #2b353c;
    --card-2: #344149;
    --card-3: #1d252a;
    --ink: #f0f4f5;
    --muted: #a9b5bc;
    --muted-2: #7f8d95;
    --line: #43515a;
    --line-soft: #37444c;
    --accent: #22948b;
    --accent-dark: #197a73;
    --accent-soft: #244a48;
    --warn: #e2ad52;
    --danger: #dc7f78;
    --good: #78bf94;
    --shadow: 0 18px 45px rgba(0, 0, 0, .16);
}

html,
body {
    background: var(--bg);
    color: var(--ink);
}

body,
button,
input,
select,
textarea {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: #61c8be;
}

a:hover {
    color: #7bd8cf;
}

.topbar {
    background: #172125;
    border-bottom-color: #314047;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

.nav > a:not(.button) {
    color: #dce7e8;
}

.page-head h1,
.side-card h2,
.section-head h2,
.auth-card h1 {
    color: var(--ink);
}

.eyebrow {
    color: #45b9ae;
}

.button {
    border-color: var(--line);
    background: var(--card-2);
    color: var(--ink);
}

.button:hover {
    background: #3d4b54;
    border-color: #52636d;
    color: white;
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.button-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.button-warn {
    background: #554525;
    border-color: #7e6737;
    color: #f4d999;
}

.button-ghost {
    background: transparent;
    color: var(--muted);
}

.card,
.stat,
.batch-card,
.filters {
    background: var(--card);
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.stat strong,
.batch-kpis strong {
    color: white;
}

.batch-card > summary:hover,
.preview-mail summary:hover,
tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.batch-body {
    background: rgba(0, 0, 0, .055);
    border-top-color: var(--line);
}

.progress {
    background: #1c2429;
}

.pill,
.badge,
.status-pill-draft {
    background: #39454b;
    color: #c5cfd3;
}

.pill-good,
.status-pill-running,
.badge-replied {
    background: #274b39;
    color: #91d9ae;
}

.status-pill-paused,
.badge-followup {
    background: #594823;
    color: #f1cb72;
}

.status-pill-completed,
.badge-queued {
    background: #39454b;
    color: #b9c5ca;
}

.badge-sent {
    background: #2a4054;
    color: #91b9e0;
}

.badge-bounced {
    background: #563431;
    color: #ef9d97;
}

.badge-skipped {
    background: #433e3a;
    color: #c9bbb1;
}

input,
select,
textarea {
    border-color: var(--line);
    background: var(--card-2);
    color: var(--ink);
}

input::placeholder,
textarea::placeholder {
    color: #85939b;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #48aaa2;
    background: #38464e;
    box-shadow: 0 0 0 3px rgba(42, 161, 152, .12);
    outline: none;
}

select {
    color-scheme: dark;
}

pre {
    background: #20292f;
    color: #dce5e8;
    border-color: var(--line-soft);
}

.token-list code {
    background: #244441;
    color: #8edbd3;
}

.readbox,
.preview-mail {
    background: #253037;
    border-color: var(--line);
    color: var(--ink);
}

.mail-body {
    background: var(--card-2);
}

.preview-content {
    border-top-color: var(--line);
}

.preview-content pre {
    background: transparent;
}

th,
td {
    border-bottom-color: var(--line-soft);
}

th {
    background: #20292f;
    color: #aebbc1;
}

.mini-save {
    background: var(--card-2);
    color: var(--ink);
    border-color: var(--line);
}

.menu-pop {
    background: #2e3940;
    border-color: var(--line);
}

.menu-pop button {
    background: transparent;
    color: var(--ink);
}

.menu-pop button:hover {
    background: rgba(255, 255, 255, .06);
}

.message {
    background: var(--card);
    color: var(--ink);
}

.message.success {
    background: #244536;
    border-color: #3f7256;
    color: #9fdeb6;
}

.message.warning {
    background: #514321;
    border-color: #766231;
    color: #efd083;
}

.message.error {
    background: #543330;
    border-color: #774742;
    color: #f0a19a;
}

.metadata-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 190px;
    max-width: 360px;
}

.metadata-item {
    display: inline-flex;
    gap: 4px;
    padding: 4px 7px;
    border: 1px solid #46565e;
    border-radius: 7px;
    background: #26343a;
    color: #cbd5d9;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}

.metadata-item b {
    color: #73cfc6;
    font-weight: 700;
}

.report-table td:nth-child(3) {
    min-width: 210px;
}

.report-table td:nth-child(5) {
    min-width: 220px;
}

.report-table td:nth-child(9) {
    min-width: 110px;
}

.report-table td:nth-child(11) {
    min-width: 210px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #52616a #20282e;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #20282e;
}

::-webkit-scrollbar-thumb {
    background: #52616a;
    border-radius: 10px;
    border: 2px solid #20282e;
}

::-webkit-scrollbar-thumb:hover {
    background: #65757e;
}
