/* =========================================================================
   Vicky-Ops theme
   -------------------------------------------------------------------------
   A calm, friendly layer over Bootstrap. Built for a non-technical user:
   large targets, generous spacing, one obvious action per screen, plain
   language, and motion that explains what just happened.

   Everything here is plain CSS — no build step, no preprocessor.
   ========================================================================= */

:root {
    /* Brand */
    --vo-primary:        #6C5CE7;
    --vo-primary-dark:   #5546d6;
    --vo-primary-soft:   #EFEDFE;
    --vo-primary-ring:   rgba(108, 92, 231, .22);

    /* Semantic */
    --vo-success:        #0EA46B;
    --vo-success-soft:   #E4F6EE;
    --vo-warn:           #D98218;
    --vo-warn-soft:      #FDF1DF;
    --vo-danger:         #DC3A44;
    --vo-danger-soft:    #FCE8E9;
    --vo-info:           #2A7FD4;
    --vo-info-soft:      #E6F1FC;
    --vo-celebrate:      #C2298F;
    --vo-celebrate-soft: #FBE8F4;

    /* Surfaces + text */
    --vo-bg:        #F6F6FA;
    --vo-surface:   #FFFFFF;
    --vo-line:      #E7E7EF;
    --vo-line-soft: #F1F1F6;
    --vo-ink:       #1E2233;
    --vo-ink-soft:  #5B6274;
    --vo-ink-faint: #8B92A5;

    /* Shape */
    --vo-radius:    16px;
    --vo-radius-sm: 11px;
    --vo-radius-pill: 999px;
    --vo-shadow:      0 1px 2px rgba(30, 34, 51, .05), 0 6px 18px rgba(30, 34, 51, .05);
    --vo-shadow-lift: 0 2px 6px rgba(30, 34, 51, .07), 0 14px 34px rgba(30, 34, 51, .10);

    --vo-sidebar-w: 252px;
    --vo-ease: cubic-bezier(.22, .68, .36, 1);
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */
body {
    background: var(--vo-bg);
    color: var(--vo-ink);
    margin: 0;
    font-size: .96rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { color: var(--vo-ink); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--vo-primary); text-decoration: none; }
a:hover { color: var(--vo-primary-dark); text-decoration: underline; }
.text-soft  { color: var(--vo-ink-soft) !important; }
.text-faint { color: var(--vo-ink-faint) !important; }

/* Bootstrap has no min-width utility, and a flex child will not shrink below
   its content without one — which is what makes .text-truncate work inside a
   flex row. Used wherever a name sits next to a chip. */
.min-w-0 { min-width: 0 !important; }

:focus-visible {
    outline: 3px solid var(--vo-primary-ring);
    outline-offset: 2px;
    border-radius: 6px;
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--vo-sidebar-w);
    background: var(--vo-surface);
    border-right: 1px solid var(--vo-line);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .24s var(--vo-ease);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.15rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--vo-ink);
    letter-spacing: -.02em;
}
.sidebar-brand .brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--vo-primary), #9d7bff);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px var(--vo-primary-ring);
}

.sidebar-nav { padding: .35rem .7rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--vo-ink-faint);
    font-weight: 700;
    padding: 1.1rem .65rem .35rem;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .7rem;
    border-radius: var(--vo-radius-sm);
    color: var(--vo-ink-soft);
    font-weight: 600;
    text-decoration: none;
    transition: background .15s var(--vo-ease), color .15s var(--vo-ease);
}
.sidebar-nav a i { font-size: 1.08rem; width: 1.25rem; text-align: center; }
.sidebar-nav a:hover { background: var(--vo-line-soft); color: var(--vo-ink); text-decoration: none; }
.sidebar-nav a.active { background: var(--vo-primary-soft); color: var(--vo-primary-dark); }
.sidebar-nav a .nav-count {
    margin-left: auto;
    background: var(--vo-warn);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--vo-radius-pill);
    display: grid; place-items: center;
}
.sidebar-nav a .nav-count:empty { display: none; }

.main { margin-left: var(--vo-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--vo-line);
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-title { font-size: 1.15rem; margin: 0; font-weight: 700; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: .85rem; }
.topbar-user .icon-link { color: var(--vo-ink-soft); font-size: 1.2rem; line-height: 1; }
.topbar-user .icon-link:hover { color: var(--vo-primary); }

.content { padding: 1.5rem; max-width: 1240px; width: 100%; }

/* Page heading block: title + subtitle + one primary action */
.page-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.page-head h2 { font-size: 1.5rem; margin: 0 0 .2rem; }
.page-head .sub { color: var(--vo-ink-soft); margin: 0; font-size: .95rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */
.card, .panel {
    background: var(--vo-surface);
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius);
    box-shadow: var(--vo-shadow);
}
.card { border-color: var(--vo-line); }
.panel { padding: 1.25rem; }
.panel-head {
    display: flex; align-items: center; gap: .6rem;
    margin: 0 0 1rem;
    font-size: 1.05rem; font-weight: 700;
}
.panel-head .sub { font-weight: 500; font-size: .87rem; color: var(--vo-ink-soft); margin-left: auto; }

.card-hover { transition: transform .18s var(--vo-ease), box-shadow .18s var(--vo-ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--vo-shadow-lift); }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat {
    background: var(--vo-surface);
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--vo-shadow);
}
.stat .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.stat .stat-label { color: var(--vo-ink-soft); font-size: .84rem; font-weight: 600; margin-top: .15rem; }
.stat .stat-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1rem; margin-bottom: .6rem;
}

/* -------------------------------------------------------------------------
   Status chips — icon + text, never colour alone
   ------------------------------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: var(--vo-radius-pill);
    font-size: .805rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    vertical-align: middle;
}
.chip i { font-size: .92em; }
.chip-muted     { background: var(--vo-line-soft);      color: var(--vo-ink-soft); }
.chip-primary   { background: var(--vo-primary-soft);   color: var(--vo-primary-dark); }
.chip-info      { background: var(--vo-info-soft);      color: var(--vo-info); }
.chip-success   { background: var(--vo-success-soft);   color: var(--vo-success); }
.chip-warn      { background: var(--vo-warn-soft);      color: var(--vo-warn); }
.chip-danger    { background: var(--vo-danger-soft);    color: var(--vo-danger); }
.chip-celebrate { background: var(--vo-celebrate-soft); color: var(--vo-celebrate); }

/* Pulse once when a status changes under the user's eyes */
.chip.chip-changed { animation: chipPop .55s var(--vo-ease); }
@keyframes chipPop {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 currentColor; }
    35%  { transform: scale(1.11); box-shadow: 0 0 0 6px rgba(0,0,0,0); }
    100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* Filter chips (clickable) */
.chip-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip-filter {
    border: 1px solid var(--vo-line);
    background: var(--vo-surface);
    color: var(--vo-ink-soft);
    border-radius: var(--vo-radius-pill);
    padding: .45rem .95rem;
    font-size: .87rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s var(--vo-ease);
}
.chip-filter:hover { border-color: var(--vo-primary); color: var(--vo-primary); }
.chip-filter.active {
    background: var(--vo-primary);
    border-color: var(--vo-primary);
    color: #fff;
    box-shadow: 0 3px 10px var(--vo-primary-ring);
}
.chip-filter .n { opacity: .75; font-weight: 700; margin-left: .25rem; }

/* -------------------------------------------------------------------------
   Buttons — bigger and friendlier than Bootstrap defaults
   ------------------------------------------------------------------------- */
.btn {
    border-radius: var(--vo-radius-sm);
    font-weight: 650;
    padding: .55rem 1.05rem;
    transition: transform .12s var(--vo-ease), box-shadow .15s var(--vo-ease), background .15s var(--vo-ease);
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.02rem; border-radius: 13px; }
.btn i { vertical-align: -.06em; }

.btn-primary {
    background: var(--vo-primary);
    border-color: var(--vo-primary);
    box-shadow: 0 3px 12px var(--vo-primary-ring);
}
.btn-primary:hover, .btn-primary:focus { background: var(--vo-primary-dark); border-color: var(--vo-primary-dark); }
.btn-outline-primary { color: var(--vo-primary); border-color: #d5cffa; }
.btn-outline-primary:hover { background: var(--vo-primary); border-color: var(--vo-primary); }
.btn-success { background: var(--vo-success); border-color: var(--vo-success); }
.btn-success:hover { background: #0b8b5b; border-color: #0b8b5b; }
.btn-soft {
    background: var(--vo-line-soft);
    border: 1px solid transparent;
    color: var(--vo-ink);
}
.btn-soft:hover { background: #e7e7ef; color: var(--vo-ink); }
.btn-ghost { background: transparent; border: 1px solid var(--vo-line); color: var(--vo-ink-soft); }
.btn-ghost:hover { background: var(--vo-line-soft); color: var(--vo-ink); }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-label { font-weight: 650; font-size: .9rem; margin-bottom: .3rem; color: var(--vo-ink); }
.form-control, .form-select {
    border-radius: var(--vo-radius-sm);
    border-color: var(--vo-line);
    padding: .6rem .85rem;
    font-size: .95rem;
    transition: border-color .15s var(--vo-ease), box-shadow .15s var(--vo-ease);
}
.form-control:focus, .form-select:focus {
    border-color: var(--vo-primary);
    box-shadow: 0 0 0 4px var(--vo-primary-ring);
}
.form-control-lg { padding: .8rem 1rem; font-size: 1.02rem; }
.form-text, .hint { color: var(--vo-ink-soft); font-size: .845rem; }
.form-check-input { width: 1.15em; height: 1.15em; margin-top: .15em; }
.form-check-input:checked { background-color: var(--vo-primary); border-color: var(--vo-primary); }
.form-check-label { padding-left: .2rem; }

/* Inline help bubble */
.help-dot {
    display: inline-grid; place-items: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--vo-line-soft);
    color: var(--vo-ink-faint);
    font-size: .7rem; font-weight: 800;
    cursor: help;
    vertical-align: 1px;
    margin-left: .3rem;
    border: none;
}
.help-dot:hover { background: var(--vo-primary-soft); color: var(--vo-primary); }

/* Big radio "choice cards" — used instead of checkboxes for real decisions */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.choice {
    position: relative;
    display: block;
    border: 2px solid var(--vo-line);
    border-radius: var(--vo-radius);
    padding: 1.15rem;
    cursor: pointer;
    background: var(--vo-surface);
    transition: all .18s var(--vo-ease);
}
.choice:hover { border-color: #cfc8f8; transform: translateY(-2px); box-shadow: var(--vo-shadow); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--vo-primary-soft); color: var(--vo-primary);
    display: grid; place-items: center; font-size: 1.25rem;
    margin-bottom: .7rem;
}
.choice .choice-title { font-weight: 700; font-size: 1.02rem; margin-bottom: .25rem; }
.choice .choice-desc { color: var(--vo-ink-soft); font-size: .88rem; line-height: 1.5; }
.choice:has(input:checked) {
    border-color: var(--vo-primary);
    background: #fbfaff;
    box-shadow: 0 0 0 4px var(--vo-primary-ring);
}
.choice:has(input:checked)::after {
    content: "\F26E";
    font-family: bootstrap-icons;
    position: absolute; top: .8rem; right: .9rem;
    color: var(--vo-primary); font-size: 1.15rem;
}

/* Toggle pills (weekdays, etc.) */
.pill-group { display: flex; gap: .45rem; flex-wrap: wrap; }
.pill-toggle { position: relative; }
.pill-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pill-toggle span {
    display: inline-block;
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius-pill);
    padding: .45rem 1rem;
    font-weight: 650;
    font-size: .88rem;
    color: var(--vo-ink-soft);
    cursor: pointer;
    user-select: none;
    transition: all .15s var(--vo-ease);
}
.pill-toggle input:checked + span {
    background: var(--vo-primary);
    border-color: var(--vo-primary);
    color: #fff;
    box-shadow: 0 3px 10px var(--vo-primary-ring);
}
.pill-toggle input:focus-visible + span { outline: 3px solid var(--vo-primary-ring); outline-offset: 2px; }

/* Placeholder chips she clicks to insert */
.token-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--vo-primary-soft); color: var(--vo-primary-dark);
    border: 1px dashed #c9c0f7;
    border-radius: var(--vo-radius-pill);
    padding: .25rem .7rem;
    font-size: .82rem; font-weight: 650;
    cursor: pointer;
}
.token-chip:hover { background: #e5e1fd; }

/* -------------------------------------------------------------------------
   Tables — softened
   ------------------------------------------------------------------------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { vertical-align: middle; padding: .8rem .9rem; }
.table > thead th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--vo-ink-faint);
    font-weight: 700;
    border-bottom: 1px solid var(--vo-line);
}
.table > tbody > tr { border-color: var(--vo-line-soft); }
.table > tbody > tr:hover { background: #fbfbfe; }
.table-wrap { overflow-x: auto; border-radius: var(--vo-radius); }

/* Avatar bubble */
.avatar {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 50%;
    background: var(--vo-primary-soft);
    color: var(--vo-primary-dark);
    display: grid; place-items: center;
    font-weight: 800; font-size: .82rem;
}

/* -------------------------------------------------------------------------
   Empty states — every empty screen teaches the next step
   ------------------------------------------------------------------------- */
.empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--vo-ink-soft);
}
.empty .empty-art {
    width: 76px; height: 76px;
    margin: 0 auto 1.1rem;
    border-radius: 22px;
    background: var(--vo-primary-soft);
    color: var(--vo-primary);
    display: grid; place-items: center;
    font-size: 2.1rem;
    animation: floaty 4s ease-in-out infinite;
}
.empty h4 { font-size: 1.15rem; margin-bottom: .4rem; }
.empty p { max-width: 420px; margin: 0 auto 1.2rem; }
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* -------------------------------------------------------------------------
   Attention strip — only shows when something needs her
   ------------------------------------------------------------------------- */
.attention {
    display: flex; align-items: center; gap: .9rem;
    background: var(--vo-warn-soft);
    border: 1px solid #f3ddb8;
    border-radius: var(--vo-radius);
    padding: .95rem 1.15rem;
    margin-bottom: 1rem;
}
.attention.attention-danger { background: var(--vo-danger-soft); border-color: #f5c9cc; }
.attention.attention-good   { background: var(--vo-success-soft); border-color: #bfe8d6; }
.attention .att-icon { font-size: 1.4rem; color: var(--vo-warn); }
.attention.attention-danger .att-icon { color: var(--vo-danger); }
.attention.attention-good .att-icon   { color: var(--vo-success); }
.attention .att-text { font-weight: 600; }
.attention .att-text small { display: block; font-weight: 500; color: var(--vo-ink-soft); }
.attention .btn { margin-left: auto; white-space: nowrap; }

/* -------------------------------------------------------------------------
   Progress
   ------------------------------------------------------------------------- */
.vo-progress {
    height: 10px;
    border-radius: var(--vo-radius-pill);
    background: var(--vo-line-soft);
    overflow: hidden;
}
.vo-progress .bar {
    height: 100%;
    border-radius: var(--vo-radius-pill);
    background: linear-gradient(90deg, var(--vo-primary), #9d7bff);
    transition: width .6s var(--vo-ease);
}
.vo-progress.striped .bar {
    background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: stripes 1s linear infinite;
}
@keyframes stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

/* Progress ring (dashboard "today" card) */
.ring { --pct: 0; width: 108px; height: 108px; position: relative; flex: 0 0 108px; }
.ring::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--vo-primary) calc(var(--pct) * 1%), var(--vo-line-soft) 0);
    transition: background .6s var(--vo-ease);
}
.ring::after {
    content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--vo-surface);
}
.ring .ring-label {
    position: absolute; inset: 0; display: grid; place-items: center;
    z-index: 1; text-align: center; line-height: 1.15;
}
.ring .ring-num { font-size: 1.45rem; font-weight: 800; }
.ring .ring-sub { font-size: .72rem; color: var(--vo-ink-soft); font-weight: 600; }

/* -------------------------------------------------------------------------
   Email preview card
   ------------------------------------------------------------------------- */
.mail {
    background: var(--vo-surface);
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius);
    overflow: hidden;
    margin-bottom: .85rem;
    transition: box-shadow .18s var(--vo-ease), border-color .18s var(--vo-ease);
}
.mail:hover { box-shadow: var(--vo-shadow); }
.mail.is-open { border-color: #d5cffa; box-shadow: var(--vo-shadow-lift); }
.mail-head {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1.1rem;
    cursor: pointer;
}
.mail-who { min-width: 0; flex: 1; }
.mail-who .to { font-weight: 700; font-size: .95rem; }
.mail-who .subj {
    color: var(--vo-ink-soft); font-size: .86rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-body { border-top: 1px solid var(--vo-line-soft); padding: 1.1rem 1.15rem; }
.mail-subject-line {
    font-weight: 700; font-size: .96rem;
    padding-bottom: .6rem; margin-bottom: .8rem;
    border-bottom: 1px dashed var(--vo-line);
}
.mail-text {
    white-space: pre-wrap;
    font-size: .93rem;
    line-height: 1.65;
    color: #333a4d;
    max-height: 340px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.mail-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* -------------------------------------------------------------------------
   The step rail — a campaign's sequence, left to right
   ------------------------------------------------------------------------- */
.step-rail {
    display: flex; gap: .75rem; align-items: stretch;
    overflow-x: auto; padding-bottom: .35rem;
}
.step-card {
    flex: 0 0 auto; min-width: 190px; max-width: 250px;
    background: var(--vo-bg);
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius);
    padding: .8rem .9rem;
    position: relative;
}
/* The arrow between steps is drawn, not typed, so it never wraps oddly. */
.step-card + .step-card::before {
    content: ""; position: absolute; left: -.6rem; top: 50%;
    width: .45rem; height: .45rem;
    border-top: 2px solid var(--vo-line);
    border-right: 2px solid var(--vo-line);
    transform: translateY(-50%) rotate(45deg);
}
/* A manual step is visually a different kind of thing from an email — it is
   the one you have to act on. */
.step-card.is-task {
    background: var(--vo-warn-soft, #FFF6E6);
    border-color: #f2ddb4;
}
.step-card-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.step-name { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-when { font-size: .78rem; color: var(--vo-ink-soft); margin-bottom: .5rem; }
.step-counts { display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; }
.step-counts .chip { font-size: .75rem; }

.step-badge {
    flex: 0 0 auto;
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--vo-primary); color: #fff;
    font-size: .78rem; font-weight: 700;
}

/* -------------------------------------------------------------------------
   Filter panel — the same controls wherever you pick people
   ------------------------------------------------------------------------- */
.filter-group { margin-bottom: .85rem; }
.filter-group:last-of-type { margin-bottom: 0; }
.filter-label {
    display: block;
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
    text-transform: uppercase; color: var(--vo-ink-soft);
    margin-bottom: .35rem;
}
/* A chip that is really a checkbox. The label carries the whole hit area, so
   the target stays finger-sized on a phone. */
label.chip-filter { cursor: pointer; user-select: none; margin: 0; }

.filter-advanced { margin-top: 1rem; border-top: 1px solid var(--vo-line-soft); padding-top: .75rem; }
.filter-advanced > summary {
    cursor: pointer; font-weight: 600; font-size: .9rem;
    color: var(--vo-primary); list-style: none;
}
.filter-advanced > summary::-webkit-details-marker { display: none; }
.filter-advanced > summary::before { content: "▸ "; display: inline-block; transition: transform .15s var(--vo-ease); }
.filter-advanced[open] > summary::before { content: "▾ "; }

/* The little × on a tag chip. */
.tag-x {
    border: 0; background: none; padding: 0 0 0 .35rem;
    font-size: 1.05rem; line-height: 1; cursor: pointer;
    color: inherit; opacity: .55;
}
.tag-x:hover { opacity: 1; color: var(--vo-danger); }

/* -------------------------------------------------------------------------
   Conversations — the inbox list and the message transcript
   ------------------------------------------------------------------------- */
.thread-list { display: flex; flex-direction: column; }
.thread-row {
    display: flex; gap: .9rem; align-items: flex-start;
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--vo-line-soft);
    text-decoration: none; color: inherit;
    transition: background .15s var(--vo-ease);
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--vo-bg); }
/* Unread is carried by weight and a spine of colour, not a loud fill — a full
   inbox should still look calm. */
.thread-row.is-unread { box-shadow: inset 3px 0 0 var(--vo-primary); }
.thread-row.is-unread .thread-who,
.thread-row.is-unread .thread-subject { font-weight: 700; }

.thread-avatar {
    flex: 0 0 auto;
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--vo-primary); color: #fff;
    font-weight: 700; font-size: .95rem;
}
.thread-main { min-width: 0; flex: 1; }
.thread-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.thread-who { font-weight: 600; font-size: .95rem; }
.thread-when { margin-left: auto; font-size: .8rem; white-space: nowrap; }
.thread-subject {
    font-size: .9rem; margin-top: .1rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-snippet {
    font-size: .85rem; margin-top: .15rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The AI's suggested next step. Quiet on purpose — it is advice sitting under
   the message, never something competing with what the person actually wrote. */
.thread-action {
    font-size: .82rem; margin-top: .3rem;
    color: var(--vo-primary); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The transcript. Their words sit left on the page tint, yours sit right in
   brand colour — the same shape every messaging app uses, so it needs no
   explaining. */
.convo { display: flex; flex-direction: column; gap: 1rem; }
.msg { max-width: 80%; }
.msg-in  { align-self: flex-start; }
.msg-out { align-self: flex-end; }
.msg-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .3rem; }
.msg-who { font-weight: 600; font-size: .87rem; }
.msg-when { font-size: .8rem; }
.msg-subject { font-size: .85rem; font-weight: 600; color: var(--vo-ink-soft); margin-bottom: .25rem; }
.msg-body {
    padding: .85rem 1rem;
    border-radius: var(--vo-radius);
    font-size: .93rem; line-height: 1.65;
    word-break: break-word;
}
.msg-in .msg-body {
    background: var(--vo-bg);
    border: 1px solid var(--vo-line);
    border-left: 3px solid var(--vo-primary);
}
.msg-out .msg-body {
    background: var(--vo-primary-soft);
    border: 1px solid #d5cffa;
}
.msg-out .msg-head { justify-content: flex-end; }

@media (max-width: 640px) {
    .msg { max-width: 100%; }
    .thread-when { margin-left: 0; }
}

/* Rows animate in as they arrive from polling */
.slide-in { animation: slideIn .35s var(--vo-ease) both; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------
   Wizard
   ------------------------------------------------------------------------- */
.steps { display: flex; align-items: center; gap: .35rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .5rem; }
.step .dot {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--vo-line-soft); color: var(--vo-ink-faint);
    font-weight: 800; font-size: .84rem;
    transition: all .2s var(--vo-ease);
}
.step .name { font-size: .88rem; font-weight: 650; color: var(--vo-ink-faint); }
.step.done .dot    { background: var(--vo-success); color: #fff; }
.step.done .name   { color: var(--vo-ink-soft); }
.step.current .dot { background: var(--vo-primary); color: #fff; box-shadow: 0 0 0 5px var(--vo-primary-ring); }
.step.current .name{ color: var(--vo-ink); }
.step-line { flex: 1 1 24px; height: 2px; background: var(--vo-line); min-width: 16px; }

/* -------------------------------------------------------------------------
   Toasts
   ------------------------------------------------------------------------- */
.vo-toasts {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 2100; display: flex; flex-direction: column; gap: .55rem;
    max-width: min(360px, calc(100vw - 32px));
}
.vo-toast {
    display: flex; align-items: flex-start; gap: .65rem;
    background: var(--vo-ink); color: #fff;
    padding: .8rem 1rem;
    border-radius: var(--vo-radius-sm);
    box-shadow: var(--vo-shadow-lift);
    font-size: .9rem; font-weight: 600;
    animation: slideIn .3s var(--vo-ease) both;
}
.vo-toast.out { animation: fadeOut .28s var(--vo-ease) both; }
.vo-toast.ok   { background: #10714f; }
.vo-toast.err  { background: #a52a33; }
.vo-toast i { font-size: 1.05rem; line-height: 1.3; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px); } }

/* Alerts */
.alert { border-radius: var(--vo-radius); border: 1px solid transparent; font-weight: 600; }
.alert-success { background: var(--vo-success-soft); border-color: #bfe8d6; color: #0a6a45; }
.alert-danger  { background: var(--vo-danger-soft);  border-color: #f5c9cc; color: #9d2830; }
.alert-warning { background: var(--vo-warn-soft);    border-color: #f3ddb8; color: #8a5310; }
.alert-info    { background: var(--vo-info-soft);    border-color: #c5ddf6; color: #1e5f9e; }

/* Modals */
.modal-content { border: none; border-radius: var(--vo-radius); box-shadow: var(--vo-shadow-lift); }
.modal-header, .modal-footer { border-color: var(--vo-line); padding: 1.1rem 1.35rem; }
.modal-body { padding: 1.35rem; }
.modal-title { font-weight: 700; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--vo-line); border-radius: var(--vo-radius-sm); box-shadow: var(--vo-shadow-lift); padding: .35rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-weight: 600; font-size: .9rem; }
.dropdown-item:active { background: var(--vo-primary); }

/* Skeleton shimmer while polling fills things in */
.skeleton {
    background: linear-gradient(90deg, var(--vo-line-soft) 25%, #fff 50%, var(--vo-line-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: 6px;
    color: transparent !important;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Live dot — shows the page is updating itself */
.live-dot {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .78rem; font-weight: 650; color: var(--vo-ink-faint);
}
.live-dot::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--vo-success);
    animation: blip 2s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* -------------------------------------------------------------------------
   Login
   ------------------------------------------------------------------------- */
.login-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 1.5rem;
    background: radial-gradient(1100px 500px at 15% -10%, #efedfe 0%, transparent 60%), var(--vo-bg);
}
.login-card { width: 100%; max-width: 400px; padding: 2rem; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--vo-shadow-lift); }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .content { padding: 1.1rem; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
}
.scrim {
    position: fixed; inset: 0; background: rgba(30, 34, 51, .45);
    z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s var(--vo-ease);
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* -------------------------------------------------------------------------
   Respect reduced motion — every animation above is decorative
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Print: hide the furniture */
@media print {
    .sidebar, .topbar, .page-head .actions, .vo-toasts { display: none !important; }
    .main { margin-left: 0; }
    .card, .panel, .stat { box-shadow: none; }
}

/* -------------------------------------------------------------------------
   Keyboard cursor for a worked-through queue (vo.queueKeys)
   ------------------------------------------------------------------------- */
.queue-item { outline: none; }
/* The row the keyboard is pointing at. A ring rather than a fill, so it reads
   as "here" without competing with the status chips inside the row. */
.queue-item.is-cursor {
    border-color: var(--vo-primary);
    box-shadow: 0 0 0 3px var(--vo-primary-soft);
}
.queue-item .mail-head { gap: .7rem; }
kbd {
    background: var(--vo-line-soft);
    border: 1px solid var(--vo-line);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: .05rem .3rem;
    font-size: .8em;
    color: var(--vo-ink);
}

/* -------------------------------------------------------------------------
   Kanban drag and drop
   ------------------------------------------------------------------------- */
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }
/* The card being dragged stays visible but recedes, so you can still see where
   it came from while you choose where it is going. */
.kanban-card.is-dragging { opacity: .45; }
.kanban-drop { transition: background .15s var(--vo-ease), box-shadow .15s var(--vo-ease); }
.kanban-drop.is-over {
    background: var(--vo-primary-soft);
    box-shadow: inset 0 0 0 2px var(--vo-primary);
}

/* -------------------------------------------------------------------------
   Calendar
   ------------------------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--vo-ink-faint);
    text-align: center; padding: .3rem 0;
}
.cal-day {
    min-height: 92px;
    background: var(--vo-bg);
    border: 1px solid var(--vo-line);
    border-radius: var(--vo-radius-sm);
    padding: .3rem;
    display: flex; flex-direction: column; gap: 2px;
}
.cal-day.is-empty { background: transparent; border-color: transparent; }
/* Today is marked by a ring, not a fill — the fill is needed for the meetings. */
.cal-day.is-today { border-color: var(--vo-primary); box-shadow: inset 0 0 0 1px var(--vo-primary); }
.cal-daynum { font-size: .78rem; font-weight: 700; color: var(--vo-ink-soft); }
.cal-appt {
    display: block;
    font-size: .74rem; line-height: 1.25;
    background: var(--vo-primary-soft);
    color: var(--vo-primary-dark);
    border-radius: 6px;
    padding: .15rem .3rem;
    text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-appt:hover { background: var(--vo-primary); color: #fff; text-decoration: none; }
.cal-appt.is-off { background: var(--vo-line-soft); color: var(--vo-ink-faint); text-decoration: line-through; }
.cal-time { font-weight: 700; margin-right: .2rem; }

.upcoming-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--vo-line-soft); }
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-bar { flex: 0 0 3px; align-self: stretch; background: var(--vo-primary); border-radius: 3px; }

@media (max-width: 700px) {
    .cal-day { min-height: 62px; }
    .cal-appt { font-size: .68rem; }
}

/* -------------------------------------------------------------------------
   Public booking page — slot picker
   ------------------------------------------------------------------------- */
.slot-days { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .35rem; }
.slot-day { flex: 0 0 auto; min-width: 108px; display: flex; flex-direction: column; gap: .35rem; }
.slot-date {
    font-size: .78rem; font-weight: 700; text-align: center;
    color: var(--vo-ink-soft); line-height: 1.2; margin-bottom: .15rem;
}
.slot-date span { display: block; font-weight: 500; color: var(--vo-ink-faint); }
.slot {
    border: 1px solid var(--vo-line);
    background: var(--vo-surface);
    border-radius: var(--vo-radius-sm);
    padding: .5rem .3rem;
    font-size: .88rem; font-weight: 600;
    color: var(--vo-primary-dark);
    cursor: pointer;
    transition: background .12s var(--vo-ease), border-color .12s var(--vo-ease);
}
.slot:hover { border-color: var(--vo-primary); background: var(--vo-primary-soft); }
.slot.is-picked { background: var(--vo-primary); border-color: var(--vo-primary); color: #fff; }

/* -------------------------------------------------------------------------
   Analytics — CSS bars, no chart library
   ------------------------------------------------------------------------- */
.an-row { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; }
.an-label { flex: 0 0 140px; font-size: .88rem; font-weight: 600; color: var(--vo-ink-soft); }
.an-value { flex: 0 0 auto; min-width: 76px; text-align: right; font-size: .9rem; font-weight: 700; }
.an-value .text-faint { font-weight: 500; font-size: .8rem; }
.an-bar { flex: 1 1 auto; height: 10px; background: var(--vo-line-soft); border-radius: 999px; overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 999px; transition: width .4s var(--vo-ease); }
.an-primary   { background: var(--vo-primary); }
.an-celebrate { background: var(--vo-celebrate); }
.an-muted     { background: var(--vo-ink-faint); }

/* Daily volume strip. Deliberately unlabelled — it is about the shape of the
   sending pattern, not about reading individual values off it. */
.an-spark { display: flex; align-items: flex-end; gap: 2px; height: 84px; }
.an-spark-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 3px; }
.an-spark-bar { width: 100%; background: var(--vo-primary); border-radius: 3px 3px 0 0; opacity: .82; }
.an-spark-col:hover .an-spark-bar { opacity: 1; background: var(--vo-primary-dark); }

@media (max-width: 640px) {
    .an-label { flex-basis: 96px; font-size: .82rem; }
    .an-value { min-width: 58px; font-size: .84rem; }
}

/* The picked option in a .choice-grid (transport picker, step type, etc). */
.choice.is-picked {
    border-color: var(--vo-primary);
    background: var(--vo-primary-soft);
    box-shadow: 0 0 0 1px var(--vo-primary) inset;
}
