/* ==========================================================================
   Neta by Grix — Premium RTL design system
   Palette sampled from the Grix logo.
   ========================================================================== */

:root {
    /* Brand */
    --grix-cyan: #0DA2CA;
    --grix-blue: #1066B5;
    --grix-blue-600: #0F5CA3;
    --grix-navy: #012A7B;
    --grix-green: #18BE66;
    --grix-lime: #4BC140;
    --grix-orange: #FC952F;

    /* Gradients */
    --grad-brand: linear-gradient(135deg, #0DA2CA 0%, #1066B5 55%, #012A7B 100%);
    --grad-brand-soft: linear-gradient(135deg, rgba(13,162,202,.12), rgba(16,102,181,.12));
    --grad-sidebar: linear-gradient(185deg, #032F86 0%, #012160 100%);
    --grad-success: linear-gradient(135deg, #18BE66, #4BC140);
    --grad-orange: linear-gradient(135deg, #FCA847, #FC8A1E);

    /* Neutrals */
    --ink: #0F2033;
    --ink-2: #2b3f56;
    --muted: #64748b;
    --line: #e6ecf3;
    --line-2: #eef2f7;
    --bg: #f2f6fb;
    --card: #ffffff;

    /* Status */
    --ok: #16a34a;
    --ok-bg: #e7f8ee;
    --warn: #d97706;
    --warn-bg: #fdf1e1;
    --danger: #dc2626;
    --danger-bg: #fdecec;
    --info: #1066B5;
    --info-bg: #e8f1fb;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(1, 42, 123, .06), 0 1px 3px rgba(1, 42, 123, .06);
    --shadow: 0 6px 20px rgba(1, 42, 123, .08);
    --shadow-lg: 0 18px 50px rgba(1, 42, 123, .16);
    --ring: 0 0 0 4px rgba(16, 102, 181, .16);

    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 9px;
    --sidebar-w: 268px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, .display {
    font-family: "Rubik", "Heebo", sans-serif;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 0 0 .4em;
}

a { color: var(--grix-blue); text-decoration: none; }
a:hover { color: var(--grix-navy); }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.small { font-size: .82rem; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--grad-sidebar);
    color: #dfe8ff;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0; /* RTL: right edge */
    display: flex;
    flex-direction: column;
    z-index: 40;
    box-shadow: var(--shadow-lg);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar__brand img { width: 40px; height: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.sidebar__brand .name { font-family: "Rubik"; font-weight: 700; font-size: 1.28rem; color: #fff; line-height: 1; }
.sidebar__brand .sub { font-size: .72rem; color: #9fb6e8; letter-spacing: .12em; text-transform: uppercase; }

.sidebar__scope {
    margin: 16px 16px 4px;
    padding: 12px 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-sm);
    font-size: .8rem;
}
.sidebar__scope .label { color: #9fb6e8; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
.sidebar__scope .value { color: #fff; font-weight: 600; font-size: .95rem; margin-top: 2px; }

/* impersonation (platform owner acting inside a tenant) */
.imp-banner {
    margin: 16px 16px 4px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(252,149,47,.20), rgba(252,138,30,.14));
    border: 1px solid rgba(252,149,47,.45);
    border-radius: var(--radius-sm);
}
.imp-banner__label { display: flex; align-items: center; gap: 7px; color: #ffd9ab; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.imp-banner__label svg { width: 15px; height: 15px; }
.imp-banner__tenant { color: #cddbf7; font-size: .74rem; margin-top: 8px; }
.imp-banner__name { color: #fff; font-weight: 700; font-size: 1.02rem; font-family: "Rubik"; line-height: 1.2; }
.imp-banner__exit {
    display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
    margin-top: 12px; padding: 9px 12px; border-radius: var(--radius-xs); cursor: pointer;
    background: #fff; color: #b4620c; border: 0; font: inherit; font-weight: 600; font-size: .84rem;
    transition: background .16s ease;
}
.imp-banner__exit:hover { background: #fff4e7; }
.imp-banner__exit svg { width: 16px; height: 16px; }

.nav { padding: 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav__section { color: #7f9adb; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; padding: 14px 14px 6px; }
.nav__link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-xs);
    color: #cddbf7;
    font-weight: 500;
    transition: all .16s ease;
    position: relative;
}
.nav__link svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .9; }
.nav__link:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav__link.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav__link.active::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%;
    width: 3px; border-radius: 3px; background: linear-gradient(var(--grix-cyan), var(--grix-green));
}

.sidebar__foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.09); }

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

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 30px;
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.22rem; margin: 0; }
.topbar .crumb { color: var(--muted); font-size: .8rem; }

.content { padding: 28px 30px 48px; max-width: 1200px; width: 100%; }

/* user menu */
.usermenu { position: relative; }
.usermenu__btn {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 40px; padding: 6px 8px 6px 14px; cursor: pointer;
    transition: all .16s ease;
}
.usermenu__btn:hover { box-shadow: var(--shadow-sm); border-color: #d3deec; }
.usermenu__btn .who { display: flex; flex-direction: column; text-align: start; line-height: 1.2; }
.usermenu__btn .who .n { font-weight: 600; font-size: .86rem; }
.usermenu__btn .who .r { font-size: .72rem; color: var(--muted); }
.usermenu__panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); min-width: 220px; padding: 8px; display: none;
}
.usermenu.open .usermenu__panel { display: block; }
.usermenu__panel a, .usermenu__panel button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: var(--radius-xs);
    background: none; border: 0; cursor: pointer; color: var(--ink); font: inherit; text-align: start;
}
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--bg); }
.usermenu__sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* avatar */
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--grad-brand); color: #fff; font-weight: 700; font-size: .9rem;
    font-family: "Rubik"; flex: 0 0 auto; box-shadow: var(--shadow-sm);
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .74rem; }

/* ==========================================================================
   Cards, stats
   ========================================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 22px; border-bottom: 1px solid var(--line-2);
}
.card__head h2, .card__head h3 { margin: 0; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 8px; }
.card__head h2 svg, .card__head h3 svg { flex: 0 0 auto; }
.card__body { padding: 22px; }
.card__body.tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat {
    --stat-accent: #1066B5;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px 22px 20px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d7e2ef; }
/* An accent hairline down the leading edge gives each card its own identity. */
.stat::before {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
    width: 4px; background: var(--stat-accent); opacity: .9;
}
/* Accent colour by modifier (icon-less summary cards) or by icon tint (cards that still show one). */
.stat--green,  .stat:has(.stat__icon.green)  { --stat-accent: #18BE66; }
.stat--orange, .stat:has(.stat__icon.orange) { --stat-accent: #F5871F; }
.stat--cyan,   .stat:has(.stat__icon.cyan)   { --stat-accent: #0DA2CA; }
.stat__icon {
    width: 44px; height: 44px; border-radius: 12px; flex: none; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 8px 18px -8px var(--stat-accent);
}
.stat__icon svg { width: 23px; height: 23px; }
.stat__icon.blue { background: var(--grad-brand); }
.stat__icon.green { background: var(--grad-success); }
.stat__icon.orange { background: var(--grad-orange); }
.stat__icon.cyan { background: linear-gradient(135deg, #22C4E8, #0DA2CA); }
.stat__value {
    font-family: "Rubik"; font-size: 1.9rem; font-weight: 700; line-height: 1;
    letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat__label {
    color: var(--muted); font-size: .82rem; font-weight: 600; margin-top: 8px;
    letter-spacing: .01em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: .9rem;
    padding: 10px 18px; border-radius: var(--radius-xs);
    border: 1px solid transparent; cursor: pointer;
    transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
    white-space: nowrap; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px rgba(16,102,181,.28); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 22px rgba(16,102,181,.36); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cdd9e8; background: var(--bg); color: var(--ink); }
.btn-success { background: var(--grad-success); color: #fff; box-shadow: 0 6px 16px rgba(24,190,102,.26); }
.btn-success:hover { color:#fff; box-shadow: 0 10px 22px rgba(24,190,102,.34); }
.btn-danger { background: #fff; border-color: #f3c9c9; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-warn { background: #fff; border-color: #f2d7ac; color: var(--warn); }
.btn-warn:hover { background: var(--warn-bg); }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

.btn-icon {
    width: 34px; height: 34px; padding: 0; border-radius: 9px;
    background: #fff; border: 1px solid var(--line); color: var(--ink-2);
}
.btn-icon:hover { background: var(--bg); border-color: #cdd9e8; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
    text-align: start; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s ease; }
table.tbl tbody tr:hover { background: #f8fbff; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user .n { font-weight: 600; }
.cell-user .e { font-size: .8rem; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ==========================================================================
   Badges / chips
   ========================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .76rem; font-weight: 600; padding: 4px 11px; border-radius: 40px; line-height: 1.4;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: #eef2f7; }
.chip-role { font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 7px; background: var(--grad-brand-soft); color: var(--grix-navy); }
.chip-role.admin { background: rgba(252,149,47,.14); color: #b4620c; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-row { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
label.lbl { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 7px; color: var(--ink-2); }
label.lbl .req { color: var(--danger); }

/* Receipt-template preview + validation (bot settings → סליקה וקבלות) */
.receipt-bubble { background: #dcf8c6; border-radius: 12px; padding: 11px 13px; max-width: 380px; box-shadow: var(--shadow-sm); }
.receipt-doc { display: block; background: rgba(0,0,0,.06); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-weight: 600; font-size: .84rem; color: var(--ink-2); }
.receipt-msg { display: block; white-space: pre-wrap; line-height: 1.55; color: var(--ink); }

/* Reminder templates (settings → הודעות): one block per reminder — a WhatsApp-style preview + a create button. */
.reminders { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.reminder { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.reminder__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.reminder__title { font-weight: 700; color: var(--ink); font-size: .95rem; }
.reminder__status { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.reminder__status.is-ok { color: var(--ok); }
.reminder__status.is-pending { color: var(--warn); }
.reminder__status.is-locked { color: var(--muted); }
/* A reminder still locked behind an earlier one in the round — dimmed until its predecessor is created. */
.reminder.is-locked { opacity: .6; }
/* A settings card whose feature is unavailable (e.g. the pay-link summary with no payment gateway connected). */
.card.is-inactive { opacity: .85; }
.card.is-inactive .card__head h2 { color: var(--muted); }

/* Blink a debts row for ~2s when returning to it via "חזרה לחובות" (?focus=). */
@keyframes row-blink { 0%, 100% { background-color: transparent; } 50% { background-color: rgba(10,124,255,.22); } }
tr.row-blink > td { animation: row-blink 0.5s ease-in-out 0s 4; }
/* After the blink fades, a quiet steady marker on the row the manager returned to — a soft blue wash, enough to
   spot without shouting. Kept until the next page load. */
tr.row-focused > td { background-color: rgba(10,124,255,.08); }
tr.row-focused:hover > td { background-color: rgba(10,124,255,.13); }

/* "בטיפול ידני" marker on a debts row (the auto-round finished for this customer). */
.manual-badge { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 8px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: rgba(234,142,10,.12); color: var(--warn, #b7791f); }
.manual-badge svg { width: 13px; height: 13px; }
.btn[data-manual-filter].active { background: rgba(234,142,10,.14); color: var(--warn, #b7791f); border-color: var(--warn, #b7791f); }

/* Collection-round settings: a live plain-language summary of the configured round. */
.cr-summary { margin: 4px 0 18px; padding: 12px 14px; border-radius: 10px; background: var(--hover, rgba(10,124,255,.06)); color: var(--ink); font-size: .9rem; line-height: 1.6; }
.cr-summary:empty { display: none; }
/* Weekday picker (reminder schedule). */
.cr-days { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.cr-day { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; user-select: none; }
.cr-day input { margin: 0; }
/* Current uploaded account document. */
.doc-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.doc-current svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.doc-current a { font-weight: 600; }

/* Payment-demand modal (debts table → דרישת תשלום). The only modal in the app. */
.pd-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pd-modal[hidden] { display: none; }
body.pd-open { overflow: hidden; }
.pd-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.pd-modal__dialog { position: relative; background: var(--card, #fff); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.pd-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pd-modal__head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; }
.pd-modal__head svg { width: 20px; height: 20px; }
.pd-modal__x { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.pd-modal__x:hover { background: var(--hover, rgba(0,0,0,.05)); color: var(--ink); }
.pd-modal__body { padding: 16px 18px; overflow-y: auto; }
.pd-modal__for { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.pd-modal__for strong { color: var(--ink); }
.pd-modal__loading { color: var(--muted); padding: 14px 0; }
.pd-modal__msg { padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 500; }
.pd-modal__msg--bad { background: rgba(220,38,38,.08); color: var(--danger); }
.pd-section { margin-bottom: 16px; }
.pd-section__title { font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.pd-section__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pd-section__head .pd-section__title { margin-bottom: 0; }
.pd-select-all { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); cursor: pointer; user-select: none; }
.pd-select-all input { margin: 0; }
.pd-contacts, .pd-invoices { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.pd-pick { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.pd-pick:hover { border-color: var(--brand, #0a7cff); }
.pd-pick input { margin: 0; flex: none; }
.pd-pick__name { font-weight: 600; }
.pd-pick__meta { margin-inline-start: auto; color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.pd-badge { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.pd-badge--overdue { background: rgba(220,38,38,.12); color: var(--danger); }
.pd-empty { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.pd-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .95rem; }
.pd-total strong { font-size: 1.1rem; }
.pd-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.reminder__btn { display: block; margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(0,0,0,.08); text-align: center; color: #0a7cff; font-weight: 600; font-size: .9rem; }
.reminder form { margin-top: 11px; }
.receipt-warn { margin-top: 10px; font-size: .85rem; font-weight: 500; }
.receipt-warn--bad { color: var(--danger); }
.receipt-warn--ok { color: var(--ok); }
.receipt-create { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.receipt-vars { background: var(--info-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.receipt-vars__head { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; color: var(--info); margin-bottom: 9px; }
.receipt-vars__head svg { width: 16px; height: 16px; }
.receipt-vars__list { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--ink-2); }
.receipt-vars__key { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 600; background: rgba(1,42,123,.07); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.control, input.control, select.control {
    width: 100%; padding: 11px 14px; font: inherit; color: var(--ink);
    background: #fff; border: 1px solid #d8e1ec; border-radius: var(--radius-xs);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.control:focus { outline: none; border-color: var(--grix-blue); box-shadow: var(--ring); }
.control::placeholder { color: #9aa9ba; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 6px; }
.input-pw { position: relative; }
/* Reserve room for the eye toggle (sits at the physical-left in this RTL app) so
   the password text — RTL or LTR (dir="ltr") — never runs under it. */
.input-pw .control { padding-left: 44px; }
.input-pw .toggle {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 7px;
}
.input-pw .toggle:hover { background: var(--bg); color: var(--ink); }

.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .9rem; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--grix-blue); }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: #0f7a3d; border-color: #bce7cd; }
.alert-danger { background: var(--danger-bg); color: #a81f1f; border-color: #f4cccc; }
.alert-info { background: var(--info-bg); color: #0c4c8f; border-color: #cadffb; }
.alert-warn { background: var(--warn-bg); color: #9a5a06; border-color: #f2d7ac; }
.alert ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* ==========================================================================
   Page header + misc
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .t { font-size: 1.5rem; margin: 0; }
.page-head .d { color: var(--muted); margin: 4px 0 0; }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; opacity: .4; margin-bottom: 14px; }

.divider { height: 1px; background: var(--line); margin: 22px 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.tag-copy { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .82rem; background: var(--bg); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }

/* ==========================================================================
   Integration tiles
   ========================================================================== */
.int-category { margin-bottom: 30px; }
.int-category__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.int-category__head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.int-category__note { font-size: .85rem; color: var(--muted); }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.int-tile {
    position: relative; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 26px 20px 20px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    text-decoration: none; color: var(--ink);
    transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease;
}
a.int-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cdd9e8; }
.int-tile__logo { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.int-tile__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* These source images carry large internal whitespace, so contain-fitting renders
   them visibly smaller than the edge-to-edge logos. Scale them up to match. */
.int-tile__logo img[src*="openai"] { transform: scale(1.42); }
.int-tile__logo img[src*="pelecard"] { transform: scale(1.22); }
.int-tile__name { font-family: "Rubik"; font-weight: 600; font-size: 1.08rem; }
.int-tile__status { margin-top: 2px; }
.int-tile.is-disabled { cursor: not-allowed; }
.int-tile.is-disabled .int-tile__logo { filter: grayscale(1); opacity: .5; }
.int-tile.is-disabled .int-tile__name { color: var(--muted); }
.int-tile.is-connected { border-color: #bce7cd; box-shadow: 0 0 0 1px #bce7cd inset; }
.int-tile__corner {
    position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
    display: inline-flex; align-items: center; gap: 5px;
}

/* WhatsApp template editor */
.wa-editor { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@media (max-width: 820px) { .wa-editor { grid-template-columns: 1fr; } }
.wa-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.wa-tool {
    min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line);
    background: var(--card); border-radius: 8px; cursor: pointer; font-size: .95rem; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
}
.wa-tool:hover { background: #eef2f7; border-color: #cdd9e8; }
.wa-tool--var { width: auto; font-weight: 600; color: var(--brand, #4f46e5); gap: 4px; }
.wa-toolbar__sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.wa-vars { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.wa-var-row { display: flex; flex-direction: column; gap: 4px; }
.wa-var-row label { font-size: .85rem; color: var(--muted); }
.wa-var-row code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; direction: ltr; display: inline-block; }

/* WhatsApp live preview */
.wa-phone {
    background: #efeae2; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 16px;
}
.wa-phone__header { background: #075e54; color: #fff; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.wa-phone__header::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: #25d366; display: inline-block; }
.wa-phone__body { padding: 12px 10px; min-height: 200px; }
.wa-bubble {
    background: #d9fdd3; border-radius: 8px 0 8px 8px; padding: 7px 9px 5px; max-width: 92%;
    box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative;
    direction: rtl; text-align: right;
    white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: .93rem; color: #111;
}
.wa-bubble__time { display: block; text-align: left; font-size: .68rem; color: #667781; margin-top: 3px; }
.wa-bubble code { font-family: ui-monospace, monospace; background: rgba(0,0,0,.06); padding: 1px 3px; border-radius: 3px; }
.wa-preview-empty { color: #667781; font-style: italic; }

/* business-profile avatar + upload */
.wa-avatar-row { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.wa-avatar {
    width: 96px; height: 96px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
    background: #eef2f7; border: 1px solid var(--border, #e2e8f0);
    display: flex; align-items: center; justify-content: center;
}
.wa-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-avatar__empty { color: #94a3b8; display: flex; }
.wa-avatar__empty svg { width: 40px; height: 40px; }
.wa-avatar-form { flex: 1 1 220px; min-width: 200px; }

/* copy row (token / webhook url) */
/* nowrap, not wrap: with wrapping allowed the browser sizes the <code> to its full content first and drops the
   button onto its own line, so a long snippet and a short one lay out differently. Held on one line, the code
   shrinks (min-width:0) and scrolls inside itself instead. */
.copy-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.copy-row code {
    flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap;
    background: #0f172a; color: #e2e8f0; border-radius: 8px;
    padding: 10px 12px; font-family: ui-monospace, monospace; font-size: .85rem;
}
.copy-row > .btn { flex: 0 0 auto; white-space: nowrap; }
/* a snippet that is meant to be several lines (e.g. a field list pasted into Priority) */
.copy-row code.code--lines { white-space: pre; line-height: 1.55; }

/* Priority webhook setup steps */
.setup-section { font-weight: 700; color: var(--ink); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.setup-section:first-child { margin-top: 0; }
.setup-steps { margin: 6px 0 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; }
.setup-steps li { line-height: 1.6; }
.setup-paths { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.setup-paths li { background: #f4f7fb; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; line-height: 1.7; }

/* last-synced emphasis chip */
.sync-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--info-bg); color: var(--info);
    border: 1px solid #cadffb; border-radius: 40px;
    padding: 7px 14px; font-weight: 600; font-size: .88rem; white-space: nowrap;
}
.sync-chip svg { width: 16px; height: 16px; }

/* password meter */
.pw-meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.pw-meter > span { display: block; height: 100%; width: 0; transition: width .2s ease, background .2s ease; }

/* ==========================================================================
   Auth (login / change password) split screen
   ========================================================================== */
.auth {
    min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}
.auth__brand {
    background: var(--grad-brand); color: #fff; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px;
}
.auth__brand::after {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(600px 300px at 15% 15%, rgba(75,193,64,.35), transparent 60%),
        radial-gradient(500px 300px at 90% 85%, rgba(252,149,47,.30), transparent 55%);
    opacity: .9;
}
.auth__brand > * { position: relative; z-index: 1; }
.auth__hero { display: flex; flex-direction: column; align-items: center; }
.auth__hero img { width: 140px; height: 140px; filter: drop-shadow(0 10px 28px rgba(0,0,0,.3)); margin-bottom: 24px; }
.auth__hero-name { font-family: "Rubik"; font-weight: 700; color: #fff; font-size: 4.4rem; line-height: 1; letter-spacing: -.02em; }
.auth__hero-sub { font-size: 1.2rem; letter-spacing: .3em; text-transform: uppercase; color: #cfe0ff; margin-top: 12px; }

.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth__card .lead { color: var(--muted); margin-bottom: 28px; }
.auth__mobilelogo { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth__mobilelogo img { width: 44px; height: 44px; }
.auth__mobilelogo .name { font-family: "Rubik"; font-weight: 700; font-size: 1.4rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
.menu-toggle { display: none; }
@media (max-width: 980px) {
    .auth { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__mobilelogo { display: flex; }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3 { grid-template-columns: 1fr; }
    .grid.cols-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(100%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-inline-start: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 20px 16px 40px; }
    .topbar { padding: 12px 16px; }
}

/* scrim for mobile sidebar */
.scrim { display: none; position: fixed; inset: 0; background: rgba(1,20,50,.4); z-index: 35; }
.scrim.show { display: block; }

/* ==========================================================================
   WhatsApp chat inbox — RTL-first (logical properties), light theme, CSP-safe.
   Incoming-only bubbles on the START (right) side, tail on the top-START corner.
   ========================================================================== */
/* Chat / removal-list tabs. */
.wa-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.wa-tab {
    display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px;
    color: var(--muted); font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.wa-tab:hover { color: var(--ink); }
.wa-tab.active { color: var(--grix-cyan); border-bottom-color: var(--grix-cyan); }
.wa-tab svg { width: 16px; height: 16px; }
.wa-tab .count-pill { margin-inline-start: 2px; }
.wa-panel { display: none; }
.wa-panel.is-active { display: block; }

/* "ברשימת ההסרה" chip on a conversation / thread head. */
.wa-optout-chip {
    display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px;
    padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 700;
    background: var(--warn-bg); color: var(--warn); vertical-align: middle;
}
.wa-optout-chip svg { width: 11px; height: 11px; }

/* Manual add-to-removal-list form. */
.optout-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.optout-add__phone { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.optout-add__phone:focus-within { border-color: var(--grix-cyan); box-shadow: 0 0 0 3px rgba(13,162,202,.12); }
.optout-add__phone .control { border: 0; padding: 9px 4px; width: 190px; box-shadow: none; }
.optout-add__phone .control:focus { outline: none; box-shadow: none; }
.optout-add__flag svg { width: 22px; height: 15px; border-radius: 2px; display: block; }

/* Connected-number profile banner above the inbox (the bot's own WhatsApp identity). */
.wa-me {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 13px 18px; margin-bottom: 16px;
}
.wa-me__avatar {
    width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad-brand); color: #fff;
}
.wa-me__avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-me__avatar .wa-avatar-ico { width: 30px; height: 30px; }
.wa-me__meta { flex: 1; min-width: 0; }
.wa-me__name { font-family: "Rubik"; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.wa-me__phone {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .9rem; color: var(--muted); margin-top: 2px; unicode-bidi: plaintext;
}
.wa-me__badge { flex: none; color: #25D366; display: flex; align-items: center; }
.wa-me__badge svg { width: 26px; height: 26px; }

.wa-chat {
    --wa-wallpaper: #efeae2;             /* warm WhatsApp cream */
    --wa-list-hover: #f4f8fc;
    display: flex; padding: 0; overflow: hidden;
    height: 72vh; min-height: 480px; border-radius: var(--radius);
}

/* ---- Conversation list (START pane = right in RTL) ---- */
.wa-chat__list {
    flex: 0 0 336px; max-width: 44%;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    background: var(--card);
    border-inline-end: 1px solid var(--line);
    scrollbar-width: thin; scrollbar-color: #d3dde8 transparent;
}
.wa-chat__list::-webkit-scrollbar { width: 9px; }
.wa-chat__list::-webkit-scrollbar-thumb {
    background: #d3dde8; border-radius: 9px;
    border: 3px solid var(--card); background-clip: padding-box;
}
.wa-chat__convo {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding-block: 11px; padding-inline: 16px;
    color: var(--ink); text-decoration: none; cursor: pointer;
    border-block-end: 1px solid var(--line-2); transition: background .15s ease;
}
.wa-chat__convo:visited { color: var(--ink); }
.wa-chat__convo:last-child { border-block-end: none; }
.wa-chat__convo:hover { background: var(--wa-list-hover); color: var(--ink); }
.wa-chat__convo:focus-visible { outline: 2px solid var(--grix-cyan); outline-offset: -2px; }
.wa-chat__convo.active { background: var(--grad-brand-soft); }
.wa-chat__convo.active .wa-chat__name { color: var(--grix-navy); }
.wa-chat__convo.active::before {
    content: ""; position: absolute; inset-block: 8px; inset-inline-start: 0;
    width: 3px; background: var(--grad-brand);
    border-start-end-radius: 3px; border-end-end-radius: 3px;
}

/* ---- Avatar: small white person silhouette, centered on a soft disc ---- */
.wa-chat__avatar {
    position: relative; flex: 0 0 auto;
    inline-size: 40px; block-size: 40px; border-radius: 50%;
    overflow: hidden; display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(140deg, #9db8d6 0%, #6d90bd 58%, #5a80b2 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px rgba(255,255,255,.10), 0 1px 2px rgba(1,42,123,.16);
}
.wa-chat__avatar svg,
.wa-chat__avatar .wa-avatar-ico {
    inline-size: 52%; block-size: 52%; display: block; fill: currentColor;
}

/* ---- List-row text ---- */
.wa-chat__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.wa-chat__name { font-weight: 600; font-size: .95rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat__phone { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: end; unicode-bidi: plaintext; }
/* country flag beside a phone number (inline SVG) */
.wa-flag { height: 12px; width: auto; border-radius: 2px; vertical-align: -1px; margin-inline-end: 5px; flex: 0 0 auto; }
.wa-flag--globe { height: 13px; color: var(--muted); vertical-align: -2px; }
.wa-chat__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; padding-block-start: 2px; }
.wa-chat__time { font-size: .72rem; color: var(--muted); white-space: nowrap; unicode-bidi: plaintext; }
.wa-chat__side .badge {
    min-inline-size: 20px; block-size: 20px; padding-inline: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; line-height: 1;
    color: var(--muted); background: #eef2f7; border: 0; border-radius: 999px;
}

/* Known-contact enrichment: linked companies + a 24h activity status dot. */
.wa-chat__companies {
    display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-chat__companies svg { width: 13px; height: 13px; flex: 0 0 auto; }
.wa-status { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); }
.wa-status--on { background: #18BE66; }
.wa-status--off { background: #F5871F; }
.wa-thread__companies { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; }
.wa-thread__companies svg { width: 13px; height: 13px; }

/* ---- Thread (END pane = left in RTL) ---- */
.wa-chat__thread { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.wa-chat__thread > .empty { margin: auto; }
.wa-thread__head {
    display: flex; align-items: center; gap: 12px;
    padding-block: 11px; padding-inline: 20px;
    background: #fff; border-block-end: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(15,32,51,.05); position: relative; z-index: 1;
}
.wa-thread__name { font-weight: 600; font-size: 1rem; color: var(--ink); }
.wa-thread__head .small.muted { unicode-bidi: plaintext; }

/* ---- Thread body: WhatsApp cream wallpaper (tiny inline-SVG doodle, CSP-safe) ---- */
.wa-thread__body {
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: 18px 20px 22px;
    display: flex; flex-direction: column; gap: 5px;
    background-color: var(--wa-wallpaper);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23a1846a' stroke-opacity='.09' stroke-width='1.2'%3E%3Ccircle cx='11' cy='13' r='3.2'/%3E%3Ccircle cx='41' cy='35' r='4'/%3E%3Cpath d='M31 8q3.6 4 0 8'/%3E%3Cpath d='M6 41h6'/%3E%3Cpath d='M47 12v6'/%3E%3Cpath d='M22 46q3-3 6 0'/%3E%3C/g%3E%3Cg fill='%23a1846a' fill-opacity='.07'%3E%3Ccircle cx='25' cy='27' r='1.4'/%3E%3Ccircle cx='51' cy='49' r='1.4'/%3E%3Ccircle cx='16' cy='51' r='1.4'/%3E%3Ccircle cx='38' cy='6' r='1.4'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 20%, rgba(120,90,60,.05) 100%);
    background-repeat: repeat, no-repeat;
    background-size: 56px 56px, cover;
    box-shadow: inset 0 7px 12px -12px rgba(15,32,51,.28);
    scrollbar-width: thin; scrollbar-color: rgba(120,100,80,.32) transparent;
}
.wa-thread__body::-webkit-scrollbar { width: 9px; }
.wa-thread__body::-webkit-scrollbar-thumb { background: rgba(120,100,80,.30); border-radius: 9px; }
.wa-thread__body .empty { margin: auto; color: var(--muted); }

/* ---- Day separator (WhatsApp-style centered chip) ---- */
.wa-daysep { align-self: center; margin-block: 4px; }
.wa-daysep span {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    background: rgba(255,255,255,.85); color: var(--ink-2);
    font-size: .72rem; font-weight: 500; unicode-bidi: plaintext;
    box-shadow: 0 1px 1px rgba(11,26,45,.08);
}

/* ---- Incoming messages: compact, tail on top-START, time at bottom-END ----
   NB: own class (.wa-msg*) — the ".wa-bubble" name is taken by the green
   WhatsApp-template-preview bubble above; never reuse it here. */
.wa-msg {
    position: relative; align-self: flex-start;
    max-width: 74%; min-width: 48px; width: fit-content;
    background: #fff; border-radius: 8px; border-start-start-radius: 0;
    padding-block: 5px 6px; padding-inline: 9px 11px;
    box-shadow: 0 1px 1px rgba(11,26,45,.09), 0 1px 3px -1px rgba(11,26,45,.06);
}
.wa-msg::before {
    content: ""; position: absolute; inset-block-start: 0; inset-inline-start: -7px;
    width: 8px; height: 13px;
    background: 0 0 / 8px 13px no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='13' viewBox='0 0 8 13'%3E%3Cpath fill='%23ffffff' d='M6.467 3.568L0 12.193V1H5.188C6.958 1 7.526 2.156 6.467 3.568z'/%3E%3C/svg%3E");
    filter: drop-shadow(0 1px .5px rgba(11,26,45,.05));
}
.wa-msg__text {
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
    color: var(--ink); font-size: .92rem; line-height: 1.4;
}
/* WhatsApp inline formatting inside a message bubble (*bold* _italic_ ~strike~ ```mono```). */
.wa-msg__text strong { font-weight: 700; }
.wa-msg__text em { font-style: italic; }
.wa-msg__text del { text-decoration: line-through; }
.wa-msg__text code { font-family: ui-monospace, monospace; background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 4px; }
.wa-msg__time {
    margin-block-start: 1px; font-size: .64rem; color: var(--muted);
    text-align: end; unicode-bidi: plaintext;
}

/* Outgoing (נטע's) messages — green bubble on the far side, tail flipped to the end. */
.wa-msg--out {
    align-self: flex-end;
    background: #d9fdd3;
    border-start-start-radius: 8px; border-start-end-radius: 0;
}
.wa-msg--out::before {
    inset-inline-start: auto; inset-inline-end: -7px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='13' viewBox='0 0 8 13'%3E%3Cpath fill='%23d9fdd3' d='M1.533 3.568L8 12.193V1H2.812C1.042 1 .474 2.156 1.533 3.568z'/%3E%3C/svg%3E");
}

/* נטע on/off status chip in her banner. */
.wa-me__status {
    display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 8px;
    padding: 2px 9px; border-radius: 20px; font-family: "Rubik"; font-size: .7rem; font-weight: 700; vertical-align: middle;
}
.wa-me__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.wa-me__status.on { background: #e6f7ee; color: #0f9e52; }
.wa-me__status.on::before { background: #18BE66; }
.wa-me__status.off { background: #eef2f7; color: var(--muted); }
.wa-me__status.off::before { background: #94a3b8; }

/* ---- Responsive: list stacks above the thread ---- */
@media (max-width: 720px) {
    .wa-chat { flex-direction: column; height: auto; min-height: 0; }
    .wa-chat__list {
        flex-basis: auto; max-width: none; max-height: 44vh;
        border-inline-end: none; border-block-end: 1px solid var(--line);
    }
    .wa-chat__thread { min-height: 60vh; }
    .wa-msg { max-width: 86%; }
}

/* ==========================================================================
   Customer internal notes — chat button + unread badge (customers list)
   ========================================================================== */
.row-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
/* Debts table only: icon-only row buttons that expand to reveal their label on hover/focus. */
.row-actions--icons { gap: 10px; }
.row-actions--icons .btn { gap: 0; }
.row-actions--icons .btn .lbl {
    display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap;
    opacity: 0; margin-inline-start: 0;
    transition: max-width .28s ease, opacity .18s ease, margin-inline-start .28s ease;
}
.row-actions--icons .btn:hover .lbl,
.row-actions--icons .btn:focus-visible .lbl { max-width: 140px; opacity: 1; margin-inline-start: 6px; }
/* "do not collect" row action — subtle until hovered, then a muted danger tint. */
.exclude-btn { color: var(--muted); }
.exclude-btn:hover { color: var(--danger); border-color: #f4cfcf; background: #fdf4f4; }
.chat-btn { position: relative; }
.chat-badge {
    position: absolute; inset-block-start: -8px; inset-inline-start: -8px;
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    background: #ef4444; color: #fff; font-family: "Rubik"; font-size: .7rem; font-weight: 700;
    line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--card);
}

/* ==========================================================================
   Customer internal notes — chat thread (Notes page)
   ========================================================================== */
.cnote-card { display: flex; flex-direction: column; height: 72vh; min-height: 480px; overflow: hidden; }
.cnote-thread {
    flex: 1; overflow-y: auto; padding: 20px 22px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
    background:
        radial-gradient(circle at 100% 0, rgba(13, 162, 202, .05), transparent 42%),
        var(--bg);
}
/* Stick messages to the bottom (newest just above the composer); the top scrolls when full. */
.cnote-thread > :first-child { margin-block-start: auto; }
.cnote-empty { margin: auto; text-align: center; color: var(--muted); }
.cnote-empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.cnote-empty p { margin: 0; }

.cnote-daysep { align-self: center; }
.cnote-daysep span {
    display: inline-block; background: #fff; border: 1px solid var(--line);
    color: var(--muted); font-size: .74rem; font-weight: 600;
    padding: 3px 12px; border-radius: 20px;
}

.cnote { display: flex; gap: 10px; align-items: flex-start; max-width: 82%; }
.cnote__av {
    width: 38px; height: 38px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: "Rubik"; font-weight: 700; font-size: .82rem;
}
.cnote__body { min-width: 0; }
.cnote__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cnote__author { font-weight: 700; font-size: .86rem; color: var(--ink); }
.cnote__time { font-size: .72rem; color: var(--muted); }
.cnote__bubble {
    background: #fff; border: 1px solid var(--line);
    border-radius: 3px 14px 14px 14px; padding: 9px 13px;
    color: var(--ink-2); font-size: .92rem; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word;
}
.cnote.is-me .cnote__bubble { background: #e9f4fb; border-color: #cbe6f6; }

/* Deterministic avatar palette (author name → colour, see AvatarClass in Notes.cshtml). */
.av-c0 { background: linear-gradient(135deg, #1066B5, #012A7B); }
.av-c1 { background: linear-gradient(135deg, #18BE66, #0f9e52); }
.av-c2 { background: linear-gradient(135deg, #F5871F, #e06d00); }
.av-c3 { background: linear-gradient(135deg, #0DA2CA, #0b7fa0); }
.av-c4 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.av-c5 { background: linear-gradient(135deg, #ec4899, #be185d); }

.cnote-compose {
    display: flex; gap: 10px; align-items: stretch;
    padding: 14px 18px; border-top: 1px solid var(--line); background: var(--card);
}
.cnote-input {
    flex: 1; resize: none; font-family: inherit; font-size: .95rem; line-height: 1.4;
    padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); overflow-y: auto;
}
.cnote-input:focus { outline: none; border-color: var(--grix-cyan); box-shadow: 0 0 0 3px rgba(13, 162, 202, .12); }
.cnote-send { flex: none; }

/* System note (posted by נטע, e.g. auto "החוב שולם") — centred, distinct dashed teal frame + a "מערכת" tag. */
.cnote--system { align-self: center; max-width: 92%; }
.cnote__av--system { background: linear-gradient(135deg, #0DA2CA, #0b7fa0); }
.cnote--system .cnote__bubble {
    background: #eef7fb; border: 1px dashed #9fd3e6; color: var(--ink-2); border-radius: 12px;
}
.cnote__systag {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .02em;
    color: #0b7fa0; background: #d7eff7; border-radius: 20px; padding: 1px 8px; margin-inline-start: 6px;
}

/* Live search box atop the WhatsApp conversation list. */
.wa-search {
    position: sticky; top: 0; z-index: 3;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: var(--card); border-block-end: 1px solid var(--line);
}
.wa-search__ico { display: inline-flex; color: var(--muted); flex: none; }
.wa-search__ico svg { width: 17px; height: 17px; }
.wa-search__input {
    flex: 1 1 auto; min-width: 0; padding: 8px 12px; font: inherit; font-size: .9rem;
    color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
}
.wa-search__input:focus { outline: none; border-color: var(--grix-cyan); box-shadow: 0 0 0 3px rgba(13, 162, 202, .12); }
.wa-chat__convo[hidden] { display: none; }             /* the .wa-chat__convo display:flex would otherwise defeat [hidden] */
.wa-search__empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 30px 16px; color: var(--muted); text-align: center; font-size: .88rem;
}
.wa-search__empty svg { width: 26px; height: 26px; opacity: .5; }
.wa-search__empty[hidden] { display: none; }

/* Inline "close manual handling" form in the סבבי גבייה manual list. */
.close-manual { display: inline-block; }
.close-manual__trigger { cursor: pointer; list-style: none; }
.close-manual__trigger::-webkit-details-marker { display: none; }
.close-manual__form {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 8px; padding: 10px; width: 260px; max-width: 70vw;
    white-space: normal; text-align: start;
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.close-manual__reason {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px;
    padding: 8px 10px; font: inherit; font-size: .88rem;
    color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.close-manual__reason:focus { outline: none; border-color: var(--grix-cyan); box-shadow: 0 0 0 3px rgba(13, 162, 202, .12); }

/* ==========================================================================
   Customer contacts (people to reach about the debt)
   ========================================================================== */
.req { color: var(--danger); font-weight: 700; }

/* Flag-only country picker + national-number input, as one control group. */
.phone-group { display: flex; align-items: stretch; gap: 8px; }
.phone-group__num { flex: 1; min-width: 0; }

.flag-select { position: relative; flex: none; }
.flag-select__btn {
    height: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px;
    padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
    cursor: pointer; color: var(--ink-2);
}
.flag-select__btn:hover { border-color: #cdd9e8; }
.flag-select__flag { display: flex; }
.flag-select__flag .flag { width: 28px; height: auto; border-radius: 3px; display: block; }
.flag-select__caret { width: 15px; height: 15px; color: var(--muted); flex: none; }
.flag-select__menu {
    position: absolute; z-index: 30; inset-block-start: calc(100% + 5px); inset-inline-start: 0;
    min-width: 190px; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.flag-select__menu[hidden] { display: none; }
.flag-select__opt {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    cursor: pointer; color: var(--ink); font-size: .92rem;
}
.flag-select__opt:hover { background: #eef3f9; }
.flag-select__opt .flag { width: 26px; height: auto; border-radius: 3px; }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-item { border-bottom: 1px solid var(--line-2); }
.contact-item:last-child { border-bottom: none; }

.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; }
.contact-row__main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contact-row__avatar {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad-brand); color: #fff; font-family: "Rubik"; font-weight: 700; font-size: .9rem;
}
.contact-row__meta { min-width: 0; }
.contact-row__name { font-weight: 600; color: var(--ink); }
.contact-row__phone { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); margin-top: 2px; unicode-bidi: plaintext; }
.contact-row__phone .flag { width: 20px; height: auto; border-radius: 2px; }
.contact-row__actions { display: inline-flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.contact-del { color: var(--danger); }
.contact-del:hover { background: #fdecec; border-color: #f7cccc; }
.inline-form { display: inline; }

/* Primary / secondary contact designation */
.role-badge {
    display: inline-block; margin-inline-start: 8px; padding: 1px 9px; border-radius: 20px;
    font-family: "Rubik"; font-size: .72rem; font-weight: 700; vertical-align: middle;
}
.role-badge--primary { background: var(--grad-brand); color: #fff; }
.role-badge--secondary { background: #eef2f7; color: var(--ink-2); border: 1px solid var(--line); }
.role-btn.is-active { background: var(--grad-brand); color: #fff; border-color: transparent; }
.role-btn.is-active:hover { filter: brightness(1.05); }

.contact-edit { padding: 16px 22px; background: var(--bg); }
.contact-edit__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ==========================================================================
   Bot settings
   ========================================================================== */
.bot-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .bot-grid { grid-template-columns: 1fr; } }

.bot-status { display: flex; align-items: center; gap: 16px; }
.bot-status__icon {
    width: 60px; height: 60px; border-radius: 16px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.bot-status__icon svg { width: 30px; height: 30px; }
.bot-status.on .bot-status__icon { background: var(--grad-success); box-shadow: 0 10px 22px -10px rgba(24, 190, 102, .6); }
.bot-status.off .bot-status__icon { background: #94a3b8; }
.bot-status__title { font-family: "Rubik"; font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.bot-status__sub { color: var(--muted); font-size: .9rem; margin-top: 3px; }
.bot-actions { margin-top: 22px; }
.bot-actions .hint { margin-top: 10px; }

.req-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.req-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.req-item.ok { border-color: #bce7cd; background: #f2fbf6; }
.req-item.bad { border-color: #f4cfcf; background: #fdf4f4; }
.req-item__ico { flex: none; display: flex; }
.req-item__ico svg { width: 22px; height: 22px; }
.req-item.ok .req-item__ico { color: var(--grix-green); }
.req-item.bad .req-item__ico { color: var(--danger); }
.req-item__name { font-weight: 600; color: var(--ink); }
.req-item__status { font-size: .84rem; color: var(--muted); margin-top: 1px; }

/* ── Settings page: category rail + grouped sections (built to grow) ───────────── */
.settings-layout { display: grid; grid-template-columns: 224px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } }

.settings-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) {
    .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 6px; }
}
.settings-nav__item {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 11px;
    color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none;
    border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.settings-nav__item:hover { background: var(--line-2); color: var(--ink); }
.settings-nav__item.active { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 4px 14px -10px rgba(15,32,51,.4); }
.settings-nav__item svg { width: 18px; height: 18px; flex: none; }

.settings-sections { min-width: 0; }
/* Tabs: only the active category is shown. The server renders exactly one .is-active section, so there's no
   flash of all-sections before settings-tabs.js runs. */
.settings-section { display: none; }
.settings-section.is-active { display: block; animation: settings-tab-in .18s ease; }
@keyframes settings-tab-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .settings-section.is-active { animation: none; } }
/* Spacing when a category stacks more than one card (e.g. הודעות: the reply + the receipt template). */
.settings-section > .card + .card { margin-top: 22px; }
.settings-section__head { margin-bottom: 14px; }
.settings-section__head h2 { font-family: "Rubik"; font-weight: 700; font-size: 1.18rem; color: var(--ink); margin: 0; }
.settings-section__head p { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }

/* Message editor: reuses the WhatsApp template look (.wa-toolbar/.wa-tool/.wa-phone/.wa-bubble). */
.bot-msg-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.bot-msg-actions .hint { margin: 0; }

/* Emoji picker popover (shared by the message editor + WhatsApp template editor) */
.emoji-pop {
    position: fixed; z-index: 1200; width: 300px; max-height: 300px; overflow-y: auto;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 14px 36px -12px rgba(15,32,51,.5); padding: 10px; display: none;
}
.emoji-pop.open { display: block; }
.emoji-pop__cat { font-size: .74rem; font-weight: 600; color: var(--muted); margin: 10px 4px 4px; }
.emoji-pop__cat:first-child { margin-top: 0; }
.emoji-pop__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop__item {
    border: 0; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1;
    padding: 5px 0; border-radius: 8px; transition: background .1s;
}
.emoji-pop__item:hover { background: var(--line-2); }

.btn-danger-soft { color: var(--danger); }
.btn-danger-soft:hover { background: #fdecec; border-color: #f7cccc; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: grayscale(.25); }

/* ==========================================================================
   Debts table — live search + sortable headers
   ========================================================================== */
.tbl-search { position: relative; display: flex; align-items: center; }
.tbl-search__ico { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.tbl-search__input {
    width: 260px; max-width: 46vw;
    padding: 9px 14px; padding-inline-start: 36px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: .9rem;
}
.tbl-search__input:focus { outline: none; border-color: var(--grix-cyan); box-shadow: 0 0 0 3px rgba(13, 162, 202, .12); }

/* Round count pill next to a card title (e.g. "לקוחות בחוב  12"). */
.count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 24px; padding: 0 9px; margin-inline-start: 8px;
    border-radius: 999px; background: var(--grad-brand); color: #fff;
    font-family: "Rubik"; font-size: .8rem; font-weight: 700; line-height: 1;
    vertical-align: middle;
}

/* Has / no contacts marker on the debts-list contacts button. */
.contacts-btn { position: relative; }
.contacts-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 6px; margin-inline-start: 6px;
    border-radius: 9px; font-family: "Rubik"; font-size: .7rem; font-weight: 700; line-height: 1;
    vertical-align: middle;
}
.contacts-badge--has { background: #e6f7ee; color: #0f9e52; }
.contacts-badge--none { background: #fdecec; color: #e04444; }

/* Debts-row reminder button, marked amber when the customer has open reminders. */
.rem-btn.has-reminders { background: var(--warn-bg); border-color: #f2d7ac; color: var(--warn); }
.rem-btn.has-reminders:hover { background: #fbe6c9; border-color: #e9c48a; }
.rem-btn.has-reminders svg { color: var(--warn); }

.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
.th-caret { display: inline-block; margin-inline-start: 6px; }
.th-caret::after { content: "\2195"; opacity: .3; font-size: .82em; }   /* ↕ */
.th-sort.asc .th-caret::after { content: "\2191"; opacity: 1; }         /* ↑ */
.th-sort.desc .th-caret::after { content: "\2193"; opacity: 1; }        /* ↓ */

/* ── customer reminders: topbar bell + panel, list items, row marker ───────── */
.rembell { position: relative; }
.rembell__btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 1px solid var(--line); cursor: pointer; color: var(--ink);
    transition: all .16s ease;
}
.rembell__btn:hover { box-shadow: var(--shadow-sm); border-color: #d3deec; }
.rembell__btn svg { width: 19px; height: 19px; }
.rembell.has-due .rembell__btn { color: var(--danger); border-color: rgba(220,38,38,.35); }
.rembell__count {
    position: absolute; top: -3px; inset-inline-end: -3px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff;
}
.rembell__count[hidden] { display: none; }
.rembell__panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 900;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); width: 360px; max-width: calc(100vw - 32px);
    max-height: 70vh; overflow-y: auto; display: none;
}
.rembell.open .rembell__panel { display: block; }
.rembell__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .95rem;
}
.rembell__head a { color: var(--brand, #0a7cff); font-weight: 600; font-size: .85rem; }
.rembell__body { padding: 6px; }
.rembell__empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 22px 10px; margin: 0; }
.rembell__section {
    font-size: .74rem; font-weight: 700; color: var(--muted);
    text-transform: none; letter-spacing: .02em; padding: 10px 8px 6px;
}
.rembell__item { padding: 10px 10px 8px; border-radius: 10px; border: 1px solid transparent; }
.rembell__item + .rembell__item { border-top: 1px solid var(--line); border-radius: 0; }
.rembell__item.is-due { background: rgba(220,38,38,.05); border-color: rgba(220,38,38,.18); border-radius: 10px; }
.rembell__item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rembell__customer { font-weight: 700; font-size: .9rem; }
.rembell__when { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.rembell__item.is-due .rembell__when { color: var(--danger); font-weight: 600; }
.rembell__desc { margin: 4px 0 0; font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.rembell__meta { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.rembell__actions { display: flex; gap: 6px; margin-top: 8px; }

/* shared postpone strip (bell panel + reminders page) */
.rem-snooze { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rem-snooze[hidden] { display: none; }
.control-sm { padding: 5px 8px; font-size: .82rem; width: auto; }

/* reminders page */
.rem-list { display: flex; flex-direction: column; }
.rem-item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rem-item[hidden] { display: none; }
.rem-item:last-child { border-bottom: 0; }
.rem-del { color: var(--danger); }
.rem-del:hover { background: rgba(220,38,38,.08); }
.rem-no-results { padding: 22px 16px; }
.rem-item.is-due { background: rgba(220,38,38,.04); }
.rem-item.is-done { opacity: .68; }
.rem-item__top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rem-item__customer { font-weight: 700; }
.rem-item__when { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .82rem; }
.rem-item__when svg { width: 14px; height: 14px; }
.rem-item__when.is-due { color: var(--danger); font-weight: 600; }
.rem-item__desc { margin: 6px 0 0; overflow-wrap: anywhere; }
.rem-item__meta { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.rem-item__actions { display: flex; gap: 8px; margin-top: 10px; }

/* documents-journal filter chips */
.btn.is-active { background: var(--grad-brand); color: #fff; border-color: transparent; }
.btn.is-active:hover { filter: brightness(1.05); }
