/*
 * Pulse Console - the design system.
 *
 * Values are taken from the Claude Design file "Pulse Console.dc.html". There, every style
 * is an inline string because the design canvas needs it; here they are classes, so a
 * change to a button is one edit rather than forty.
 *
 * Two fixed palettes, chosen per person (html[data-pulse]). A company supplies only
 * --brand and --on-brand, emitted per request in layouts/app.blade.php; the tinted
 * surface and the accent used for text are mixed from it here, per palette, so another
 * company's brand colour gets shades that suit it rather than Pulse's lime.
 */

/* ---------------------------------------------------------------- palettes */

html[data-pulse="dark"] {
    --paper: #0d0d0d; --card: #141414; --field: #1b1b1b; --edge: #2c2c2c; --line: #2a2a2a;
    --hair: #1f1f1f; --ink: #ffffff; --muted: #9b9b95; --faint: #6a6a64;
    --red: #e5534b; --red-bg: #2a1412; --blue: #5b8dee;
    --rail: #111111;
    --brand-dark: var(--brand);
    --brand-bg: color-mix(in srgb, var(--brand) 12%, var(--paper));
    --shadow-c: color-mix(in srgb, var(--brand) 18%, transparent);
    color-scheme: dark;
}

html[data-pulse="light"] {
    --paper: #f6f6f2; --card: #ffffff; --field: #f2f2ec; --edge: #e2e2d8; --line: #e6e6dc;
    --hair: #eeeee7; --ink: #141410; --muted: #6b6b62; --faint: #9c9c93;
    --red: #c8453d; --red-bg: #fbeceb; --blue: #3f6fd0;
    --rail: #ffffff;
    /* A light page needs a genuinely darker accent for text; the design's own rule. */
    --brand-dark: color-mix(in srgb, var(--brand) 45%, #14140f);
    --brand-bg: color-mix(in srgb, var(--brand) 25%, #ffffff);
    --shadow-c: rgba(20, 20, 16, .08);
    color-scheme: light;
}

:root {
    --r-sm: 8px;
    --r-md: 11px;
    --r-lg: 14px;
    --sp-1: 6px;
    --sp-2: 12px;
    --sp-3: 18px;
    --sp-4: 22px;
    --shadow: 4px 4px 0 var(--shadow-c);

    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --sans: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    --display: 'Cairo', 'Segoe UI', system-ui, sans-serif;

    --rail-w: 244px;
    --rail-w-folded: 68px;
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` must win over a block's own display, or toggling it from JS does nothing. */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 14px/1.7 var(--sans);
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--display); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

input, textarea, select, button { font-family: var(--sans); }
::placeholder { color: var(--faint); }

/* The small uppercase mono labels used for field names, table heads and kickers. */
.micro, label {
    display: block;
    font: 600 10px var(--mono);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
}
label { margin-bottom: 6px; }

/* ------------------------------------------------------------------ RTL */

/* In Arabic the layout mirrors but English copy, ids, numbers and timestamps keep their
   own reading order - the sentences do not flip. Same rule as the design file. */
html[dir="rtl"] :where(h1, h2, h3, p, span, div, td, th, li, label, option, button, input, textarea, select) {
    unicode-bidi: plaintext;
}

/*
 * Arabic typography, in three rules.
 *
 * 1. No mono face in Arabic. IBM Plex Mono has no Arabic letters, so every "mono" label -
 *    kickers, times, pills, stats, pagers - fell back to the system's monospace, which draws
 *    Arabic spaced out and disjointed. On an Arabic page --mono simply means Cairo; only
 *    things that really are codes (phone numbers, tags, template names: .mono, dir="ltr"
 *    inputs) keep the mono face.
 * 2. No letter-spacing. Tracking pulls apart letters that are meant to join.
 * 3. No text smaller than 11px. Cairo's Arabic at the 9-10px the English labels use is
 *    unreadable, so small labels step up.
 */
html[dir="rtl"] {
    --mono: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}
html[dir="rtl"] body * {
    letter-spacing: 0 !important;
}
html[dir="rtl"] :is(.mono, input.mono, textarea.mono) {
    font-family: 'IBM Plex Mono', 'Cairo', ui-monospace, monospace;
}
html[dir="rtl"] :is(.micro, label, th, .nav-group-label, .brand-sub) {
    font-family: var(--sans) !important;
    text-transform: none !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
}
html[dir="rtl"] :is(.page-kicker, .user-role, .row-meta, .pager-at, .pager-btn, .pill, .chip, .toggle) {
    font-size: 11.5px;
}
html[dir="rtl"] :is(.day span, .bub .tpl, .node-kind, .tpl-part, .role-meta, .chart-day, .nav-badge, .pill-unread, .bub .tm, .bub .by) {
    font-size: 11px !important;
}
html[dir="rtl"] .page-kicker { font-size: 12.5px; }
html[dir="rtl"] :is(.when, .q-when, .who, .assigned-by, .alert-when, .meta-line, .step-day, .seen) { font-size: 11.5px !important; }
/* Pills carry inline sizes as small as 9px for English; in Arabic they need at least 11px. */
html[dir="rtl"] .pill { font-size: 11px !important; }
html[dir="rtl"] .pill.lg { font-size: 12px !important; }
/* Arrows that mean "back" point the way the page reads. */
html[dir="rtl"] .back-arrow { display: inline-block; transform: scaleX(-1); }

/* ----------------------------------------------------------------- shell */

.shell {
    display: flex;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
}

.rail {
    width: var(--rail-w);
    flex-shrink: 0;
    background: var(--rail);
    border-inline-end: 1px solid var(--hair);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .18s ease;
}

.rail-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--hair);
    min-height: 69px;
}
.rail-logo { width: 40px; height: 34px; object-fit: contain; flex-shrink: 0; display: block; }
.rail-mark {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--brand); color: var(--on-brand);
    display: grid; place-items: center; font: 800 16px var(--display);
}
.brand-name { font: 800 16px var(--display); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub {
    font: 600 9px var(--mono); letter-spacing: 1.3px; color: var(--muted);
    text-transform: uppercase; white-space: nowrap;
}
.rail-text { min-width: 0; }

.rail-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px; }
.nav-group { margin-bottom: 16px; }
.nav-group-label {
    font: 600 9px var(--mono); letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--faint); padding: 0 10px 6px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    user-select: none;
}
.nav-item:hover { color: var(--ink); background: var(--brand-bg); }
.nav-item.on { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.nav-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav-badge {
    font: 700 10px var(--mono); border-radius: 999px; padding: 1px 7px;
    background: var(--brand); color: var(--on-brand);
}
.nav-item.on .nav-badge { background: var(--on-brand); color: var(--brand); }

/* Agorapulse's standing "Create post", above the menu; a "+" with a flyout when folded. */
.rail-create {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 12px 10px 0; padding: 9px 12px; border-radius: 10px;
    background: var(--brand); color: var(--on-brand); font-weight: 700;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 28%, transparent);
}
.rail-create:hover { color: var(--on-brand); filter: brightness(1.07); }
.rail-create:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rail-create .icon { flex-shrink: 0; }
.rail-create .nav-label { flex: 0 1 auto; }
.gate-switch + .rail-create { margin-top: 0; }

/* Positioned by shell.js. Fixed, not absolute: the nav scrolls, and a scrolling ancestor
   clips an absolutely positioned flyout on both axes. */
.nav-flyout {
    position: fixed;
    z-index: 200;
    transform: translateY(-50%);
    background: var(--card);
    border: 1.5px solid var(--edge);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    box-shadow: 4px 4px 0 var(--shadow-c);
    pointer-events: none;
}

.rail-user {
    padding: 10px;
    border-top: 1px solid var(--hair);
    display: flex;
    align-items: center;
    gap: 9px;
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--brand-bg); border: 1px solid var(--brand); color: var(--brand-dark);
    display: grid; place-items: center; font: 700 13px var(--display);
}
.user-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font: 500 10px var(--mono); color: var(--muted); white-space: nowrap; }
.rail-user form { margin-inline-start: auto; }

/* Folded to a 68px rail: icons only, labels in flyouts. */
.shell.is-folded .rail { width: var(--rail-w-folded); }
.shell.is-folded :is(.rail-text, .nav-label, .nav-badge, .rail-user form) { display: none; }
.shell.is-folded .nav-group-label { height: 10px; padding: 0; font-size: 0 !important; overflow: hidden; }
.shell.is-folded .nav-item { justify-content: center; }
.shell.is-folded .rail-create { margin-inline: 12px; padding-inline: 0; }
.shell.is-folded .rail-brand { justify-content: center; padding-inline: 10px; }
.shell.is-folded .rail-user { justify-content: center; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--hair);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}
.icon-btn {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    border: 1px solid var(--line); background: var(--field); color: var(--ink);
    display: grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--brand); }
.page-title { font: 700 20px var(--display); margin: 0; letter-spacing: -.2px; line-height: 1.2; }
.page-kicker { font: 500 10.5px var(--mono); color: var(--muted); }
.topbar-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }

.toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--field); border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 13px; font: 600 11.5px var(--mono); color: var(--muted);
    cursor: pointer; text-transform: uppercase;
}
.toggle:hover { border-color: var(--brand); color: var(--ink); }
.number-chip {
    display: flex; align-items: center; gap: 6px;
    background: var(--field); border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 12px; font: 600 11.5px var(--mono); color: var(--muted); text-transform: uppercase;
    white-space: nowrap;
}
.number-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: block; }

.page { flex: 1; min-width: 0; padding: 22px; max-width: 1320px; width: 100%; margin: 0 auto; }

.inside-bar {
    display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
    background: var(--brand); color: var(--on-brand); border-radius: var(--r-sm);
    padding: 8px var(--sp-2); margin-bottom: 14px; font-weight: 700; font-size: 13px;
}
.inside-bar form { margin-inline-start: auto; }
.inside-bar .pill { background: transparent; border-color: var(--on-brand); color: var(--on-brand); }

.rail-scrim { display: none; }

/* ------------------------------------------------------------- components */

.card, .panel {
    background: var(--card);
    border: 1.5px solid var(--edge);
    border-radius: var(--r-lg);
    padding: 22px;
    margin-bottom: 18px;
}
.card > h2, .panel > h2, .card-head h2 { font: 700 17px var(--display); margin: 0 0 4px; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .end { margin-inline-start: auto; }
.lede { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--brand); color: var(--on-brand); border: 0;
    border-radius: var(--r-md); padding: 11px 24px;
    font: 700 14px var(--display); cursor: pointer; text-decoration: none;
    box-shadow: 4px 4px 0 var(--shadow-c);
}
.btn:hover { color: var(--on-brand); filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 9px 18px; font-size: 13px; }
.btn.xs { padding: 5px 12px; font-size: 11.5px; box-shadow: none; }
.btn.ghost { background: var(--field); color: var(--ink); border: 1.5px solid var(--edge); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); }
.btn.danger { background: var(--red); color: #fff; box-shadow: none; }

/* Pills: counts, statuses and small actions. `.chip` is the older name, kept as an alias. */
.pill, .chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--field); border: 1px solid var(--line); border-radius: 999px;
    padding: 3px 11px; font: 600 11px var(--mono); color: var(--muted);
    white-space: nowrap; text-decoration: none; cursor: default;
}
:is(a, button).pill, :is(a, button).chip { cursor: pointer; }
:is(a, button).pill:hover, :is(a, button).chip:hover { border-color: var(--brand); color: var(--ink); }
.pill.lg, .chip.lg { padding: 5px 12px; font-size: 11.5px; }
.pill.on, .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pill.ok, .chip.ok { border-color: var(--brand); color: var(--brand-dark); }
.pill.bad, .chip.bad { border-color: var(--red); color: var(--red); }
button.pill, button.chip { font-family: var(--mono); }

/* A checkbox or radio with its words beside it, rather than a label above a field. */
.check { display: flex; gap: 8px; align-items: flex-start; font: 500 12.5px var(--sans); margin: 12px 0;
         text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.check input { width: auto; margin-top: 3px; accent-color: var(--brand); }

/* "Who" a campaign goes to (partials/audience). */
.who { margin-top: 18px; padding: 16px; border: 1.5px solid var(--edge); border-radius: var(--r-lg); background: var(--field); }
.who-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.who-count { margin-inline-start: auto; font: 700 13px var(--sans); color: var(--brand-dark); }
.who-count.none { color: var(--red); }
.who-types { display: flex; gap: 8px; flex-wrap: wrap; }
.who-type { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 8px 14px; cursor: pointer;
            border: 1.5px solid var(--edge); border-radius: 999px; background: var(--card);
            font: 600 13px var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0; }
.who-type input { width: auto; margin: 0; accent-color: var(--brand); }
.who-type:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.who-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.who-row { display: flex; gap: 10px 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.who-label { flex: 0 0 170px; margin: 5px 0 0; font: 600 12px var(--sans); color: var(--muted); text-transform: none; letter-spacing: 0; }
.who-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.who-chip { cursor: pointer; font-size: 11.5px; padding: 4px 11px; text-transform: none; }
.who-chip input { display: none; }
.who-chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.who-chip.not:has(input:checked) { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.who-activity select { width: auto; min-width: 220px; }
.who-days { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.who-days input { width: 80px; }
.who-note { font-size: 12px; margin: 8px 0 0; }
.who-skip { margin-bottom: 0; }
@media (max-width: 640px) { .who-label { flex-basis: 100%; margin-top: 0; } }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint); display: inline-block; }
.dot.on { background: var(--brand); }
.dot.bad { background: var(--red); }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=date], textarea, select {
    width: 100%;
    padding: 11px 13px;
    font: 400 14px var(--sans);
    background: var(--field);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}
:is(input, textarea, select):focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
.input-sm { padding: 7px 11px !important; font-size: 12.5px !important; }
input[type=color] {
    width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line);
    border-radius: var(--r-sm); background: var(--field); cursor: pointer;
}

.field { margin-bottom: 16px; }
/* A template's wording, shown under the picker so what goes out is never a surprise. */
.tpl-preview { margin-top: 10px; padding: 10px 13px; background: var(--field); border-radius: var(--r-sm); font-size: 13px; white-space: pre-wrap; line-height: 1.5; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; }
/* For fields that come in pairs, where auto-fit would strand the fourth on a row alone. */
.grid-fields.pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid-fields.pairs { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line);
    font: 600 10px var(--mono); letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--muted); white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.data .num { text-align: end; font-family: var(--mono); }
table.data th.num { text-align: end; }

.list-row {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    padding: 12px 0; border-bottom: 1px solid var(--hair); color: inherit;
}
a.list-row:hover { color: inherit; background: color-mix(in srgb, var(--brand-bg) 50%, transparent); }
.list-row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 150px; }
.row-title { font-size: 13.5px; font-weight: 600; }
.row-meta { font: 500 11px var(--mono); color: var(--muted); }
/* A small grey line of words and numbers: dates, counts, statuses. */
.meta-line { font: 500 10.5px var(--mono); }

.flash { border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: var(--brand-bg); border: 1px solid var(--brand); }
.flash.bad, .errors { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.flash.note { background: var(--field); border: 1px solid var(--edge); color: var(--ink); }
.errors { border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

.empty-note { color: var(--muted); font-size: 13px; margin: 0; }

.progress { height: 9px; border-radius: 999px; background: var(--field); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s; }

/* Pager, shared by every paginated screen; see vendor/pagination/console.blade.php. */
.pager { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: 10px 0 0; }
.pager-btn {
    display: inline-flex; background: var(--field); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 13px; font: 600 11.5px var(--mono); color: var(--ink);
}
.pager-btn:hover { border-color: var(--brand); color: var(--ink); }
.pager-btn.is-off { color: var(--faint); border-color: var(--hair); }
.pager-at { font: 500 11px var(--mono); color: var(--muted); margin-inline-start: auto; }

/* --------------------------------------------------------------- sign-in */

.auth {
    min-height: 100vh; display: grid; place-items: center; padding: 18px;
    background: var(--paper); color: var(--ink);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.auth-tools { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }

/* ------------------------------------------------------------- phones */

@media (max-width: 820px) {
    /* The sidebar becomes a drawer: the rail would take a third of a phone's width. */
    .rail {
        position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 100;
        width: 264px !important;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    html[dir="rtl"] .rail { transform: translateX(100%); }
    .shell.is-open .rail { transform: none; }
    .shell.is-folded :is(.rail-text, .nav-label, .nav-badge, .rail-user form) { display: revert; }
    .shell.is-folded .nav-group-label { height: auto; padding: 0 10px 6px; font-size: 9px !important; overflow: visible; }
    html[dir="rtl"] .shell.is-folded .nav-group-label { font-size: 11.5px !important; }
    .shell.is-folded .nav-item { justify-content: flex-start; }
    .shell.is-folded .rail-create { margin-inline: 10px; padding-inline: 12px; }
    .shell.is-open .rail-scrim {
        display: block; position: fixed; inset: 0; z-index: 90;
        background: rgba(0, 0, 0, .45);
    }
    .topbar { padding: 12px 14px; }
    .number-chip { display: none; }
    .page { padding: 14px; }
    .card, .panel { padding: 16px; }
}

/* ---- A person's own accent colour (topbar) ---------------------------------------------- */
.accent-picker { position: relative; }
.accent-picker > summary { list-style: none; }
.accent-picker > summary::-webkit-details-marker { display: none; }
.accent-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); display: block; box-shadow: 0 0 0 2px var(--field), 0 0 0 3px var(--line); }
.accent-pop {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: 232px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md, 14px);
    padding: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.28); display: grid; gap: 12px;
}
.accent-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.accent-swatch {
    aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; background: var(--swatch);
    box-shadow: 0 0 0 2px var(--card), 0 0 0 3px transparent; transition: box-shadow .12s;
}
.accent-swatch:hover, .accent-swatch:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line); outline: none; }
.accent-swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.accent-custom { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.accent-custom input[type=color] { width: 44px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 2px; cursor: pointer; }
.accent-note { margin: 0; font-size: 11.5px; color: var(--faint); line-height: 1.45; }

/* ---- Figures: the tiles, bar chart and funnel the dashboard and reports share ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1.5px solid var(--edge); border-radius: var(--r-lg); padding: 18px 18px 16px; }
.kpi .micro { font-size: 9.5px; letter-spacing: 1.3px; }
.kpi-value { font: 800 30px var(--display); line-height: 1.25; letter-spacing: -.5px; }
.kpi-delta { font: 500 11.5px var(--mono); color: var(--muted); }
.kpi-delta.up { color: var(--brand-dark); }
.kpi-delta.down { color: var(--red); }
.card-sub { font: 500 11px var(--mono); color: var(--muted); margin-inline-start: auto; }

.chart { display: flex; align-items: stretch; gap: 6px; height: 180px; }
.chart-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chart-bars { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.bar-out { background: var(--brand); border-radius: 3px 3px 0 0; }
.bar-in { background: var(--edge); border-radius: 0 0 3px 3px; }
.chart-day { font: 500 9px var(--mono); color: var(--faint); text-align: center; white-space: nowrap; overflow: hidden; }
.legend { display: flex; gap: 14px; margin-top: 12px; font: 500 11px var(--mono); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

.funnel-row { margin-bottom: 14px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; }
.funnel-head b { font-weight: 600; }
.funnel-head span { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.funnel-bar { height: 8px; border-radius: 999px; background: var(--field); overflow: hidden; }
.funnel-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
@media (max-width: 560px) { .chart { gap: 3px; } .chart-day { font-size: 8px; } .kpi-value { font-size: 26px; } }

/* ---- The gate switch: WhatsApp / Messenger / Instagram, at the top of the rail ---- */
.gate-switch { display: flex; gap: 4px; padding: 0 14px 12px; }
.gate-switch a {
    flex: 1; min-width: 0; text-align: center; font: 600 10px var(--mono); letter-spacing: .3px;
    padding: 6px 4px; border-radius: 8px; border: 1px solid var(--edge); color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gate-switch a:hover { color: var(--ink); border-color: var(--brand); }
.gate-switch a.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.shell.is-folded .gate-switch { flex-direction: column; padding: 0 8px 10px; }
.shell.is-folded .gate-switch a { font-size: 0; padding: 5px 0; }
.shell.is-folded .gate-switch a::before { content: attr(data-short); font-size: 10px; }
@media (max-width: 900px) {
    .shell.is-folded .gate-switch { flex-direction: row; padding: 0 14px 12px; }
    .shell.is-folded .gate-switch a { font-size: 10px; padding: 6px 4px; }
    .shell.is-folded .gate-switch a::before { content: none; }
}

/* ------------------------------------------------------------ the company's pictures */
/* A template's picture header, chosen in Campaigns, Scheduled and Chats (media-picker.js). */
.media-picker { margin-top: 6px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.media-picker.compact .mp-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin: 8px 0; }
.mp-item, .mp-add { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); border: 1px solid var(--edge); background: var(--field); overflow: hidden; cursor: pointer; }
.mp-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mp-item.on { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.mp-check { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand); color: var(--on-brand, #101010); font-size: 13px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.mp-item.on .mp-check { display: flex; }
.mp-remove { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.mp-item:hover .mp-remove, .mp-item:focus-within .mp-remove { opacity: 1; }
@media (hover: none) { .mp-remove { opacity: 1; } }
.mp-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-style: dashed; color: var(--muted); text-align: center; padding: 6px; font-size: 11.5px; }
.mp-add { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-weight: 600; margin: 0; }
.mp-add:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mp-add b { font-size: 22px; line-height: 1; color: var(--ink); }
.mp-add:hover { border-color: var(--brand); color: var(--ink); }
.mp-msg { font-size: 12px; margin: 6px 0 0; color: var(--muted); }
.mp-msg.bad { color: var(--red); }
.mp-link { margin-top: 10px; }
.mp-link summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.mp-link[open] summary { margin-bottom: 6px; }
.mp-link summary[hidden] { display: none; }
