/* =============================================================================
   Oceanr Outbound — Oceanr brand system (Brand Guidelines V01).
   Ocean Depth (#00334a) primary ink on a Pearl Mist (#f7f6ed) page, white cards.
   Fraunces (serif) for titles/display; Montserrat (sans) for body, uppercase
   letter-spaced nav / labels / buttons. Muted coastal accents used SPARINGLY.
   Flat hairline surfaces (no drop-shadows), squared CTAs, generous air.
   ============================================================================= */

:root {
    --paper: #ffffff;       /* card / topbar surface */
    --mist: #f7f6ed;        /* Pearl Mist — page background, negative space */
    --bone: #f2efe3;        /* input fills / zebra (a hair off Pearl Mist so they read on it) */
    --bone-2: #eae6d8;      /* hover / zebra alt */
    --ink: #00334a;         /* Ocean Depth — primary brand colour: text, topbar, headings, primary CTAs */
    --ink-soft: #3a5867;    /* softened Ocean Depth for secondary text */
    --muted: #7c8a91;
    --line: #e6e1d4;        /* warm hairline on Pearl Mist */
    --line-2: #d8d2c4;
    --accent: #2c6e70;      /* muted Sea Foam teal — sparing interactive accent */
    --accent-ink: #21585a;
    --accent-soft: #dcebe8; /* Sea Foam tint */
    --sand: #e8d9a6;        /* Coastal Sand — sparing accent */
    --warn: #9a6a1a;
    --danger: #a33a2c;
    --ok: #1f7a63;

    /* Status tones — subtle, drawn from the coastal accent family (Coastal Sand / Sea Foam) */
    --st-imported-fg:#7a6a2f; --st-imported-bg:#f4efd9; --st-imported-bd:#e4d9b2;
    --st-enrolled-fg:#21585a; --st-enrolled-bg:#e2f0f1; --st-enrolled-bd:#bfe0e3;
    --st-replied-fg: #8a5a12; --st-replied-bg: #f7ecd7; --st-replied-bd: #ecd4a8;
    --st-suppress-fg:#96382a; --st-suppress-bg:#f6ded9; --st-suppress-bd:#eec1b8;
    --st-done-fg:    #3f5566; --st-done-bg:    #eaeff2; --st-done-bd:    #cfdae1;

    --serif: "Fraunces", Georgia, "Times New Roman", serif;  /* titles / display */
    --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 3px;
    --wrap: 1200px;
    /* The Oceanr palette is light (Pearl Mist / white); the tool stays light regardless of OS dark mode. */
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    background: var(--mist);   /* Pearl Mist page — negative space per the brand system */
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Topbar (white, left logo, uppercase spaced nav) ---- */
header.topbar {
    display: flex; align-items: center; gap: 26px;
    padding: 10px 30px; min-height: 64px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.topbar .brand { display: flex; align-items: center; flex-shrink: 0; }
.topbar .brand img { height: 22px; width: auto; display: block; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; row-gap: 6px; }
.topbar nav a {
    color: var(--ink-soft); font-weight: 500; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .07em; padding: 4px 0;
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.topbar nav a:hover { color: var(--ink); text-decoration: none; }
.topbar nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }

/* ---- Layout ---- */
main { max-width: var(--wrap); margin: 44px auto; padding: 0 34px; }
/* Titles use Fraunces (brand display serif), light weight, sentence case — editorial + understated. */
h1 { font-family: var(--serif); font-size: 33px; font-weight: 300; letter-spacing: .1px; margin: 0 0 8px; color: var(--ink); }
h2 {
    font-size: 13px; font-weight: 600; margin: 34px 0 16px; color: var(--ink);
    text-transform: uppercase; letter-spacing: .14em;
}
h2:first-child { margin-top: 0; }
.sub { color: var(--ink-soft); margin: 0 0 26px; max-width: 760px; font-weight: 300; font-size: 15.5px; }

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 24px; }

/* ---- Cards (flat, hairline, no shadow) ---- */
.card {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 26px 28px; margin-bottom: 20px;
}

/* ---- Stat tiles: flat cells in a hairline grid (no shadow, no rounding) ---- */
.grid.stats .card { border: 0; border-radius: 0; margin: 0; padding: 22px 24px; }
.stat .n { font-family: var(--serif); font-size: 36px; font-weight: 300; letter-spacing: -.3px; color: var(--ink); line-height: 1.1; }
.stat .l {
    color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
    margin-top: 8px; font-weight: 500;
}
.stat.brand .n { color: var(--accent-ink); }
.stat.ok .n { color: var(--ok); }
.stat.warn .n { color: var(--warn); }
.stat.danger .n { color: var(--danger); }

/* ---- Tables ---- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
    color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .13em; background: transparent; border-bottom: 1px solid var(--line-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bone); }
td.wrap { overflow-wrap: anywhere; max-width: 380px; }

/* ---- Badges (small, squared, uppercase) ---- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 2px;
    font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    border: 1px solid var(--line-2); color: var(--muted); background: var(--bone); white-space: nowrap;
}
.badge.ACTIVE, .badge.ENROLLED { color: var(--st-enrolled-fg); border-color: var(--st-enrolled-bd); background: var(--st-enrolled-bg); }
.badge.PAUSED, .badge.REPLIED { color: var(--st-replied-fg); border-color: var(--st-replied-bd); background: var(--st-replied-bg); }
.badge.COMPLETED { color: var(--st-done-fg); border-color: var(--st-done-bd); background: var(--st-done-bg); }
.badge.STOPPED, .badge.SUPPRESSED { color: var(--st-suppress-fg); border-color: var(--st-suppress-bd); background: var(--st-suppress-bg); }
.badge.IMPORTED, .badge.NOT_ENROLLED { color: var(--st-imported-fg); border-color: var(--st-imported-bd); background: var(--st-imported-bg); }
.badge.NONE, .badge.ok, .badge.APPROVED { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line-2)); background: color-mix(in srgb, var(--ok) 10%, var(--paper)); }
.badge.block { color: var(--st-suppress-fg); border-color: var(--st-suppress-bd); background: var(--st-suppress-bg); }

/* ---- Buttons (squared, uppercase, letter-spaced — "GET A QUOTE" feel) ---- */
.btn {
    display: inline-block; cursor: pointer; font: inherit; font-weight: 500;
    font-size: 12px; text-transform: uppercase; letter-spacing: .11em;
    padding: 11px 22px; border-radius: 2px; border: 1px solid var(--ink);
    background: transparent; color: var(--ink); transition: background .14s, color .14s, border-color .14s;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 6px 13px; font-size: 10.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
form.inline { display: inline; }

/* ---- Forms (uppercase labels, bone inputs) ---- */
input, select, textarea {
    font: inherit; color: var(--ink); background: var(--bone);
    border: 1px solid var(--line-2); border-radius: 2px; padding: 11px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent); background: var(--paper);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { min-height: 96px; font-family: var(--mono); font-size: 13px; line-height: 1.55; background: var(--paper); }
label {
    display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: .1em;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.row > div { flex: 1; min-width: 170px; }

/* ---- Flash + notes ---- */
.flash { padding: 13px 16px; border-radius: 2px; margin-bottom: 20px; font-size: 14px; border-left: 3px solid; }
.flash.ok { background: color-mix(in srgb, var(--ok) 8%, var(--paper)); border-color: var(--ok); color: var(--ok); }
.flash.err { background: var(--st-suppress-bg); border-color: var(--danger); color: var(--st-suppress-fg); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.pill-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.note {
    font-size: 13.5px; color: var(--ink-soft); background: var(--bone);
    border-left: 3px solid var(--accent); padding: 13px 16px; border-radius: 2px; margin: 14px 0; font-weight: 300;
}
.note.safe-note {
    color: var(--ink); border-left-color: var(--accent);
    background: var(--accent-soft);
}

/* ---- Deliberate enrol (consequential action, must never be accidental) ---- */
.enrol-panel {
    border: 1px solid var(--line-2); background: var(--bone);
    border-top: 2px solid var(--warn);
    border-radius: var(--radius); padding: 24px 26px;
}
.enrol-panel h2 { margin-top: 0; }
.enrol-warn {
    display: flex; gap: 12px; align-items: baseline; font-size: 13.5px; color: var(--ink-soft);
    margin: 4px 0 16px; font-weight: 300;
}
.enrol-warn-tag {
    flex: none; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
    color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line-2));
    background: color-mix(in srgb, var(--warn) 10%, var(--paper)); padding: 3px 9px; border-radius: 2px;
}
.enrol-form { align-items: flex-end; }
.btn.enrol-btn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.enrol-btn:hover { background: color-mix(in srgb, var(--warn) 82%, #000); border-color: var(--warn); }

/* ---- Login / unsubscribe (standalone) ---- */
.login-wrap { max-width: 400px; margin: 11vh auto; }
.login-wrap .brand-lockup { text-align: center; margin-bottom: 26px; }
.login-wrap .brand-lockup img { height: 30px; }
.login-wrap .card { padding: 34px; }
.login-wrap h1 { text-align: center; font-size: 22px; }
.login-wrap .demo { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
    header.topbar { height: auto; padding: 14px 18px; flex-wrap: wrap; gap: 14px; }
    main { padding: 0 18px; margin: 28px auto; }
    h1 { font-size: 25px; }
}

/* Background import progress bar */
.progress-track { width: 100%; height: 14px; background: rgba(0, 51, 74, .10); border-radius: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: #00334a; transition: width .4s ease; }
.progress-fill.done { background: #1f8a5b; }
.progress-fill.failed { background: #b0203a; }

/* Users admin — action controls line up cleanly */
.actions-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.reset-pw { position: relative; }
.reset-pw > summary { list-style: none; cursor: pointer; }
.reset-pw > summary::-webkit-details-marker { display: none; }
.reset-pw > summary::marker { content: ""; }
.reset-pw form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.reset-pw input { width: 150px; }
