/* Influence Dispatch Studio — navy / white / gold identity (see docs/UI_NAVIGATION.md) */
:root {
  --navy: #0e2141; --navy-2: #142b52; --navy-3: #1c3a6b;
  --gold: #c9a24b; --gold-2: #b5892f; --gold-soft: #f6edd8;
  --bg: #f3f5f9; --card: #ffffff; --line: #e3e7ee; --line-2: #d4dae5;
  --text: #1b2333; --muted: #667089; --muted-2: #8a93a8;
  --green: #23824f; --green-soft: #e4f4ea; --red: #b93a32; --red-soft: #fbe9e7;
  --amber: #a8740c; --amber-soft: #fdf3dc; --blue: #1f5d99; --blue-soft: #e6eff9;
  --purple: #5f4396; --purple-soft: #efe9f8;
  --radius: 14px; --shadow: 0 1px 2px rgba(14, 33, 65, .06), 0 6px 18px rgba(14, 33, 65, .06);
  --font: "Segoe UI", "Segoe UI Variable", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
svg.sprite { display: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 70%, #0b1a35 100%); color: #dbe3f2;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; display: flex; flex-direction: column; }
.brand { padding: 4px 10px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; }
.brand .word-1 { font-size: 26px; font-weight: 800; letter-spacing: .04em; color: #fff; }
.brand .word-2 { font-size: 14px; font-weight: 700; letter-spacing: .14em; color: var(--gold); }
.brand .tag { display: inline-block; margin-top: 6px; font-size: 10px; letter-spacing: .06em; color: #9fb0cf;
  border: 1px dashed rgba(201,162,75,.5); border-radius: 6px; padding: 1px 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #dbe3f2; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: #fff; box-shadow: 0 4px 12px rgba(201,162,75,.35); }
.nav .count { margin-inline-start: auto; background: var(--gold); color: #fff; border-radius: 999px; font-size: 12px;
  min-width: 22px; text-align: center; padding: 0 6px; font-weight: 700; }
.nav a.active .count { background: #fff; color: var(--gold-2); }
.nav-sep { height: 1px; background: rgba(255,255,255,.09); margin: 12px 8px; }
.nav-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8193b5; padding: 4px 12px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: #8193b5; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 14px;
  background: linear-gradient(115deg, #fff 60%, var(--gold-soft) 100%); border-bottom: 1px solid var(--line); }
.page-title { display: flex; gap: 16px; align-items: flex-start; }
.page-title .bar { width: 5px; align-self: stretch; border-radius: 4px; background: linear-gradient(var(--gold), var(--gold-2)); }
.page-title h1 { font-size: 28px; font-weight: 800; color: var(--navy); }
.page-title p { margin: 4px 0 0; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 14px; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: #fff;
  border-radius: 10px; padding: 7px 12px; color: var(--navy); font-weight: 500; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; color: var(--navy); }
.user-chip .who span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.content { padding: 24px 32px 120px; }
.stop-banner { background: var(--red); color: #fff; padding: 10px 32px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.env-banner { background: #fff6e0; color: #7a5a12; border-bottom: 1px solid #f0dfb4; padding: 6px 32px; font-size: 13px; }

/* ---------------------------------------------------------------- generic */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.card h3 { font-size: 15px; color: var(--navy); margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; left: -9999px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 18px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line-2); background: #fff; color: var(--navy); text-decoration: none; }
.btn:hover { background: #f6f8fb; text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-3); }
.btn-gold { background: #fff; border: 1.5px solid var(--gold); color: var(--gold-2); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #1c6d42; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; }
.icon-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; color: var(--navy); }
.icon-btn:hover { background: #f1f4f8; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.b-draft { background: var(--blue-soft); color: var(--blue); }
.b-review, .b-warn { background: var(--amber-soft); color: var(--amber); }
.b-ok { background: var(--green-soft); color: var(--green); }
.b-bad { background: var(--red-soft); color: var(--red); }
.b-muted { background: #eef1f5; color: var(--muted); }
.b-purple { background: var(--purple-soft); color: var(--purple); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.flash-list { list-style: none; padding: 0; margin: 0 0 18px; }
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; border: 1px solid; }
.flash.success { background: var(--green-soft); border-color: #b9e1c8; color: #165c37; }
.flash.error { background: var(--red-soft); border-color: #f1c4bf; color: #8e231c; }
.flash.warning, .flash.message { background: var(--amber-soft); border-color: #efd9a6; color: #7a5506; }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: #f6f8fb; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

label.f { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(201,162,75,.45); border-color: var(--gold); }
textarea { resize: vertical; line-height: 1.65; }
textarea.big { min-height: 230px; font-size: 16px; }
textarea.huge { min-height: 360px; font-size: 16px; }
textarea[dir=rtl], input[dir=rtl] { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; font-size: 17px; }
.field-meta { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 12.5px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

/* ---------------------------------------------------------------- stat cards & module cards */
.stat { display: flex; align-items: center; gap: 16px; border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); border-inline-start: 5px solid; background: #fff; box-shadow: var(--shadow); }
.stat .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; }
.stat .ico svg { width: 26px; height: 26px; }
.stat .lbl { color: var(--navy); font-weight: 600; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.05; }
.stat.s-green { border-inline-start-color: var(--green); background: linear-gradient(120deg, #fff 55%, #e9f6ee); } .stat.s-green .ico { background: var(--green-soft); color: var(--green); }
.stat.s-blue { border-inline-start-color: var(--blue); background: linear-gradient(120deg, #fff 55%, #eaf2fb); } .stat.s-blue .ico { background: var(--blue-soft); color: var(--blue); }
.stat.s-gold { border-inline-start-color: var(--gold); background: linear-gradient(120deg, #fff 55%, #fbf3e2); } .stat.s-gold .ico { background: var(--gold-soft); color: var(--gold-2); }
.stat.s-purple { border-inline-start-color: var(--purple); background: linear-gradient(120deg, #fff 55%, #f2ecfa); } .stat.s-purple .ico { background: var(--purple-soft); color: var(--purple); }

.module-card { border-radius: var(--radius); color: #fff; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 178px; box-shadow: var(--shadow); }
.module-card .head { display: flex; gap: 14px; align-items: center; }
.module-card .head svg { width: 40px; height: 40px; stroke-width: 1.5; }
.module-card h3 { color: #fff; font-size: 19px; }
.module-card p { margin: 0; opacity: .9; font-size: 14px; }
.module-card .btn { margin-top: auto; background: rgba(255,255,255,.93); color: var(--navy); border: none; }
.m-daily { background: linear-gradient(135deg, #12335f, #1f5d99); }
.m-weekly { background: linear-gradient(135deg, #8f6420, #c49a45); }
.m-alert { background: linear-gradient(135deg, #4d3480, #7a59b5); }
.m-cabinet { background: linear-gradient(135deg, #165638, #2b8b5b); }

.hub-tile { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); color: var(--text); }
.hub-tile:hover { text-decoration: none; border-color: var(--gold); }
.hub-tile .ico { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.hub-tile .ico svg { width: 28px; height: 28px; }
.hub-tile h3 { font-size: 18px; color: var(--navy); margin: 0; }
.hub-tile p { margin: 2px 0 0; color: var(--muted); }
.hub-tile .go { margin-inline-start: auto; width: 34px; height: 34px; border: 1.5px solid var(--gold); color: var(--gold-2); border-radius: 50%; display: grid; place-items: center; }
.c-blue { background: linear-gradient(135deg, #1c4e83, #2b6cb0); } .c-green { background: linear-gradient(135deg, #1d7a48, #2fa364); }
.c-gold { background: linear-gradient(135deg, #a8782c, #d0a856); } .c-purple { background: linear-gradient(135deg, #5a3f91, #7b5cb8); }
.c-navy { background: linear-gradient(135deg, #10284d, #23457c); }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .ico { width: 42px; height: 42px; border-radius: 10px; background: #f0f3f8; display: grid; place-items: center; color: var(--navy-3); }
.list-row .t1 { font-weight: 600; color: var(--navy); }
.list-row .t2 { color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- stepper & editor */
.stepper { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; padding: 4px 14px 4px 4px; border-radius: 999px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #dfe4ec; color: #fff; font-weight: 700; }
.step.on { background: var(--gold-soft); color: var(--navy); font-weight: 700; }
.step.on .n { background: var(--gold-2); }
.step.done .n { background: var(--green); }
.step-line { flex: 1; height: 2px; background: var(--line-2); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr) 300px; gap: 18px; align-items: start; }
.editor-grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); }
.side-col > .card + .card { margin-top: 16px; }
.lang-tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.lang-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 12px 12px 0 0;
  border: 1px solid var(--line); border-bottom: 3px solid transparent; background: #f2f5f9; font-weight: 700; color: var(--navy); cursor: pointer; font-size: 16px; }
.lang-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.lang-tab .ok { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #c7cfdb; color: #fff; font-size: 13px; }
.lang-tab .ok.yes { background: var(--green); }
.lang-pane.hidden { display: none; }
.toolbar { display: flex; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line-2); border-bottom: none; border-radius: 10px 10px 0 0; background: #f7f9fc; flex-wrap: wrap; }
.toolbar button { border: none; background: transparent; border-radius: 6px; min-width: 32px; height: 30px; cursor: pointer; font-weight: 700; color: var(--navy); font-family: inherit; }
.toolbar button:hover { background: #e7ecf3; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.toolbar + textarea { border-radius: 0 0 10px 10px; }
.section-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfdfe; }
.section-block + .section-block { margin-top: 14px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--navy); font-weight: 700; }
.nonews { margin-top: 8px; font-size: 14px; color: var(--muted); }
.autosave { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.autosave.saving { color: var(--amber); } .autosave.saved { color: var(--green); } .autosave.err { color: var(--red); }
.conflict { border: 1px solid #f1c4bf; background: var(--red-soft); color: #8e231c; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }

.action-bar { position: fixed; bottom: 0; inset-inline-start: 264px; inset-inline-end: 0; background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line); padding: 14px 32px; display: flex; gap: 12px; align-items: center; z-index: 20; backdrop-filter: blur(4px); }

/* ---------------------------------------------------------------- WhatsApp-like preview (approximate) */
.preview-card { position: sticky; top: 14px; }
.pv-tabs { display: flex; background: #eef1f6; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.pv-tab { flex: 1; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--navy); border: none; background: none; font: inherit; }
.pv-tab.on { background: var(--navy); color: #fff; }
.wa-wall { background: #efe7dc; border-radius: 12px; padding: 14px 12px; max-height: 640px; overflow-y: auto;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.bubble { background: #dcf8c6; border-radius: 10px 10px 10px 10px; padding: 9px 11px 6px; box-shadow: 0 1px 1px rgba(0,0,0,.08); margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.bubble[dir=rtl] { font-size: 15.5px; }
.bubble .meta { text-align: end; font-size: 11px; color: #6c7b6a; margin-top: 4px; }
.bubble .part { font-size: 11px; color: #5d7259; display: block; margin-bottom: 4px; font-weight: 600; }
.bubble .wa-link { color: #1b6ac9; word-break: break-all; }
.bubble .wa-quote { border-inline-start: 3px solid #7aa36b; padding-inline-start: 6px; display: inline-block; color: #3d5136; }
.bubble code.wa-mono, .bubble code.wa-code { font-family: Consolas, monospace; font-size: 13px; }
.bubble .att { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.55); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.bubble .att img { max-width: 100%; max-height: 180px; border-radius: 6px; display: block; }
.bubble .att .doc { width: 38px; height: 44px; background: #d64541; color: #fff; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.pv-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { padding: 7px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13.5px; }
.issues li.block { background: var(--red-soft); color: #8e231c; }
.issues li.warn { background: var(--amber-soft); color: #7a5506; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--muted); }
.timeline li .c { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c6cdd9; flex: none; }
.timeline li.done { color: var(--navy); font-weight: 600; } .timeline li.done .c { border-color: var(--green); background: var(--green); }
.timeline li.cur { color: var(--amber); font-weight: 600; } .timeline li.cur .c { border-color: var(--amber); }
.timeline .when { margin-inline-start: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.recip { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.recip .r { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.recip .r:last-child { border-bottom: none; }
.att-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.att-row + .att-row { margin-top: 8px; }
.att-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #f0f3f8; font-size: 11px; font-weight: 700; color: var(--navy); }
.optional-panel > summary { cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; gap: 10px; align-items: center; }
.optional-panel > summary::-webkit-details-marker { display: none; }
.optional-panel[open] > summary { margin-bottom: 12px; }
.choice-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.choice-list label { display: flex; gap: 8px; padding: 4px 0; align-items: center; }
.radio-cards { display: grid; gap: 6px; }
.radio-cards label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio-cards input:checked + span { font-weight: 700; color: var(--navy); }
.radio-cards label:has(input:checked) { background: var(--gold-soft); border-color: var(--gold); }

/* ---------------------------------------------------------------- distribution matrix */
.matrix { overflow-x: auto; }
.matrix select { padding: 6px 8px; min-width: 96px; border-radius: 8px; }
.matrix select.v-off { color: var(--muted-2); background: #f6f7fa; }
.matrix select.v-on { color: var(--green); border-color: #a8d8ba; background: var(--green-soft); font-weight: 600; }
.matrix td.client { font-weight: 700; color: var(--navy); background: #f9fafc; }

/* ---------------------------------------------------------------- cabinet */
.post-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.post-item + .post-item { margin-top: 10px; }
.post-item .src { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.post-text { white-space: pre-wrap; max-height: 260px; overflow-y: auto; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs a .count { background: var(--gold); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.integration { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.integration.blocked { background: var(--amber-soft); border-color: #efd9a6; color: #7a5506; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--navy), var(--navy-3)); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset-inline-start: -10%; bottom: -30px; width: 120%; height: 120px; background: linear-gradient(100deg, transparent 30%, rgba(201,162,75,.55) 60%, transparent 75%); transform: rotate(-8deg); }
.auth-side .word-1 { font-size: 44px; font-weight: 800; letter-spacing: .04em; }
.auth-side .word-2 { font-size: 20px; font-weight: 700; letter-spacing: .16em; color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 30px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1360px) { .editor-grid { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); } .editor-grid > .side-col { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; } .editor-grid > .side-col > .card + .card { margin-top: 0; } }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .editor-grid, .editor-grid.two { grid-template-columns: 1fr; } .preview-card { position: static; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .action-bar { inset-inline-start: 0; flex-wrap: wrap; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .content, .topbar { padding-left: 16px; padding-right: 16px; } .topbar { flex-wrap: wrap; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 30px; } .editor-grid > .side-col { grid-template-columns: 1fr; }
  .top-right { flex-wrap: wrap; width: 100%; justify-content: space-between; } .user-chip .who { display: none; }
  .action-bar { position: sticky; } .stepper { flex-wrap: wrap; border-radius: 16px; } .step-line { display: none; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ---------------------------------------------------------------- Phase 3 usability improvements */
/* Comfortable writing: larger type, generous line spacing, Arabic optimised */
textarea { font-size: 17px; line-height: 1.8; }
textarea[dir=rtl], input[dir=rtl] { font-size: 19px; line-height: 1.95; font-family: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif; }
textarea.big { min-height: 260px; } textarea.huge { min-height: 380px; }
textarea.expanded { min-height: 72vh !important; }
.toolbar .spacer { flex: 1; }
.writing-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.writing-tools .btn[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-ai { border-color: #b9a6e0; color: var(--purple); background: var(--purple-soft); }
.btn-ai:hover { background: #e4dbf6; }
.optional-panel > summary .btn { font-weight: 600; }
.flash-target { animation: flash-ring 1.4s ease-out 1; }
@keyframes flash-ring { 0% { box-shadow: 0 0 0 4px rgba(201,162,75,.65); } 100% { box-shadow: var(--shadow); } }
/* Collapsible preview / distribution columns and focus mode */
.editor-grid.no-preview .preview-col, .editor-grid.no-side .side-col { display: none; }
.editor-grid.no-preview { grid-template-columns: minmax(0, 1fr) 300px; }
.editor-grid.no-side { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
.editor-grid.no-preview.no-side { grid-template-columns: minmax(0, 1fr); }
.editor-grid.no-preview.no-side .main-col { max-width: 1100px; margin: 0 auto; width: 100%; }
.editor-grid.focus .main-col textarea.big, .editor-grid.focus .main-col textarea.huge { min-height: 58vh; }
.editor-grid.focus .optional-panel:not([open]) { opacity: .85; }

/* Mobile collapsible navigation */
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .sidebar { padding: 12px 14px; }
  .brand { display: flex; align-items: center; gap: 10px; border-bottom: none; margin-bottom: 0; padding: 0; }
  .brand .word-1 { font-size: 20px; } .brand .word-2 { font-size: 11px; } .brand .tag { display: none; }
  .menu-toggle { display: inline-grid; margin-inline-start: auto; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px; width: 40px; height: 40px; place-items: center; cursor: pointer; }
  .sidebar .nav, .sidebar .sidebar-foot { display: none; }
  .sidebar.open .nav { display: flex; margin-top: 12px; }
  .writing-tools [data-view] { display: none; }
}

/* Distribution matrix at scale: sticky header + first column, filters */
.matrix-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.matrix-tools input[type=search] { max-width: 320px; }
.matrix-tools select { max-width: 240px; }
.matrix.scroll { max-height: 68vh; overflow: auto; }
.matrix.scroll table.t thead th { position: sticky; top: 0; z-index: 3; background: #f6f8fb; }
.matrix.scroll table.t td:first-child, .matrix.scroll table.t th:first-child { position: sticky; inset-inline-start: 0; z-index: 2; background: #fff; min-width: 190px; }
.matrix.scroll table.t thead th:first-child { z-index: 4; background: #f6f8fb; }
.matrix.scroll td.client { position: sticky; inset-inline-start: 0; }
.matrix select { min-width: 104px; }

/* ---------------------------------------------------------------- dispatch (Phase 3) */
.mock-banner { display: flex; gap: 10px; align-items: center; background: #fff4e5; border: 1px dashed #e0a43a; color: #7a4d06;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.st { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-queued, .st-claimed { background: #eef1f5; color: var(--muted); }
.st-submitting { background: var(--blue-soft); color: var(--blue); }
.st-provider_accepted { background: #e7f1ea; color: #2c6b45; }
.st-sent, .st-delivered { background: var(--green-soft); color: var(--green); }
.st-failed_confirmed { background: var(--red-soft); color: var(--red); }
.st-unknown { background: #fff0d6; color: #8a5a00; border: 1px dashed #d79a2b; }
.st-held { background: var(--amber-soft); color: var(--amber); }
.st-canceled { background: #eceff3; color: #7d8597; text-decoration: line-through; }
.st-manually_sent { background: var(--purple-soft); color: var(--purple); }
.count-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.msg-actions details { display: inline-block; }
.msg-actions details[open] { display: block; width: 100%; margin-top: 6px; }
.inline-form { display: grid; gap: 6px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.group-block { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.group-block > .gh { display: flex; gap: 10px; align-items: center; background: #f6f8fb; padding: 10px 14px; font-weight: 700; color: var(--navy); }
.group-block table.t td { font-size: 13.5px; }
.bell { position: relative; }
.bell-dot { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--gold); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
