/* ─────────────────────────────────────────────────────────────────────────────
   Manage Event (/manage-event/{code}) — workspace layout (2026-09-25 redesign)

   Header card (code, name, status, actions, stage stepper) sits above a grid:
     desktop 1200+     NOW      | SIDEBAR        (sidebar spans both rows)
                       ACTIVITY |
     under 1200        NOW → SIDEBAR → ACTIVITY  (money stays near the top)

   Flat: three surfaces (.me-card ×2 + .me-side), each one level deep —
   sections inside are separated by hairline dividers, never boxed.
   Page tokens (--me-border, --me-divider, --me-radius) are set on .me-page
   in ManageEvent.razor's own style block.
   ───────────────────────────────────────────────────────────────────────────── */

/* ═══ Header (2026-11-22, flat — owner picked mockup A) ═══════════════════════════════════
   back + breadcrumb                                   status
   #CODE  Event name                     Modify | Run sheet  ⟲  ⧉  Next stage
   client contact
   tinted fact strip: date · time · guests · lanes · occasion
   stage track (ManageEvent.razor's own style block) */

.mh-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.mh-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}
.mh-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}
.mh-ident {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-top: 0.85rem;
}
.mh-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}
.mh-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}
/* History | Modify — one joined pill; Rollback — small round amber icon (developer);
   Next stage — the only solid button. */
.mh-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.mh-tools a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0 0.9rem;
    border: 1px solid var(--me-border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.mh-tools a:hover {
    background: rgba(var(--brand-primary-rgb, 3, 102, 214), 0.06);
    color: var(--brand-primary);
}
.mh-tools i { font-size: 0.85rem; }

.mh-icon-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--me-border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mh-icon-btn:hover {
    background: rgba(var(--brand-primary-rgb, 3, 102, 214), 0.06);
    color: var(--brand-primary);
    border-color: rgba(var(--brand-primary-rgb, 3, 102, 214), 0.35);
}
.mh-icon-btn.warn { color: #b45309; border-color: rgba(180, 83, 9, 0.35); }
.mh-icon-btn.warn:hover { background: rgba(217, 119, 6, 0.1); border-color: #b45309; }
[data-theme="dark"] .mh-icon-btn.warn { color: #f0a752; border-color: rgba(240, 167, 82, 0.4); }

.mh-next {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 34px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.mh-next:hover { filter: brightness(0.94); }

.mh-code {
    padding: 0;
    color: var(--brand-purple, #6f42c1);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    white-space: nowrap;
}
[data-theme="dark"] .mh-code { color: #c0a6f0; }

/* Status in the flat header: colored dot + text, no filled chip. */
.mh-right .status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.mh-right .status-chip::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.mh-main {
    min-width: 0;
}
.mh-name {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-heading);
}
.mh-client {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.4rem;
    font-size: 0.86rem;
}
.mh-client > * {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.mh-client-name { font-weight: 600; color: var(--text-secondary); }
.mh-client a { color: var(--brand-primary); text-decoration: none; }
.mh-client a:hover { text-decoration: underline; }
.mh-client i { font-size: 0.8rem; opacity: 0.75; }

.mh-facts {
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--me-divider, rgba(0, 0, 0, 0.08));
}
.mh-fact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0 1.75rem;
    text-align: left;
    min-width: 0;
}
.mh-fact:first-child { padding-left: 0; }
.mh-fact + .mh-fact { border-left: 1px solid var(--me-divider, rgba(0, 0, 0, 0.08)); }
.mh-fact-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.mh-fact-label i { display: none; } /* flat mockup A: plain labels */
.mh-fact-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    font-variant-numeric: tabular-nums;
}
.mh-fact-value small { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.mh-fact-value.muted { color: var(--text-muted); font-weight: 600; }

.mh-waves {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.mh-waves i { margin-right: 0.3rem; color: var(--brand-primary); }

@media (max-width: 1199.98px) {
    /* tablet: actions may wrap under the name, still right-aligned */
    .mh-ident { flex-wrap: wrap; }
}

@media (max-width: 767.98px) {
    /* Phone (owner-approved mockup A, 2026-11-22): smaller type and pills; WhatsApp /
       email become round icon links; one action row with Next stage filling it and
       the rest as icons; facts on 3 columns with the date spanning two. */
    .mh-ident { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .mh-name { font-size: 1.2rem; }
    .mh-code { font-size: 0.8rem; }
    .manage-header-breadcrumb, .mh-right .status-chip { font-size: 0.68rem; }
    .mh-client { font-size: 0.8rem; align-items: center; gap: 0.35rem 0.75rem; }
    .mh-client .mh-lbl { display: none; }
    .mh-client a.mh-ic {
        width: 30px; height: 30px; justify-content: center;
        border: 1px solid var(--me-border); border-radius: 50%;
    }
    .mh-client a.mh-ic i { opacity: 1; font-size: 0.8rem; }
    .mh-actions { flex-wrap: nowrap; justify-content: flex-start; margin-left: 0; gap: 0.35rem; }
    .mh-actions .mh-next { order: -1; flex: 1; justify-content: center; min-height: 34px; font-size: 0.75rem; }
    .mh-tools { border: 0; overflow: visible; gap: 0.35rem; }
    .mh-tools a {
        width: 34px; min-height: 34px; padding: 0; justify-content: center;
        border: 1px solid var(--me-border); border-radius: 50%;
    }
    .mh-tools .mh-lbl { display: none; }
    .mh-icon-btn { width: 34px; height: 34px; }
    .mh-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0.75rem; }
    .mh-fact, .mh-fact:first-child { padding: 0; }
    .mh-fact + .mh-fact { border-left: 0; }
    .mh-fact--wide { grid-column: span 2; }
    .mh-fact-label { font-size: 0.6rem; }
    .mh-fact-value { font-size: 0.85rem; }
    .mh-fact-value small { font-size: 0.72rem; }
}

.me-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "now side"
        "activity side";
    gap: 1rem;
    align-items: start;
}
.me-now { grid-area: now; }
.me-activity { grid-area: activity; }
.me-side { grid-area: side; }

.me-card,
.me-side {
    background: var(--surface-card, #fff);
    border: 1px solid var(--me-border, rgba(0, 0, 0, 0.1));
    border-radius: var(--me-radius, 0.75rem);
    min-width: 0;
}
.me-card {
    padding: 1.25rem 1.5rem 1.5rem;
}
.me-side {
    padding: 0 1.25rem;
}

/* ═══ Card head ════════════════════════════════════════════════════════════ */

.me-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}
.me-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}
.me-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.me-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-primary);
    cursor: pointer;
}
.me-link:hover { text-decoration: underline; }

/* ═══ Activity ═════════════════════════════════════════════════════════════ */

.me-search {
    margin-left: auto;
    width: min(260px, 100%);
    min-height: 36px;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--me-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
}
.me-search:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.me-composer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--me-divider);
}
.me-composer textarea {
    resize: vertical;
    min-height: 64px;
    font-size: 0.88rem;
    border-radius: 0.6rem;
}
.me-composer-actions {
    display: flex;
    justify-content: flex-end;
}

/* Segmented switch: internal note | client communication */
.me-seg {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px;
    border-radius: 999px;
    background: var(--me-divider);
    gap: 2px;
    flex-wrap: wrap;
}
.me-seg button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 32px;
    padding: 0 0.9rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.me-seg button.on {
    background: var(--surface-card, #fff);
    color: var(--text-heading);
}

/* Optional "was this a conversation with the client?" line under the note box */
.me-contact {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.me-contact-q {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.me-contact-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-primary);
    cursor: pointer;
}
.me-contact-clear i { font-size: 0.7rem; }
.me-contact-clear:hover { text-decoration: underline; }
.me-contact-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.fu-method.sm {
    min-height: 32px;
    padding: 0 0.8rem;
    font-size: 0.8rem;
}
.me-composer-actions { align-items: center; gap: 0.75rem; }

.me-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.me-chip-sep {
    width: 1px;
    height: 22px;
    background: var(--me-border);
    margin: 0 0.25rem;
}

/* Timeline: a dot per note on a thin rail (no accent bars). Dot color = note type:
   inbound green, outbound blue, internal amber, system grey. */
.me-feed .note-item {
    position: relative;
    margin: 0;
    padding: 0 0 1.1rem 1.6rem;
    border-left: 0;
}
.me-feed .note-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #9ca3af;
    box-shadow: 0 0 0 3px var(--surface-card, #fff);
    z-index: 1;
}
.me-feed .note-item::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 0.9rem;
    bottom: -0.45rem;
    width: 2px;
    background: var(--me-divider);
}
.me-feed .note-item:last-of-type { padding-bottom: 0; }
.me-feed .note-item:last-of-type::after { display: none; }
.me-feed .note-inbound::before  { background: #22c55e; }
.me-feed .note-outbound::before { background: #0d6efd; }
.me-feed .note-internal::before { background: #f59e0b; }
.me-feed .note-system::before   { background: #9ca3af; }
.me-feed .note-item > div:last-child {
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: pre-wrap;
}
.me-empty {
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ═══ Follow-up logger (Follow-Up stage, NOW panel) ═══════════════════════ */

.fu-log {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--me-divider);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.fu-log-head { display: flex; flex-direction: column; gap: 0.15rem; }
.fu-log-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}
.fu-log-sub { font-size: 0.8rem; color: var(--text-muted); }

.fu-field { display: flex; flex-direction: column; gap: 0.45rem; }
.fu-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
}
.fu-optional { font-weight: 500; color: var(--text-muted); }
.fu-field textarea {
    resize: vertical;
    min-height: 64px;
    font-size: 0.88rem;
    border-radius: 0.6rem;
}

.fu-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.fu-method {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0 1rem;
    border: 1px solid var(--me-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.fu-method:hover { border-color: var(--brand-primary); color: var(--text-heading); }
.fu-method.on {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb, 3, 102, 214), 0.08);
    color: var(--brand-primary);
}

/* Outcome cards: icon + label + what it does. Tone shows on hover/selected. */
.fu-outcomes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}
.fu-outcome {
    --fu-tone: 108, 117, 125;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--me-border);
    border-radius: var(--me-radius, 0.75rem);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.fu-outcome > i {
    font-size: 1.1rem;
    line-height: 1.2;
    color: rgb(var(--fu-tone));
}
.fu-outcome-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.fu-outcome-text strong { font-size: 0.86rem; color: var(--text-heading); }
.fu-outcome-text span { font-size: 0.74rem; color: var(--text-muted); }
.fu-outcome:hover { border-color: rgba(var(--fu-tone), 0.55); }
.fu-outcome.on {
    border-color: rgb(var(--fu-tone));
    background: rgba(var(--fu-tone), 0.08);
}
.fu-green { --fu-tone: 25, 135, 84; }
.fu-amber { --fu-tone: 217, 119, 6; }
.fu-red   { --fu-tone: 220, 53, 69; }
.fu-grey  { --fu-tone: 108, 117, 125; }

.fu-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.fu-actions .btn { min-height: 40px; padding: 0 1.25rem; }
.fu-actions .me-link { margin-left: auto; }
.fu-missing { font-size: 0.78rem; color: var(--text-muted); }

.fu-giveup {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--me-border);
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.fu-giveup-note { flex-basis: 100%; font-size: 0.75rem; color: var(--text-muted); }

/* ═══ Follow-Up panel — one section (owner picked mockup B, 2026-11-22) ═══════
   Status line (call due · no answer · phone · next try), Who / How folded to one line
   while a call is due, outcome cards, note + button on one row, one footer row. */
.fu-panel { display: flex; flex-direction: column; gap: 1rem; }
.fu-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--me-divider);
}
.fu-status-end { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-left: auto; }
.fu-call {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgb(217, 119, 6);
    white-space: nowrap;
}
.fu-call::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: fu-pulse 1.6s ease-in-out infinite;
}
.fu-call.quiet { color: var(--text-muted); }
.fu-call.quiet::before { animation: none; }
@keyframes fu-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) { .fu-call::before { animation: none; } }
.fu-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 22px;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: rgba(108, 117, 125, 0.12);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.fu-chip-next { background: rgba(111, 66, 193, 0.1); color: rgb(111, 66, 193); }
.fu-tel {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 28px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    white-space: nowrap;
}
.fu-tel:hover { text-decoration: underline; }
.fu-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}
.fu-icon-btn:hover { background: rgba(108, 117, 125, 0.1); color: var(--text-heading); }
.fu-icon-btn.danger:hover { background: rgba(220, 53, 69, 0.08); color: rgb(220, 53, 69); }
.fu-task-edit { padding-bottom: 0.9rem; border-bottom: 1px solid var(--me-divider); }

.fu-who { display: flex; flex-direction: column; gap: 0.75rem; }
.fu-who-sum {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.fu-who-sum strong { color: var(--text-heading); font-weight: 600; }
.fu-who-sum .me-link { margin-left: 0.35rem; }
.fu-who-edit { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; }

.fu-logrow { display: flex; align-items: center; gap: 0.5rem; }
.fu-note {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding: 0 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
}
.fu-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.92);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.fu-submit:hover:not(:disabled) { background: rgb(33, 37, 41); }
.fu-submit:disabled { opacity: 0.45; cursor: not-allowed; }
[data-theme="dark"] .fu-submit { background: rgba(255, 255, 255, 0.9); color: #111; }

.fu-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--me-divider);
}
.fu-foot .me-link { margin-left: 0; }
.fu-foot-close { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); }

.fu-logrow .fu-note { border-radius: 999px; }

/* Phones: outcomes become 4 short rows (label + effect on one line) instead of 2×2 cards
   whose text wrapped to three lines; status chips flow left; footer stacks left. */
@media (max-width: 767.98px) {
    .fu-status-end { margin-left: 0; }
    .fu-logrow .fu-note { font-size: 16px; }
    .fu-foot { justify-content: flex-start; }
    .fu-panel .fu-outcomes { grid-template-columns: 1fr; gap: 0.4rem; }
    .fu-panel .fu-outcome { align-items: center; padding: 0.55rem 0.8rem; }
    .fu-panel .fu-outcome > i { font-size: 1rem; }
    .fu-panel .fu-outcome-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; }
}

/* ═══ Declined / Cancelled outcome (NOW panel) ═══════════════════════════ */

.me-outcome {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: var(--me-radius, 0.75rem);
}
.me-outcome--red {
    background: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.2);
}
.me-outcome-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}
.me-outcome-head > i {
    font-size: 1.35rem;
    line-height: 1.1;
    color: #dc3545;
}
.me-outcome-head strong {
    display: block;
    font-size: 1rem;
    color: var(--text-heading);
}
.me-outcome-head span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.me-outcome-facts {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem 1.25rem;
}
.me-outcome-facts dt {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.me-outcome-facts dd {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
}
.me-outcome-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(220, 53, 69, 0.15);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.me-outcome-foot span { flex: 1 1 260px; }
.me-outcome-foot .btn { border-radius: 999px; min-height: 36px; }

.me-sub-title {
    margin: 1.5rem 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
}
.me-rows { display: flex; flex-direction: column; }
.me-row {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--me-divider);
}
.me-row:last-child { border-bottom: 0; }
.me-row-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.me-row-date { font-size: 0.78rem; color: var(--text-muted); }
.me-row-body { margin-top: 0.3rem; font-size: 0.86rem; color: var(--text-primary); white-space: pre-wrap; }

/* ═══ Sidebar ══════════════════════════════════════════════════════════════ */

.me-side-sec {
    padding: 1.1rem 0;
    border-top: 1px solid var(--me-divider);
}
.me-side-sec:first-child { border-top: 0; }

.me-side-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.me-side-title .status-chip { letter-spacing: 0.03em; }

/* Event facts */
.me-facts {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.me-facts > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.75rem;
    font-size: 0.86rem;
}
.me-facts dt {
    font-weight: 500;
    color: var(--text-muted);
}
.me-facts dd {
    margin: 0;
    color: var(--text-heading);
    min-width: 0;
    overflow-wrap: anywhere;
}
.me-fact-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
a.me-fact-line {
    display: block;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.me-fact-line i { margin-right: 0.35rem; }
a.me-fact-line:hover { text-decoration: underline; }

/* Money */
.me-money {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.me-money-paid {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-heading);
}
.me-money-of {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.me-bar {
    height: 6px;
    margin: 0.6rem 0 0.75rem;
    border-radius: 999px;
    background: var(--me-divider);
    overflow: hidden;
}
.me-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-primary);
}
.me-bar.full > span { background: #198754; }
.me-money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}
.me-money-row strong {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-heading);
}

.me-disclose {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}
.me-disclose:hover { color: var(--text-heading); }
.me-payments { margin-top: 0.35rem; }
.me-payments .deposit-line:last-child { border-bottom: 0; }

.me-side-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}
.me-side-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    min-height: 30px;
    padding: 0 0.75rem;
    font-size: 0.78rem;
}
.me-side-actions .btn i { margin: 0 !important; font-size: 0.85rem; }
.me-side-actions .btn .clover-btn-icon { width: 13px; height: 13px; }
/* Money buttons: two equal columns, an odd last button (refund) spans the row. */
.me-money-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.me-money-actions .btn { justify-content: center; white-space: nowrap; }
.me-money-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Icon pills that slide their label open on hover / keyboard focus (owner kept them,
   2026-11-22; slowed down to ~0.45s with an ease-out curve). Touch screens have no
   hover, so there the labels always show. */
.me-money-actions.me-expand { display: flex; flex-wrap: nowrap; gap: 0.4rem; }
.me-expand .btn {
    gap: 0;
    min-width: 34px;
    height: 34px;
    padding: 0 0.62rem;
    justify-content: center;
    overflow: hidden;
    transition: padding 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), background-color 0.2s ease;
}
.me-expand .btn:last-child:nth-child(odd) { grid-column: auto; }
.me-expand .btn, .me-expand .btn:hover, .me-expand .btn:focus, .me-expand .btn:active { box-shadow: none !important; transform: none; }
.me-expand .btn .xl {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
                margin-left 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.3s ease 0.08s;
}
.me-expand .btn:hover .xl,
.me-expand .btn:focus-visible .xl { max-width: 8rem; opacity: 1; margin-left: 0.4rem; }
.me-expand .btn:hover, .me-expand .btn:focus-visible { padding: 0 0.85rem; }
@media (hover: none) {
    .me-money-actions.me-expand { flex-wrap: wrap; }
    .me-expand .btn .xl { max-width: none; opacity: 1; margin-left: 0.4rem; }
    .me-expand .btn { padding: 0 0.85rem; }
}

/* Package */
.me-opt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.me-opt-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 30px;
    padding: 0 0.75rem;
    border: 1px solid var(--me-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.me-opt-tabs button.on {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.me-opt-tabs .bi-check-circle-fill { color: #198754; }

.me-opt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--me-divider);
}
.me-opt-head--sub { margin-top: 1rem; }
.me-opt-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-heading);
}
.me-opt-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.me-opt-total {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-heading);
    white-space: nowrap;
}
.me-line {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.82rem;
    align-items: baseline;
}
.me-line-qty {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.me-line-name {
    color: var(--text-primary);
    overflow-wrap: anywhere;
}
.me-line-amt {
    font-variant-numeric: tabular-nums;
    color: var(--text-heading);
    font-weight: 600;
}
.me-opt-foot {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.4rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--me-divider);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Documents — one row per document, round icon actions on the right */
.me-lang {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--brand-purple, #6f42c1);
}
.me-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
}
.me-doc + .me-doc { border-top: 1px solid var(--me-divider); }
.me-doc-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
}
.me-doc-name i { color: var(--text-muted); }
.me-doc-acts { display: flex; gap: 0.35rem; }
/* Section-title action (Files → attach): small icon button pushed to the right. */
.me-side-title > .me-icon-btn { margin-left: auto; width: 28px; height: 28px; font-size: 0.85rem; text-transform: none; letter-spacing: 0; }
.me-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--me-border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.me-icon-btn:hover:not(:disabled) {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb, 3, 102, 214), 0.06);
}
.me-icon-btn.wa:hover:not(:disabled) {
    border-color: #198754;
    color: #198754;
    background: rgba(25, 135, 84, 0.06);
}
.me-icon-btn:disabled { opacity: 0.5; cursor: wait; }
.me-icon-btn .spinner-border-sm { width: 0.9rem; height: 0.9rem; border-width: 0.15em; }

/* Clover block in the sidebar: flat like the other sections (no card in the card,
   2026-11-22); icon sits inline with the title; buttons share one equal-column row. */
.me-side .confirmed-action-card {
    padding: 0;
    gap: 0.5rem;
    background: transparent;
    border: 0;
    border-radius: 0;
}
/* icon sits beside the title; text + buttons line up with the other sections' left edge */
.me-side .confirmed-action-card { display: block; position: relative; }
.me-side .confirmed-action-icon { position: absolute; left: 0; top: 0.05rem; font-size: 1rem; }
.me-side .confirmed-action-content h6 { padding-left: 1.45rem; }
.me-side .confirmed-action-content .d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem !important;
}
.me-side .confirmed-action-content .d-flex .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 30px;
    padding: 0 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    white-space: nowrap;
}
.me-side .confirmed-action-content .d-flex .btn i { margin: 0 !important; }
.me-side .confirmed-action-content .d-flex .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Cancel */
.me-side-danger {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}
.me-danger-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: #dc3545;
    cursor: pointer;
}
.me-danger-link:hover { text-decoration: underline; }
.me-side-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══ Breakpoints: tablet 768–1199, mobile under 768 ═══════════════════════ */

@media (max-width: 1199.98px) {
    .fu-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .me-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "now"
            "side"
            "activity";
    }
}

@media (max-width: 767.98px) {
    .me-layout { gap: 0.75rem; }
    .me-card { padding: 1rem 1rem 1.25rem; }
    .me-side { padding: 0 1rem; }
    .me-search { width: 100%; margin-left: 0; }
    .me-seg { align-self: stretch; }
    .me-seg button { flex: 1 1 auto; justify-content: center; }
    .me-chip-sep { display: none; }
}
