:root {
  --bg: #f4f8f8;
  --surface: #ffffff;
  --surface-2: #f7fafa;
  --border: #e2eaea;
  --text: #17302f;
  --text-2: #4c6463;
  --muted: #6f8584;
  --primary: #0f8b80;
  --primary-ink: #ffffff;
  --primary-soft: #e3f4f2;
  --primary-strong: #0a6e65;
  --blue: #2563c9;
  --blue-soft: #e6eefb;
  --amber: #a15c00;
  --amber-soft: #fdf1dc;
  --green: #187a3f;
  --green-soft: #e3f4e9;
  --red: #b42318;
  --red-soft: #fdeceb;
  --gray-soft: #eef2f2;
  --chat-bg: #eef5f3;
  --bubble-user: #d4f1ea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 48, 47, .06), 0 4px 16px rgba(16, 48, 47, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45;
  color: var(--text); background: var(--bg); display: flex; flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
code { background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.logo, .avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #14a394, #2563c9); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.sim-label {
  font-size: 12px; font-weight: 600; color: var(--primary-strong); background: var(--primary-soft);
  border: 1px solid #bfe5e0; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--primary-ink); background: var(--primary); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.contact-link:hover { background: var(--primary-strong); }
.pane-tabs { display: none; }

/* ---------- Layout ---------- */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 430px 1fr; }
.pane { min-height: 0; min-width: 0; }
.pane-chat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; border-right: 1px solid var(--border); background: linear-gradient(180deg, #eaf5f3, var(--bg));
}
.phone-actions { text-align: center; }
.phone-actions p { margin: 6px 0 0; }

/* ---------- Phone / chat ---------- */
.phone {
  position: relative; width: 100%; max-width: 380px; height: min(760px, calc(100vh - 150px)); min-height: 480px;
  display: flex; flex-direction: column; background: var(--chat-bg); border-radius: 30px; overflow: hidden;
  border: 8px solid #1d2b2a; box-shadow: 0 18px 40px rgba(16, 48, 47, .18);
}
.phone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 110px; height: 18px; background: #1d2b2a; border-radius: 0 0 12px 12px; z-index: 2; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 24px 14px 10px;
  background: var(--primary-strong); color: #fff;
}
.chat-head .avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--primary-strong); }
.chat-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { font-size: 12px; opacity: .85; }
.bot-tag { font-size: 10px; font-weight: 700; letter-spacing: .6px; background: rgba(255,255,255,.18); padding: 2px 6px; border-radius: 4px; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 10px 8px; scroll-behavior: smooth;
  background-color: var(--chat-bg);
  background-image: radial-gradient(rgba(15, 139, 128, .07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.day-sep { text-align: center; margin: 8px 0; }
.day-sep span { font-size: 11px; background: #dcebe8; color: var(--text-2); padding: 3px 10px; border-radius: 8px; }
.sys-msg { margin: 8px auto; max-width: 92%; text-align: center; font-size: 12px; color: var(--amber); background: var(--amber-soft); padding: 6px 10px; border-radius: 8px; }

.msg { display: flex; flex-direction: column; margin: 4px 0; }
.msg-user { align-items: flex-end; }
.msg-bot { align-items: flex-start; }
.bubble {
  max-width: 86%; padding: 7px 10px 6px; border-radius: 10px; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; position: relative;
}
.msg-bot .bubble { background: #fff; border-top-left-radius: 2px; }
.msg-user .bubble { background: var(--bubble-user); border-top-right-radius: 2px; }
.meta { float: right; margin: 6px 0 -2px 10px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ticks { color: var(--blue); letter-spacing: -2px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; max-width: 92%; margin-top: 6px; }
.quick button {
  background: #fff; color: var(--primary-strong); border: 1px solid #bfe5e0; border-radius: 16px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s;
}
.quick button:hover:not(:disabled) { background: var(--primary-soft); }
.quick button:active:not(:disabled) { transform: scale(.97); }
.quick.used button { opacity: .5; cursor: default; }
.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9db3b1; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.chat-input { display: flex; gap: 8px; padding: 8px; background: #e4eeec; }
.chat-input input { flex: 1; border: 0; border-radius: 20px; padding: 10px 14px; background: #fff; outline: none; min-width: 0; }
.chat-input input:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.send:hover { background: var(--primary-strong); }

/* ---------- Admin shell ---------- */
.pane-admin { background: var(--bg); }
.admin { display: grid; grid-template-columns: 220px 1fr; height: 100%; min-height: 0; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 0 10px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.admin-content { overflow-y: auto; padding: 22px 24px 40px; min-width: 0; }

.gw-chip, .gw-big { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.gw-big { font-size: 15px; margin-bottom: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.gw-demo .dot { background: var(--blue); }
.gw-connected .dot { background: #1aa260; box-shadow: 0 0 0 3px rgba(26,162,96,.18); }
.gw-disconnected .dot { background: var(--red); }

/* ---------- Generic UI ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); flex: none; }
.stat-val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 8px 14px;
  border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn-outline { background: var(--surface); border-color: #bfe5e0; color: var(--primary-strong); }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f5c6c2; }
.btn-danger:hover:not(:disabled) { background: #fbdcd9; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; color: var(--primary-strong); font-weight: 600; cursor: pointer; padding: 0; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge-teal { background: var(--primary-soft); color: var(--primary-strong); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-gray { background: var(--gray-soft); color: var(--text-2); }
.qno { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }

.rows { list-style: none; margin: 0; padding: 0; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--border); border-radius: 6px; }
.row-item:last-child { border-bottom: 0; }
.row-item[data-act] { cursor: pointer; }
.row-item[data-act]:hover { background: var(--surface-2); }
.row-item strong, .row-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 18px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: 8px; border: 1px dashed var(--border); }
.empty.small { padding: 10px; font-size: 12.5px; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-2); margin: 10px 0 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); color: #1d3f78; border: 1px solid #cbdaf5; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.kv-lg { gap: 9px 16px; }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.bullets { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); }
.bullets li { margin-bottom: 6px; }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .bar { fill: var(--primary); transition: opacity .15s; }
.chart .hit { fill: transparent; }
.chart .bar-g { cursor: default; outline: none; }
.chart .bar-g.dim .bar { opacity: .35; }
.chart .bar-g:focus-visible .bar { stroke: var(--text); stroke-width: 1.5; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); background: var(--text); color: #fff; font-size: 12px;
  padding: 5px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; z-index: 2;
}

/* ---------- Bookings ---------- */
.call-card { margin-bottom: 14px; padding: 12px 16px; }
.call-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.call-ctrl .inline { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.q-strip { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.q-pill { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { display: flex; align-items: center; gap: 6px; flex: 1 1 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; color: var(--muted); }
.search input { border: 0; outline: none; padding: 8px 0; flex: 1; min-width: 0; background: transparent; color: var(--text); }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
select, input[type="time"], input[type="number"], input:not([type]), input[type="text"], textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; max-width: 100%;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.status-select { padding: 4px 6px; font-size: 12px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfc; }
.table tr.dim td { color: var(--muted); }
.table th.right, .table td.right { text-align: right; }

/* ---------- Schedules ---------- */
.days { display: flex; flex-direction: column; gap: 18px; }
.day-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; color: var(--text-2); }
.sch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.sch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.sch.inactive { background: var(--surface-2); opacity: .8; }
.sch-top { display: flex; justify-content: space-between; gap: 8px; }
.sch-top strong, .sch-top small { display: block; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; }
.sch-meta { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.times { display: flex; flex-wrap: wrap; gap: 4px; }
.time { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.time.full { background: var(--gray-soft); color: var(--muted); text-decoration: line-through; }
.meter { height: 6px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.sch-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Gateway ---------- */
.radio-cards { display: grid; gap: 8px; margin-bottom: 14px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; }
.radio-card.on { border-color: var(--primary); background: var(--primary-soft); }
.radio-card strong, .radio-card small { display: block; }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.log { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; }
.log li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.log-dir { flex: none; width: 56px; font-size: 11px; font-weight: 700; padding: 2px 0; text-align: center; border-radius: 6px; height: fit-content; background: var(--gray-soft); color: var(--text-2); }
.log-in .log-dir { background: var(--blue-soft); color: var(--blue); }
.log-out .log-dir { background: var(--primary-soft); color: var(--primary-strong); }
.log-error .log-dir { background: var(--red-soft); color: var(--red); }
.log-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-summary .kv { margin-bottom: 0; }

/* ---------- Forms & modal ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-error { color: var(--red); font-size: 12.5px; margin: 0; min-height: 1em; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.form .chip { flex-direction: row; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 500; cursor: pointer; }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.preview { background: var(--surface-2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 36, 35, .45); }
.modal-box { position: relative; background: var(--surface); border-radius: 14px; width: min(540px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

.toasts { position: fixed; top: 14px; right: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 28px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.12); border-left: 4px solid var(--primary); font-size: 13px; animation: slide-in .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-success .ic { color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-error .ic { color: var(--red); }
.toast-info { border-left-color: var(--blue); }
.toast-info .ic { color: var(--blue); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Responsif ---------- */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .admin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; overflow-x: auto; }
  .side-title { display: none; }
  .nav { flex-direction: row; }
  .nav-item { white-space: nowrap; width: auto; }
  .side-foot { flex-direction: row; align-items: center; border-top: 0; padding: 0 0 0 8px; margin-left: auto; white-space: nowrap; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { height: auto; min-height: 100%; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .pane-tabs { display: flex; position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
  .pane-tabs button { flex: 1; border: 0; background: none; padding: 12px 8px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
  .pane-tabs button[aria-selected="true"] { color: var(--primary-strong); border-bottom-color: var(--primary); }
  .layout { display: block; }
  body[data-pane="chat"] .pane-admin, body[data-pane="admin"] .pane-chat { display: none; }
  .pane-chat { border-right: 0; padding: 12px 16px; }
  .phone { height: calc(100vh - 210px); min-height: 440px; border-width: 0; border-radius: 16px; }
  .phone-notch { display: none; }
  .chat-head { padding-top: 12px; }
  .admin { height: auto; }
  .sidebar { position: sticky; top: 45px; z-index: 5; }
  .admin-content { padding: 16px; overflow: visible; }
  .form-2, .form-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px; gap: 8px; }
  .stat-ic { display: none; }
  .sim-label { font-size: 11px; }
}
