/* ProPilotZone — AI Commerce OS · black & gold aviation theme (RTL) */
:root {
  --bg: #0a0a0c; --bg-2: #0f0f12; --surface: #141417; --surface-2: #1b1b1f; --raise: #222227;
  --line: #2b2822; --line-soft: #211f1b;
  --gold: #d6a945; --gold-2: #f1cf7a; --gold-deep: #9c7623; --gold-soft: rgba(214, 169, 69, .12);
  --text: #ece7dc; --text-2: #c9c2b4; --muted: #8f897c;
  --ok: #3ccf8e; --ok-soft: rgba(60, 207, 142, .12); --warn: #f0b23c; --warn-soft: rgba(240, 178, 60, .13);
  --bad: #ff5d52; --bad-soft: rgba(255, 93, 82, .13); --info: #6aa8ff; --info-soft: rgba(106, 168, 255, .12);
  --radius: 14px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  --gold-border: linear-gradient(140deg, rgba(241,207,122,.55), rgba(156,118,35,.15) 40%, rgba(156,118,35,.08) 60%, rgba(241,207,122,.35));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
::selection { background: var(--gold); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2c2a25; border-radius: 10px; border: 2px solid var(--bg); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.4em; }
a { color: var(--gold-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.gold-text { color: var(--gold); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Login ───────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 70% 0%, rgba(214,169,69,.25), transparent 55%), radial-gradient(ellipse at 10% 100%, rgba(214,169,69,.12), transparent 50%), var(--bg); }
.login-card { background: var(--surface); padding: 32px; border-radius: 18px; width: 100%; max-width: 400px; display: grid; gap: 14px; text-align: center; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.login-card label { text-align: right; }
.login-logo { width: 190px; margin: 0 auto 4px; display: block; border-radius: 8px; }

/* ───────── Layout ───────── */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0d0d10, #09090b); border-left: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
nav { padding: 16px 10px 6px; }
.nav-group { margin: 14px 0 4px; padding: 0 12px; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 14px; border: 1px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.03); color: var(--text); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(214,169,69,.05), rgba(214,169,69,.22)); border-color: rgba(214,169,69,.45); box-shadow: inset -3px 0 0 var(--gold); }
.nav-item.active svg.i { color: var(--gold); }
.nav-item .lbl { flex: 1; }
.nav-badge { background: var(--bad); color: #fff; border-radius: 6px; padding: 0 7px; font-size: 11.5px; font-weight: 700; }
.side-channels { padding: 4px 10px 8px; border-top: 1px solid var(--line-soft); margin-top: 8px; }
.side-channels .nav-item { padding: 6px 12px; font-size: 13.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.side-card { margin: 10px 14px; padding: 14px; border-radius: 12px; border: 1px solid rgba(214,169,69,.35); background: radial-gradient(ellipse at 0% 100%, rgba(214,169,69,.18), transparent 70%), var(--surface); }
.side-card b { color: var(--gold); display: block; font-size: 15px; line-height: 1.4; }
.side-card small { color: var(--muted); }
.side-foot { padding: 12px 16px 16px; display: grid; gap: 8px; font-size: 12px; margin-top: auto; }
.kill-on { background: var(--bad); color: #fff; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: rgba(10,10,12,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 18px; }
.top-search { flex: 1; max-width: 440px; margin-inline-start: auto; position: relative; }
.top-search input { padding-inline-start: 38px; background: var(--surface); border-color: var(--line); border-radius: 12px; height: 40px; }
.top-search svg { position: absolute; inset-inline-start: 12px; top: 10px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bell { position: relative; color: var(--text-2); text-decoration: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.bell .cnt { position: absolute; top: -4px; inset-inline-end: -4px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 0 5px; min-width: 18px; text-align: center; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #111; background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); border: 2px solid rgba(255,255,255,.12); }
.me-name b { display: block; font-size: 14px; } .me-name small { color: var(--muted); font-size: 11.5px; }
.view { padding: 20px 24px 40px; }
.menu-btn { display: none; }

/* ───────── Components ───────── */
.btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 7px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: rgba(214,169,69,.5); }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #17130a; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: transparent; border-color: var(--gold); color: var(--gold-2); }
.btn.danger { color: var(--bad); border-color: rgba(255,93,82,.35); background: transparent; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--gold-2); cursor: pointer; padding: 0; font: inherit; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: var(--bg-2); color: var(--text); width: 100%; }
input::placeholder, textarea::placeholder { color: #6f6a60; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[type=checkbox] { accent-color: var(--gold); }
select option { background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.card { background: linear-gradient(180deg, var(--surface), #111114); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.card.gold-edge { border-color: rgba(214,169,69,.35); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-h h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-h h3 svg.i { color: var(--gold); width: 22px; height: 22px; }
.card-h .more { color: var(--gold-2); text-decoration: none; font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center; }
.card-b { padding: 14px 18px; }
.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)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12.5px; } .stat .v { font-size: 26px; font-weight: 700; color: var(--text); }
.stat.alert .v { color: var(--bad); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; background: rgba(255,255,255,.06); color: var(--text-2); white-space: nowrap; border: 1px solid rgba(255,255,255,.06); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; } .pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; } .pill.gold { background: var(--gold-soft); color: var(--gold-2); border-color: rgba(214,169,69,.3); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12.5px; background: rgba(255,255,255,.02); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: rgba(214,169,69,.05); }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-2); border-color: var(--gold); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--info-soft); color: #a9c9ff; font-size: 13px; border: 1px solid rgba(106,168,255,.2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(240,178,60,.25); } .notice.bad { background: var(--bad-soft); color: #ff8b82; border-color: rgba(255,93,82,.25); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.seg button.active { background: var(--gold-soft); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold); border-radius: 9px; }

/* ───────── Home dashboard ───────── */
.hero { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid rgba(214,169,69,.35); margin-bottom: 16px; background: #000; width: 100%; height: clamp(260px, 25vw, 400px); }
.hero picture, .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-img { object-fit: cover; object-position: center 40%; display: block; }
/* Text sits on the dark tarmac at the bottom, centered between the logo and the jet */
.hero-text { position: absolute; inset: auto 0 0 0; padding: 60px 28px 18px; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.55) 45%, rgba(0,0,0,.85)); }
.hero h1 { font-size: 28px; line-height: 1.25; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.hero h1 span { color: var(--gold-2); }
.hero p.sub { margin: 4px 0 10px; font-size: 15px; color: var(--text-2); text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.hero-tags { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--text-2); }
.hero-tags span { display: inline-flex; gap: 6px; align-items: center; } .hero-tags svg { color: var(--gold); width: 18px; height: 18px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px; display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; min-height: 120px; }
.kpi-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--gold-2); border: 1px solid rgba(214,169,69,.45); background: radial-gradient(circle at 30% 30%, rgba(214,169,69,.3), rgba(214,169,69,.06)); }
.kpi-ico svg { width: 26px; height: 26px; }
.kpi .k { color: var(--text-2); font-size: 13.5px; }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.kpi .ch { font-size: 12.5px; font-weight: 600; } .ch.up { color: var(--ok); } .ch.down { color: var(--bad); } .ch.flat { color: var(--muted); }
.kpi .note { color: var(--muted); font-size: 11.5px; }
.kpi .spark { grid-column: 1 / -1; height: 34px; margin-top: -6px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-col { display: grid; gap: 16px; }
.channels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ch-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); display: grid; gap: 6px; }
.ch-tile:hover { border-color: rgba(214,169,69,.5); }
.ch-tile .top { display: flex; justify-content: space-between; align-items: center; }
.ch-tile .n { font-size: 22px; font-weight: 700; }
.ch-tile .new { color: var(--bad); font-size: 12px; font-weight: 600; } .ch-tile .new.none { color: var(--muted); font-weight: 400; }
.ch-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.ch-logo svg { width: 22px; height: 22px; stroke: #fff; }
.ch-whatsapp { background: #25d366; } .ch-messenger { background: linear-gradient(135deg, #00b2ff, #a033ff); } .ch-instagram { background: linear-gradient(45deg, #f9a825, #e91e63, #7b1fa2); } .ch-webchat { background: #3b4a7a; } .ch-email { background: #556070; }
.ch-tile .nm { font-weight: 600; font-size: 13.5px; } .ch-tile .st { font-size: 11.5px; }
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.p-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.p-img { aspect-ratio: 16 / 10; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a2620, #121214 70%); }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img svg { width: 56px; height: 56px; color: var(--gold); stroke-width: 1.3; }
.p-badge { position: absolute; top: 8px; inset-inline-end: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11.5px; padding: 2px 9px; border-radius: 20px; display: inline-flex; gap: 5px; align-items: center; }
.p-body { padding: 10px 12px; display: grid; gap: 2px; flex: 1; }
.p-body .nm { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.p-body .sku { color: var(--muted); font-size: 11.5px; }
.p-foot { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; padding: 0 12px 12px; gap: 6px; }
.p-price s { display: block; }
.p-price { font-size: 18px; font-weight: 700; color: var(--gold-2); } .p-price s { color: var(--muted); font-size: 12px; font-weight: 400; }
.p-stock { font-size: 12px; color: var(--muted); } .p-stock b { color: var(--ok); } .p-stock b.low { color: var(--warn); } .p-stock b.bad { color: var(--bad); }
.assistant { display: grid; gap: 12px; }
.assistant .chat { min-height: 210px; max-height: 300px; overflow-y: auto; padding: 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(circle at 70% 30%, rgba(214,169,69,.08), transparent 60%), #0d0d10; border: 1px solid var(--line-soft); }
.bubble { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .t { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.bubble.c { align-self: flex-start; background: #24242a; border: 1px solid #2f2f36; }
.bubble.a { align-self: flex-end; background: #1a1712; border: 1px solid rgba(214,169,69,.3); }
.bubble.h { align-self: flex-end; background: #13221a; border: 1px solid rgba(60,207,142,.3); }
.online { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ok); border: 1px solid rgba(60,207,142,.35); border-radius: 20px; padding: 1px 10px; background: var(--ok-soft); }
.online.off { color: var(--bad); border-color: rgba(255,93,82,.35); background: var(--bad-soft); }
.ask { display: flex; gap: 8px; }
.ask input { height: 44px; }
.ask .send { width: 52px; height: 44px; border-radius: 10px; border: 0; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #17130a; cursor: pointer; display: grid; place-items: center; }
.bi { display: grid; grid-template-columns: 170px minmax(0, 1fr) 250px; gap: 16px; align-items: center; }
.bi .big { font-size: 30px; font-weight: 700; } .bi .lbl { color: var(--text-2); font-size: 13px; }
.chart svg { width: 100%; height: 170px; display: block; }
.donut-wrap { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.legend { display: grid; gap: 4px; font-size: 12.5px; } .legend div { display: flex; gap: 8px; align-items: center; } .legend b { margin-inline-start: auto; font-weight: 600; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.profile .ph { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: #111; background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); border: 3px solid rgba(214,169,69,.4); }
.profile .nm { font-size: 17px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.mini-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mini-stats small { color: var(--muted); font-size: 11px; display: block; } .mini-stats b { font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.kill-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ───────── Inbox ───────── */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 310px; height: calc(100vh - 65px); margin: -20px -24px -40px; }
.inbox-list { border-left: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.inbox-filters { padding: 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 20px; padding: 2px 11px; font-size: 12px; cursor: pointer; font-family: inherit; }
.chip.active { background: var(--gold-soft); color: var(--gold-2); border-color: var(--gold); }
.conv-items { overflow-y: auto; flex: 1; }
.conv-item { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); cursor: pointer; display: grid; gap: 3px; }
.conv-item:hover { background: rgba(255,255,255,.02); } .conv-item.active { background: rgba(214,169,69,.09); }
.conv-item.urgent { box-shadow: inset -3px 0 0 var(--bad); }
.conv-item .top { display: flex; justify-content: space-between; gap: 6px; }
.conv-item .name { font-weight: 600; } .conv-item .time { color: var(--muted); font-size: 11.5px; }
.conv-item .last { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-height: 0; background: radial-gradient(circle at 50% 0%, rgba(214,169,69,.05), transparent 50%), var(--bg); }
.thread-h { padding: 10px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thread-h select { width: auto; max-width: 220px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg.in { align-self: flex-start; background: #202026; border: 1px solid #2c2c33; border-top-right-radius: 4px; }
.msg.out { align-self: flex-end; background: #1b1812; border: 1px solid rgba(214,169,69,.35); border-top-left-radius: 4px; }
.msg.out.human { background: #12211a; border-color: rgba(60,207,142,.35); }
.msg.out.system { background: #191a20; border-color: #33343d; }
.msg.internal { align-self: center; background: var(--gold-soft); color: var(--gold-2); font-size: 12.5px; max-width: 85%; border: 1px dashed rgba(214,169,69,.45); }
.composer { padding: 10px; background: var(--bg-2); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.composer textarea { min-height: 60px; }
.side-panel { background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; display: grid; gap: 16px; align-content: start; }
.side-panel h4 { font-size: 13px; color: var(--gold); margin-bottom: 6px; }
.copilot-box { background: var(--gold-soft); border: 1px solid rgba(214,169,69,.35); border-radius: 10px; padding: 10px; font-size: 13px; display: grid; gap: 6px; }

.cond { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; margin-bottom: 6px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto; padding: 22px; position: relative; }
.modal-close { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 20px; background: var(--surface-2); border: 1px solid var(--gold); color: var(--text); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
.toast.bad { border-color: var(--bad); }
.form { display: grid; gap: 12px; }
.prompt-text { white-space: pre-wrap; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); padding: 10px; border-radius: 10px; max-height: 260px; overflow: auto; }
.menu-back { display: none; }

@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1250px) {
  .home-grid { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 290px minmax(0, 1fr); } .side-panel { display: none; }
  .inbox.show-side .side-panel { display: grid; position: fixed; inset: 65px 0 0 auto; width: 320px; z-index: 6; box-shadow: var(--shadow); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 20; transform: translateX(100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; } .menu-back { display: inline-block; }
  .top-search, .me-name { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi { min-height: 0; grid-template-columns: 1fr; padding: 12px; } .kpi-ico { width: 38px; height: 38px; } .kpi .v { font-size: 22px; }
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g2 { grid-template-columns: 1fr; }
  .channels { grid-template-columns: repeat(3, minmax(0, 1fr)); } .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi { grid-template-columns: 1fr; } .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { height: auto; } .hero picture, .hero-img { position: static; height: auto; } .hero-text { position: static; padding: 14px 16px 16px; background: #0b0b0d; } .hero h1 { font-size: 20px; } .hero-tags { gap: 8px 14px; font-size: 12px; }
  .view { padding: 14px 14px 32px; }
  .inbox { grid-template-columns: 1fr; margin: -14px -14px -32px; height: calc(100vh - 61px); }
  .inbox .thread { display: none; } .inbox.has-active .thread { display: flex; } .inbox.has-active .inbox-list { display: none; }
  .msg { max-width: 88%; } .cond { grid-template-columns: 1fr 1fr; } .kv { grid-template-columns: 1fr; }
}

.msg-img { display: block; width: 100%; max-width: 260px; border-radius: 10px; margin-bottom: 6px; background: #111; }

/* canned replies popup */
.composer { position: relative; }
.canned-pop { position: absolute; bottom: calc(100% - 4px); inset-inline: 10px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow); z-index: 4; padding: 4px; }
.canned-item { display: grid; gap: 2px; width: 100%; text-align: start; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.canned-item:hover { background: var(--gold-soft); } .canned-item span:last-child { color: var(--muted); font-size: 12px; }
/* reports */
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 6px; }
.daybars .db { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; }
.daybars .db span { position: absolute; bottom: 0; inset-inline: 0; background: linear-gradient(180deg, var(--gold-2), var(--gold-deep)); border-radius: 3px 3px 0 0; min-height: 2px; }
.daybars .db span.h { background: var(--bad); inset-inline: 25%; opacity: .9; }
i.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-inline: 8px 4px; }
.size-tbl input { padding: 5px 7px; min-width: 70px; }
/* English (LTR) mode */
body.ltr .nav-item.active { box-shadow: inset 3px 0 0 var(--gold); }
body.ltr th, body.ltr td { text-align: left; }
body.ltr .sidebar { border-left: 0; border-right: 1px solid var(--line); }
