:root {
  color-scheme: light;
  --navy-950: #000000;
  --navy-900: #000000;
  --navy-800: #00408a;
  --green-700: #00408a;
  --green-600: #03e373;
  --green-500: #1ad678;
  --green-100: #f2faf2;
  --blue-600: #0270e0;
  --amber-600: #c47b10;
  --violet-600: #00408a;
  --red-600: #c24147;
  --ink: #000000;
  --muted: #56635b;
  --line: #d9d9d9;
  --line-soft: #e7eee9;
  --surface: #ffffff;
  --canvas: #f2faf2;
  --shadow: 0 16px 38px rgba(0, 64, 138, 0.09);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(3, 227, 115, 0.13), transparent 29rem),
    var(--canvas);
  font-size: 16px;
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea { resize: vertical; min-height: 88px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(3, 227, 115, 0.2);
}

label {
  display: grid;
  gap: 0.45rem;
  color: #17211b;
  font-size: 0.9rem;
  font-weight: 700;
}

label small { color: var(--muted); font-weight: 400; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.35rem, 2vw, 1.85rem); margin-bottom: 0.2rem; }
h2 { font-size: 1.1rem; margin-bottom: 0; }
h3 { font-size: 1rem; margin-bottom: 0.25rem; }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: var(--navy-900);
}

.loading-screen p { color: var(--muted); }

.loading-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #000;
  background: var(--green-600);
  font-size: 1.7rem;
  font-weight: 800;
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(3, 227, 115, 0.16); } }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(380px, 0.95fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vw, 8rem);
  color: #fff;
  background:
    linear-gradient(140deg, #000 0%, #00408a 74%, #03e373 145%);
}

.auth-brand::before, .auth-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}
.auth-brand::before { width: 480px; height: 480px; left: -180px; top: -220px; }
.auth-brand::after { width: 310px; height: 310px; right: -160px; bottom: -90px; }

.auth-brand h1 { font-size: clamp(2rem, 4vw, 3.5rem); max-width: 620px; margin-bottom: 1rem; }
.auth-brand > div > p:not(.eyebrow) { max-width: 570px; color: rgba(255, 255, 255, 0.76); font-size: 1.05rem; }
.eyebrow { color: #03e373; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.08em; }

.brand-emblem {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green-600);
  box-shadow: 0 10px 24px rgba(3, 227, 115, 0.22);
}

.brand-emblem.large { width: 74px; height: 74px; margin-bottom: 2rem; background: rgba(255, 255, 255, 0.13); backdrop-filter: blur(8px); }
.brand-emblem svg { width: 29px; fill: #fff; }
.brand-emblem.large svg { width: 43px; }
.brand-emblem .emblem-line { fill: none; stroke: #000; stroke-width: 2.8; stroke-linecap: round; }

.auth-feature-list { display: grid; gap: 1rem; margin-top: 3rem; max-width: 540px; }
.auth-feature-list > div { display: flex; align-items: center; gap: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.auth-feature-list span { color: #03e373; font-size: 0.78rem; font-weight: 800; }
.auth-feature-list p { margin: 0; color: rgba(255, 255, 255, 0.76); }
.auth-feature-list strong { color: #fff; }

.auth-panel { display: grid; place-items: center; padding: 2rem; background: #f2faf2; }
.auth-card { width: min(100%, 440px); display: grid; gap: 1.15rem; padding: clamp(1.6rem, 4vw, 2.7rem); border-radius: 26px; background: #fff; box-shadow: var(--shadow); border: 1px solid #d9d9d9; }
.auth-card h2 { font-size: 1.6rem; }
.step-label, .section-label { color: var(--green-700); font-size: 0.76rem; font-weight: 800; }
.muted { color: var(--muted); }

.primary-button, .secondary-button, .text-button, .icon-button, .close-button {
  border: 0;
  border-radius: 11px;
  min-height: 42px;
  padding: 0.62rem 1rem;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.primary-button { color: #03e373; background: #000; box-shadow: 0 8px 18px rgba(0, 64, 138, 0.16); }
.primary-button:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 11px 24px rgba(0, 64, 138, 0.25); }
.secondary-button { color: #000; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #03e373, #00408a) border-box; border: 1.5px solid transparent; }
.secondary-button:hover { background: linear-gradient(#f2faf2, #f2faf2) padding-box, linear-gradient(90deg, #03e373, #00408a) border-box; }
.text-button { color: var(--green-700); background: transparent; padding-inline: 0.4rem; }
.text-button:hover { background: var(--green-100); }
.wide { width: 100%; }
.icon-button { background: #fff; color: var(--navy-900); border: 1px solid var(--line); }
.close-button { min-width: 42px; padding: 0; font-size: 1.6rem; color: var(--muted); background: #f2f5f5; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1rem;
  color: #fff;
  background: linear-gradient(180deg, #000 0%, #001d3f 64%, #00408a 130%);
}

.sidebar-brand { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.6rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand strong { display: block; font-size: 0.98rem; }
.sidebar-brand small { display: block; max-width: 165px; margin-top: 0.12rem; color: rgba(255,255,255,.56); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-nav { display: grid; gap: 0.35rem; padding-block: 1.5rem; }
.nav-item { position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.78rem 0.8rem; border: 0; border-radius: 11px; color: rgba(255,255,255,.67); background: transparent; text-align: right; font-weight: 700; }
.nav-item > span { width: 24px; text-align: center; color: rgba(255,255,255,.72); font-size: 1.1rem; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(3, 227, 115, .17); box-shadow: inset -3px 0 #03e373; }
.nav-item b { margin-right: auto; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 99px; background: #d99a2b; color: #15252c; font-size: 0.72rem; }

.sidebar-footer { margin-top: auto; display: grid; gap: 0.7rem; }
.sidebar-footer .text-button { color: rgba(255,255,255,.72); }
.sidebar-footer .text-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.mode-card { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem; border-radius: 13px; background: rgba(255,255,255,.07); }
.mode-card strong, .mode-card small { display: block; }
.mode-card small { color: rgba(255,255,255,.55); font-size: .72rem; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: .38rem; border-radius: 50%; background: #03e373; box-shadow: 0 0 0 4px rgba(3,227,115,.15); }

.main-content { min-width: 0; padding: 0 clamp(1rem, 3vw, 2.5rem) 3rem; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 92px; display: flex; align-items: center; gap: 1rem; padding-block: 1.1rem; background: rgba(242,250,242,.9); backdrop-filter: blur(14px); }
.topbar > div:nth-child(2) { min-width: 0; }
.topbar p { margin: 0 0 .1rem; color: var(--green-700); font-size: .76rem; font-weight: 800; }
.topbar-statuses { display: flex; align-items: center; gap: .55rem; margin-right: auto; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 800; border: 1px solid transparent; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.success { color: #00512d; background: #e4fff0; border-color: #97eabb; }
.status-pill.warning { color: #9a650f; background: #fff4dc; border-color: #f0dfb8; }
.status-pill.danger { color: #b53e46; background: #fdebed; border-color: #f2cfd3; }
.status-pill.neutral { color: #526873; background: #edf2f3; border-color: #dce5e7; }

.notice-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; padding: 1rem 1.2rem; border: 1px solid #9cecc0; border-radius: 15px; background: linear-gradient(90deg, #e2fff0, #f2faf2); }
.notice-banner strong { color: var(--green-700); }
.notice-banner p { margin: .15rem 0 0; color: #526c61; font-size: .86rem; }
.notice-banner.warning-banner { border-color: #efd59b; background: linear-gradient(90deg, #fff5dd, #fffaf0); }
.notice-banner.warning-banner strong { color: #8c5b0b; }
.notice-banner.warning-banner p { color: #755e37; }

.view { display: none; animation: fadeIn 180ms ease; }
.view.active-view { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { position: relative; overflow: hidden; min-height: 145px; padding: 1.15rem; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 26px rgba(18,52,61,.055); }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; left: -25px; bottom: -25px; border-radius: 50%; background: currentColor; opacity: .07; }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { font-weight: 800; font-size: .82rem; }
.stat-card strong { display: block; margin: .45rem 0 .2rem; font-size: 2.2rem; line-height: 1; color: currentColor; }
.stat-card small { font-size: .76rem; }
.stat-card.green { color: #00683a; background: #e3fff0; }
.stat-card.blue { color: #fff; background: #00408a; }
.stat-card.amber { color: #000; background: #c4e5ed; }
.stat-card.violet { color: #fff; background: #a3ad9e; }
.stat-card.blue span, .stat-card.blue small, .stat-card.violet span, .stat-card.violet small { color: rgba(255,255,255,.8); }
.stat-card.green span, .stat-card.green small, .stat-card.amber span, .stat-card.amber small { color: #435047; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1rem; margin-top: 1rem; }
.overview-grid.lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 1.25rem; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 26px rgba(18,52,61,.05); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading.compact { margin-bottom: .5rem; }
.quick-panel { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #03e373, #00408a); color: #fff; }
.quick-panel .section-label { color: #000; }
.quick-panel p { color: rgba(255,255,255,.72); }
.quick-panel .primary-button { align-self: flex-start; background: #000; color: #03e373; box-shadow: none; }

.service-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: .8rem; padding: .82rem 0; border-top: 1px solid var(--line-soft); }
.service-row:first-of-type { border-top: 0; }
.service-row strong, .service-row small { display: block; }
.service-row small { color: var(--muted); margin-top: .08rem; }
.service-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; font-weight: 900; }
.service-icon.whatsapp { color: var(--green-700); background: var(--green-100); }
.service-icon.ai { color: #00408a; background: #c4e5ed; font-size: .75rem; }
.mini-badge { display: inline-flex; align-items: center; justify-content: center; padding: .3rem .58rem; border-radius: 99px; color: #526873; background: #eef2f3; font-size: .7rem; font-weight: 800; }
.mini-badge.success { color: #00512d; background: #e4fff0; }
.mini-badge.warning { color: #9a650f; background: #fff2d9; }
.mini-badge.danger { color: #ad3d45; background: #fdebed; }
.mini-badge.official { color: #3456a6; background: #e8efff; }
.separation-note { display: flex; gap: .7rem; margin-top: .8rem; padding: .8rem; border-radius: 12px; background: #f1f7f5; color: #4b6459; font-size: .8rem; }
.separation-note span { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green-600); font-size: .72rem; }
.separation-note p { margin: 0; }

.compact-list { display: grid; }
.compact-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .7rem; padding: .82rem 0; border-top: 1px solid var(--line-soft); }
.compact-item:first-child { border-top: 0; }
.compact-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--green-700); background: var(--green-100); font-weight: 900; }
.compact-item strong, .compact-item small { display: block; }
.compact-item strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .86rem; }
.compact-item small { color: var(--muted); font-size: .72rem; }
.empty-state { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }
.empty-state span { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto .8rem; border-radius: 18px; background: #eef4f2; color: var(--green-700); font-size: 1.4rem; }
.empty-state strong { display: block; color: #38505b; margin-bottom: .2rem; }

.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.view-toolbar p { margin-bottom: .2rem; color: var(--muted); font-size: .8rem; }
.view-toolbar h2 { font-size: 1.45rem; }
.toolbar-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.toolbar-badge { padding: .55rem .75rem; border-radius: 10px; color: var(--green-700); background: var(--green-100); font-size: .76rem; font-weight: 800; }
.filter-row { display: flex; gap: .45rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: .2rem; }
.inquiry-bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -.2rem 0 1rem; padding: .8rem 1rem; border: 1px solid #f1caca; border-radius: 12px; background: #fff7f7; }
.inquiry-bulk-actions[hidden] { display: none; }
.inquiry-bulk-actions p { margin: 0; color: #7b4141; font-size: .78rem; }
.load-more-row { display: flex; justify-content: center; padding: .35rem 0 1rem; }
.knowledge-tools { margin: -.25rem 0 1rem; }
.search-field { display: grid; gap: .35rem; color: var(--muted); font-size: .76rem; font-weight: 800; }
.search-field input { width: min(520px, 100%); }
.knowledge-insights-panel { margin-bottom: 1rem; }
.gap-list { display: grid; gap: .55rem; }
.gap-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .85rem; border: 1px solid var(--line-soft); border-radius: 12px; background: #fbfdfd; }
.gap-item div { min-width: 0; }
.gap-item strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap-item small { color: var(--muted); font-size: .7rem; }
.gap-count { flex: 0 0 auto; padding: .3rem .5rem; border-radius: 999px; color: var(--amber-600); background: rgba(196, 123, 16, .12); font-size: .72rem; font-weight: 900; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 99px; padding: .45rem .8rem; color: var(--muted); background: #fff; font-weight: 700; font-size: .78rem; }
.filter-chip.active { color: #03e373; background: #000; border-color: #000; }
.filter-chip b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-right: .3rem; padding-inline: .3rem; border-radius: 99px; color: #fff; background: var(--red-600); font-size: .65rem; }
.filter-chip.active b { color: var(--red-600); background: #fff; }

.cards-list { display: grid; gap: .75rem; }
.schedule-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(170px, .55fr) auto; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border: 1px solid var(--line-soft); border-radius: 16px; background: #fff; box-shadow: 0 5px 20px rgba(18,52,61,.04); }
.schedule-main { min-width: 0; }
.schedule-main > div:first-child { display: flex; align-items: center; gap: .5rem; margin-bottom: .38rem; }
.schedule-main h3 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.schedule-main p { margin: 0; color: var(--muted); font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-meta strong, .schedule-meta small { display: block; }
.schedule-meta strong { font-size: .8rem; }
.schedule-meta small { color: var(--muted); font-size: .72rem; }
.card-actions { display: flex; gap: .35rem; }
.small-button { min-height: 34px; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f9; color: #465d67; font-size: .74rem; font-weight: 800; }
.small-button:hover { background: #eef4f2; }
.small-button.danger { color: var(--red-600); }

.simulator-panel { margin-bottom: 1rem; border-color: #9cecc0; background: linear-gradient(90deg, #f2faf2, #fff); }
.inline-form { display: flex; align-items: end; gap: .75rem; }
.inline-form label { min-width: 160px; }
.inline-form .grow { flex: 1; }
.inline-form .primary-button { flex: 0 0 auto; }

.inquiries-list { display: grid; gap: .75rem; }
.inquiry-card { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 1rem; padding: 1.1rem; border: 1px solid var(--line-soft); border-radius: 16px; background: #fff; }
.contact-block { display: flex; gap: .7rem; align-items: flex-start; }
.contact-avatar { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--green-700); background: var(--green-100); font-weight: 900; }
.contact-block strong, .contact-block small { display: block; }
.contact-block small { color: var(--muted); font-size: .7rem; word-break: break-all; }
.conversation-snippet { min-width: 0; }
.message-bubble { width: fit-content; max-width: 100%; margin-bottom: .45rem; padding: .65rem .78rem; border-radius: 12px 12px 4px 12px; color: #17211b; background: #f2faf2; font-size: .84rem; }
.reply-bubble { padding-right: .75rem; border-right: 3px solid var(--green-500); color: #3b554a; font-size: .8rem; }
.reply-bubble em { display: block; margin-top: .2rem; color: var(--muted); font-size: .68rem; font-style: normal; }
.inquiry-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }

.knowledge-intro { display: flex; gap: .7rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid #c4e5ed; border-radius: 13px; color: #243f50; background: #eef9fc; font-size: .82rem; }
.knowledge-intro span { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #c4e5ed; color: #00408a; font-weight: 900; }
.knowledge-intro p { margin: 0; }
.knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.knowledge-card { position: relative; padding: 1.1rem; border: 1px solid var(--line-soft); border-radius: 16px; background: #fff; }
.knowledge-card.inactive { opacity: .62; }
.knowledge-card.expired { border-color: #f1d7da; }
.knowledge-suggestions-panel { margin-bottom: 1rem; }
.suggestions-list { display: grid; gap: .75rem; }
.suggestion-card { padding: .9rem; border: 1px solid #efd59b; border-radius: 13px; background: #fffbf2; }
.suggestion-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.suggestion-card > div:first-child small { color: var(--muted); font-size: .7rem; }
.suggestion-card h3 { margin: .7rem 0 .35rem; }
.suggestion-card p { margin: 0; color: #526873; white-space: pre-wrap; }
.suggestion-card .card-actions { margin-top: .8rem; }
.knowledge-card .card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.category-badge { padding: .25rem .5rem; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-size: .68rem; font-weight: 800; }
.knowledge-card h3 { font-size: .95rem; }
.knowledge-card p { margin: .55rem 0; color: #526873; font-size: .82rem; }
.knowledge-card small { color: var(--muted); font-size: .7rem; }
.knowledge-meta { display: flex; flex-wrap: wrap; gap: .35rem .7rem; margin-top: .65rem; padding-top: .55rem; border-top: 1px dashed var(--line-soft); }
.knowledge-meta span { color: var(--muted); font-size: .68rem; }
.link-status-ok { color: var(--green-700) !important; }
.link-status-broken { color: var(--red-600) !important; font-weight: 800; }
.knowledge-source { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; padding-top: .7rem; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .7rem; }
.knowledge-source a { color: #176d8c; font-weight: 800; text-decoration: none; }
.knowledge-source a:hover { text-decoration: underline; }
.knowledge-links { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.knowledge-source a.video-link { color: #b4232c; }
.knowledge-card .card-actions { margin-top: .8rem; }
.knowledge-card.expired .card-actions { padding-top: .75rem; border-top: 1px solid #f3dfe1; flex-wrap: wrap; }
.small-button.primary-action { color: #03e373; background: #000; border-color: #000; }
.small-button.warning-action { color: #8c5b0b; background: #fff7e6; border-color: #efd59b; }
.modal-help { margin: -.25rem 0 .25rem; color: var(--muted); font-size: .82rem; }

.logs-grid { display: grid; gap: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
th, td { padding: .72rem .6rem; border-top: 1px solid var(--line-soft); text-align: right; font-size: .78rem; }
th { color: var(--muted); font-weight: 800; background: #fafcfc; }
.event-list { display: grid; }
.event-item { display: grid; grid-template-columns: 10px 1fr auto; gap: .75rem; align-items: start; padding: .8rem 0; border-top: 1px solid var(--line-soft); }
.event-item:first-child { border-top: 0; }
.event-item > i { width: 8px; height: 8px; margin-top: .5rem; border-radius: 50%; background: #7f9199; }
.event-item.error > i { background: var(--red-600); }
.event-item.warning > i { background: var(--amber-600); }
.event-item.info > i { background: var(--green-600); }
.event-item p { margin: 0; font-size: .8rem; }
.event-item time { color: var(--muted); font-size: .7rem; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 1rem; align-items: start; }
.settings-form { display: grid; gap: 1rem; }
.settings-form hr { width: 100%; border: 0; border-top: 1px solid var(--line-soft); }
.settings-side { display: grid; gap: 1rem; }
.security-form { display: grid; gap: .8rem; }
.connection-card > hr { width: 100%; margin: .15rem 0; border: 0; border-top: 1px solid var(--line-soft); }
.form-grid { display: grid; gap: .8rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#schedule-date-time-fields.weekly-only-time { grid-template-columns: minmax(0, 1fr); }
#schedule-date-time-fields.weekly-only-time #schedule-time-field { grid-column: 1 / -1; }
.message-type-picker { margin: 0; padding: .9rem; border: 1px solid var(--line-soft); border-radius: 14px; background: #fafcfc; }
.message-type-picker legend { padding: 0 .35rem; font-weight: 900; }
.message-type-picker .modal-help { margin: 0 0 .65rem; }
.message-type-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.message-type-choice { cursor: pointer; }
.message-type-choice input { position: absolute; opacity: 0; pointer-events: none; }
.message-type-choice span { min-height: 58px; display: flex; align-items: center; gap: .5rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.message-type-choice b { min-width: 25px; font-size: 1.15rem; text-align: center; }
.message-type-choice strong { font-size: .76rem; }
.message-type-choice input:checked + span { border-color: var(--green-500); background: var(--green-100); box-shadow: 0 0 0 2px rgba(0, 168, 132, .1); }
.message-type-choice input:focus-visible + span { outline: 3px solid rgba(0, 64, 138, .22); outline-offset: 2px; }
.scheduled-message-preview { padding: .8rem .9rem; border: 1px dashed #9ad8c8; border-radius: 12px; background: #f2faf7; }
.scheduled-message-preview > span { display: block; margin-bottom: .45rem; color: var(--green-700); font-size: .72rem; font-weight: 900; }
.scheduled-message-preview pre { margin: 0; color: #263b33; font: inherit; font-size: .82rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; border: 1px solid var(--line-soft); border-radius: 12px; background: #fafcfc; }
.switch-row strong, .switch-row small { display: block; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row > span { flex: 0 0 auto; position: relative; width: 45px; height: 25px; border-radius: 99px; background: #cbd5d9; transition: background .15s; }
.switch-row > span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .15s; }
.switch-row input:checked + span { background: linear-gradient(90deg, #03e373, #00408a); }
.switch-row input:checked + span::after { transform: translateX(-20px); }
.connection-card { display: grid; gap: .75rem; }
.connection-detail { display: flex; justify-content: space-between; gap: 1rem; padding: .62rem 0; border-top: 1px solid var(--line-soft); font-size: .8rem; }
.connection-detail span { color: var(--muted); }
.connection-detail strong { text-align: left; word-break: break-word; }
.connection-error strong { color: var(--red-600); direction: ltr; }
.connection-state-button.is-ready,
.connection-state-button.is-ready:disabled {
  color: #006b59;
  background: #e7f8f1;
  border-color: #9ad8c8;
  cursor: default;
  opacity: 1;
}
.connection-maintenance-button { min-height: 34px; font-size: .74rem; }
.security-note { margin: 0; padding: .75rem; border-radius: 10px; color: #35443b; background: #f2faf2; font-size: .75rem; }
.qr-container { display: grid; justify-items: center; gap: .6rem; padding: 1rem; border-radius: 13px; background: #f4f8f7; text-align: center; }
.qr-container img { width: min(100%, 260px); border-radius: 10px; }
.qr-container p { margin: 0; color: var(--muted); font-size: .75rem; }

.modal { width: min(94vw, 680px); max-height: 90vh; padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 28px 80px rgba(5, 25, 34, .25); }
.small-modal { width: min(94vw, 560px); }
.modal::backdrop { background: rgba(0, 20, 43, .62); backdrop-filter: blur(4px); }
.modal form { display: grid; gap: 1rem; padding: 1.35rem; max-height: 90vh; overflow-y: auto; }
.recovery-code-content { display: grid; gap: 1rem; padding: 1.35rem; }
.recovery-code-box { display: block; padding: 1rem .7rem; border: 1px dashed var(--green-500); border-radius: 12px; color: var(--navy-900); background: var(--green-100); font: 800 clamp(.95rem, 3vw, 1.25rem)/1.5 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; padding-top: .7rem; border-top: 1px solid var(--line-soft); }
.reply-actions { flex-wrap: wrap; }
.reply-actions button { flex: 1 1 150px; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--green-600); }
.weekdays { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; }
.weekdays legend { padding-inline: .35rem; color: var(--muted); font-size: .75rem; font-weight: 800; }
.weekdays label { display: flex; align-items: center; gap: .3rem; padding: .35rem .5rem; border-radius: 8px; background: #f2f6f5; font-size: .72rem; }
.weekdays input { width: 15px; height: 15px; accent-color: var(--green-600); }
.quoted-question { padding: .8rem; border-right: 3px solid var(--green-500); border-radius: 10px; background: #f2f7f5; color: #425b51; font-size: .84rem; }

.toast-region { position: fixed; z-index: 100; left: 1.2rem; bottom: 1.2rem; display: grid; gap: .55rem; width: min(380px, calc(100vw - 2.4rem)); }
.toast { display: block; padding: .85rem 1rem; border-radius: 13px; color: #fff; background: var(--navy-900); box-shadow: 0 16px 36px rgba(5,25,34,.24); animation: toastIn .22s ease; }
.toast.error { background: #8d3038; }
.toast.success { color: #000; background: #03e373; }
.toast.success p { color: rgba(0,0,0,.7); }
.toast strong { display: block; font-size: .84rem; }
.toast p { margin: .1rem 0 0; color: rgba(255,255,255,.75); font-size: .74rem; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.error-text { display: block; margin-top: .35rem; color: var(--red-600); }

.mobile-only { display: none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-card { grid-template-columns: minmax(0, 1fr) auto; }
  .schedule-meta { grid-column: 1 / -1; grid-row: 2; }
  .inquiry-card { grid-template-columns: 180px minmax(0, 1fr); }
  .inquiry-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 300px; padding: 2rem; }
  .auth-brand .brand-emblem, .auth-feature-list { display: none; }
  .auth-brand h1 { font-size: 2rem; }
  .auth-panel { padding: 1rem; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 88vw); transform: translateX(-110%); transition: transform .22s ease; box-shadow: 16px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar-statuses .status-pill { max-width: 150px; }
  .topbar-statuses .status-pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .overview-grid, .overview-grid.lower, .settings-grid { grid-template-columns: 1fr; }
  .inline-form { display: grid; grid-template-columns: 1fr 1fr; }
  .inline-form .grow { grid-column: 1 / -1; }
  .knowledge-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .main-content { padding-inline: .75rem; }
  .topbar { min-height: 78px; }
  .topbar-statuses { gap: .3rem; }
  .topbar-statuses .status-pill { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 0; }
  .topbar-statuses .status-pill i { width: 9px; height: 9px; }
  .notice-banner, .view-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1; }
  .gap-item { align-items: flex-start; }
  .stats-grid { gap: .65rem; }
  .stat-card { min-height: 126px; padding: .9rem; }
  .stat-card strong { font-size: 1.8rem; }
  .panel { padding: 1rem; border-radius: 17px; }
  .schedule-card { grid-template-columns: 1fr; align-items: start; }
  .schedule-meta { grid-column: auto; grid-row: auto; }
  .card-actions { flex-wrap: wrap; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .grow { grid-column: auto; }
  .inquiry-card { grid-template-columns: 1fr; }
  .inquiry-actions { grid-column: auto; align-items: stretch; justify-content: flex-start; }
  .form-grid.two { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* s-w-v2 — منظومة خطوط عربية متعددة الأدوار */
@font-face {
  font-family: "School Text";
  src: url("/fonts/IBM-Plex-Sans-Arabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Text";
  src: url("/fonts/IBM-Plex-Sans-Arabic-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Text";
  src: url("/fonts/IBM-Plex-Sans-Arabic-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Text";
  src: url("/fonts/IBM-Plex-Sans-Arabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Heading";
  src: url("/fonts/Noto-Kufi-Arabic-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Heading";
  src: url("/fonts/Noto-Kufi-Arabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "School Display";
  src: url("/fonts/KSA-Heavy.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-950: #111b21;
  --navy-900: #202c33;
  --navy-800: #2a3942;
  --green-700: #008069;
  --green-600: #00a884;
  --green-500: #25d366;
  --green-100: #e7fce9;
  --blue-600: #027eb5;
  --amber-600: #b76e00;
  --violet-600: #6b5dd3;
  --red-600: #d14343;
  --ink: #111b21;
  --muted: #667781;
  --line: #dfe5e7;
  --line-soft: #edf0f1;
  --surface: #ffffff;
  --canvas: #f0f2f5;
  --chat: #efeae2;
  --outgoing: #d9fdd3;
  --shadow: 0 12px 34px rgba(17, 27, 33, .075);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: "School Display", "Noto Kufi Arabic", Tahoma, sans-serif;
  --font-heading: "School Heading", "Noto Kufi Arabic", Tahoma, sans-serif;
  --font-body: "School Text", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-family: var(--font-body);
}

html { background: var(--canvas); }

body {
  background: var(--canvas);
  font-family: var(--font-body);
  letter-spacing: 0;
}

button, input, textarea, select { font-family: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(0, 168, 132, .22);
  outline-offset: 2px;
}

input, textarea, select {
  border-color: #d8dfe1;
  border-radius: 12px;
  padding: .82rem .95rem;
  background: #fbfcfc;
}

input:hover, textarea:hover, select:hover { border-color: #b8c5c9; }
input:focus, textarea:focus, select:focus {
  border-color: var(--green-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, .12);
}

h1, h2, h3 { font-family: var(--font-heading); letter-spacing: 0; }
h1, h2, h3, strong { letter-spacing: 0; }
h1 { font-size: clamp(1.42rem, 2.2vw, 1.9rem); }
h2 { font-size: 1.08rem; }

.auth-brand h1,
.sidebar-brand strong { font-family: var(--font-display); letter-spacing: 0; }

.stat-card strong,
.view-toolbar h2,
.panel-heading h2,
.topbar h1 { font-family: var(--font-heading); }

.loading-screen { color: var(--ink); background: #f7f9fa; }
.loading-mark {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-600);
  box-shadow: 0 12px 34px rgba(0, 168, 132, .25);
}
@keyframes breathe { 50% { transform: scale(1.055); box-shadow: 0 0 0 12px rgba(37, 211, 102, .12); } }

/* الدخول */
.auth-shell { grid-template-columns: minmax(420px, 1.12fr) minmax(390px, .88fr); background: #f7f9fa; }
.auth-brand {
  min-height: 100vh;
  padding: clamp(3rem, 7vw, 7.5rem);
  background:
    radial-gradient(circle at 20% 18%, rgba(37, 211, 102, .22) 0 2px, transparent 3px) 0 0 / 34px 34px,
    linear-gradient(145deg, #075e54 0%, #004c43 45%, #003b35 100%);
}
.auth-brand::before {
  width: 520px;
  height: 520px;
  left: -210px;
  top: -250px;
  border: 70px solid rgba(255,255,255,.025);
}
.auth-brand::after {
  width: 420px;
  height: 420px;
  right: -230px;
  bottom: -210px;
  border: 58px solid rgba(37,211,102,.08);
}
.auth-brand.auth-brand-image {
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #e8f0f2;
}
.auth-brand.auth-brand-image::before,
.auth-brand.auth-brand-image::after { display: none; }
.auth-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  object-position: center;
}
.auth-brand h1 { max-width: 680px; font-size: clamp(2.25rem, 4.3vw, 4rem); }
.auth-brand > div > p:not(.eyebrow) { color: rgba(255,255,255,.78); font-size: 1.08rem; }
.eyebrow { color: #7df3a5; letter-spacing: .03em; }
.brand-emblem {
  border-radius: 50%;
  background: var(--green-600);
  box-shadow: 0 9px 24px rgba(0, 168, 132, .25);
}
.brand-emblem.large {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: none;
}
.brand-emblem .emblem-line { stroke: #fff; }
.auth-feature-list > div { border-color: rgba(255,255,255,.16); }
.auth-feature-list span { color: #7df3a5; }
.auth-panel { position: relative; background: #f7f9fa; }
.auth-panel::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: 5%;
  left: 8%;
  border-radius: 50%;
  background: rgba(37,211,102,.07);
  filter: blur(1px);
}
.auth-card {
  position: relative;
  width: min(100%, 460px);
  padding: clamp(1.75rem, 4vw, 2.8rem);
  border: 1px solid #e5e9eb;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(17,27,33,.1);
}
.step-label, .section-label { color: var(--green-700); letter-spacing: 0; }

/* الأزرار */
.primary-button, .secondary-button, .text-button, .icon-button, .close-button {
  border-radius: 12px;
  min-height: 44px;
  font-weight: 700;
}
.primary-button {
  color: #fff;
  background: var(--green-600);
  box-shadow: 0 8px 18px rgba(0,128,105,.2);
}
.primary-button:hover { color: #fff; background: var(--green-700); box-shadow: 0 11px 24px rgba(0,128,105,.24); }
.secondary-button { color: var(--green-700); background: #fff; border: 1px solid #b8d8d1; }
.secondary-button:hover { color: #006b59; background: #f0fbf8; border-color: #8ec8bc; }
.text-button { color: var(--green-700); }
.text-button:hover { background: #e9f7f4; }
.icon-button { width: 44px; padding: 0; background: #fff; }
.icon-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.close-button { border-radius: 50%; }

/* هيكل لوحة الإدارة */
.app-shell { grid-template-columns: 286px minmax(0, 1fr); }
.sidebar {
  padding: 1.15rem 1rem;
  color: var(--ink);
  background: rgba(255,255,255,.97);
  border-left: 1px solid #e4e8ea;
  box-shadow: -7px 0 24px rgba(17,27,33,.035);
}
.sidebar-brand { padding: .55rem .55rem 1.25rem; border-bottom-color: #edf0f1; }
.sidebar-brand strong { font-size: 1rem; color: var(--ink); }
.sidebar-brand small { color: var(--muted); }
.main-nav { gap: .3rem; padding-block: 1.2rem; }
.nav-item {
  min-height: 48px;
  gap: .8rem;
  padding: .7rem .82rem;
  border-radius: 12px;
  color: #53636b;
  font-weight: 700;
}
.nav-item > span { width: 28px; color: #667781; }
.nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: var(--ink); background: #f3f6f6; }
.nav-item.active {
  color: #006b59;
  background: #e6f8f3;
  box-shadow: inset -3px 0 var(--green-600);
}
.nav-item.active > span { color: var(--green-600); }
.nav-item b { color: #fff; background: #d14343; }
.mode-card { border: 1px solid #e6ecec; background: #f7f9f9; }
.mode-card strong { color: var(--ink); }
.mode-card small { color: var(--muted); }
.sidebar-footer .text-button { color: #667781; }
.sidebar-footer .text-button:hover { color: #d14343; background: #fff1f1; }
.status-dot { background: var(--green-500); box-shadow: 0 0 0 4px rgba(37,211,102,.13); }

.main-content { padding: 0 clamp(1rem, 3vw, 2.4rem) 3rem; }
.topbar {
  min-height: 88px;
  margin-bottom: .35rem;
  padding-block: 1rem;
  background: rgba(240,242,245,.9);
  border-bottom: 1px solid rgba(223,229,231,.6);
}
.topbar p { color: var(--green-700); }
.status-pill { min-height: 34px; padding: .42rem .72rem; border-color: transparent; }
.status-pill.success { color: #006b59; background: #dff8ec; border-color: #b4ead6; }
.status-pill.neutral { color: #53636b; background: #fff; border-color: #dfe5e7; }
.status-pill.warning { color: #8a5900; background: #fff3d5; border-color: #efdbac; }
.status-pill.danger { color: #a52f35; background: #ffebec; border-color: #f1c7ca; }

.notice-banner { border-color: #b7e5d9; background: #eaf8f4; }
.notice-banner strong { color: #006b59; }
.notice-banner p { color: #587068; }

/* البطاقات والبيانات */
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.stat-card {
  min-height: 132px;
  padding: 1.05rem 1.15rem;
  border-color: #e4e9ea;
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(17,27,33,.045);
  color: var(--ink) !important;
  background: #fff !important;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--card-accent, var(--green-600));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--card-accent, var(--green-600)) 14%, transparent);
}
.stat-card::after { display: none; }
.stat-card.green { --card-accent: #00a884; }
.stat-card.blue { --card-accent: #027eb5; }
.stat-card.amber { --card-accent: #e29a14; }
.stat-card.violet { --card-accent: #7064d8; }
.stat-card span, .stat-card small, .stat-card.blue span, .stat-card.blue small, .stat-card.violet span, .stat-card.violet small { color: var(--muted); }
.stat-card strong { margin: .55rem 0 .25rem; color: var(--ink); font-size: 2.05rem; }
.panel {
  border-color: #e4e9ea;
  border-radius: 18px;
  box-shadow: 0 6px 22px rgba(17,27,33,.045);
}
.quick-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #075e54, #008069);
}
.quick-panel::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: -60px;
  bottom: -100px;
  border-radius: 50%;
  border: 30px solid rgba(37,211,102,.13);
}
.quick-panel .section-label { color: #8ff5b1; }
.quick-panel p { color: rgba(255,255,255,.76); }
.quick-panel .primary-button { z-index: 1; color: #075e54; background: #fff; }
.service-icon { border-radius: 50%; }
.service-icon.whatsapp { color: #006b59; background: #dff8ec; }
.service-icon.ai { color: #4d45a7; background: #eeecff; }
.separation-note { background: #edf8f5; }
.separation-note span { background: var(--green-600); }
.compact-avatar, .contact-avatar { border-radius: 50%; color: #006b59; background: #dff8ec; }
.empty-state span { border-radius: 50%; color: #008069; background: #e8f5f2; }

.filter-chip { min-height: 38px; border-color: #d7dfe1; background: #fff; }
.filter-chip:hover { color: #006b59; border-color: #9ccfc4; }
.filter-chip.active { color: #fff; background: var(--green-700); border-color: var(--green-700); }
.toolbar-badge { color: #006b59; background: #dff8ec; }

.schedule-card, .knowledge-card {
  border-color: #e2e8e9;
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(17,27,33,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.schedule-card:hover, .knowledge-card:hover { transform: translateY(-1px); border-color: #c9d6d8; box-shadow: 0 9px 24px rgba(17,27,33,.07); }
.small-button { border-color: #d8dfe1; border-radius: 9px; background: #fff; }
.small-button:hover { color: #006b59; background: #edf8f5; border-color: #a8d5cb; }
.small-button.primary-action { color: #fff; background: var(--green-600); border-color: var(--green-600); }

/* الاستفسارات كمحادثات */
.inquiries-list { gap: .9rem; }
.inquiry-card {
  position: relative;
  overflow: hidden;
  grid-template-columns: 205px minmax(0, 1fr) auto;
  gap: 1.1rem;
  padding: 1rem;
  border-color: #dfe5e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(17,27,33,.045);
}
.conversation-snippet {
  position: relative;
  padding: .85rem;
  border-radius: 14px;
  background-color: var(--chat);
  background-image: radial-gradient(rgba(17,27,33,.035) 1px, transparent 1px);
  background-size: 18px 18px;
}
.message-bubble {
  max-width: 86%;
  margin-left: auto;
  padding: .66rem .82rem;
  border-radius: 10px 10px 3px 10px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(17,27,33,.08);
}
.reply-bubble {
  width: fit-content;
  max-width: 88%;
  margin-right: auto;
  padding: .66rem .82rem;
  border: 0;
  border-radius: 10px 10px 10px 3px;
  color: #263b33;
  background: var(--outgoing);
  box-shadow: 0 1px 1px rgba(17,27,33,.08);
}
.reply-bubble em { color: #55736a; }
.message-link {
  color: #006b59;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.message-link:hover { color: #004f43; text-decoration-thickness: 2px; }
.message-link:visited { color: #4a5fa8; }
.inquiry-actions { justify-content: center; }
.simulator-panel { border-color: #b8e3da; background: #f0faf7; }

.knowledge-intro { color: #365c53; border-color: #bfe3db; background: #edf8f5; }
.knowledge-intro span { color: #fff; background: var(--green-600); }
.knowledge-suggestions-panel { border-color: #ecd69e; }
.suggestion-card { background: #fffaf0; }
.category-badge { color: #006b59; background: #e3f7f1; }
.knowledge-source a { color: #007c68; }
.switch-row { border-color: #e1e7e8; background: #f8fafa; }
.switch-row input:checked + span { background: var(--green-600); }
.security-note { background: #edf8f5; }
.qr-container { background: #f4f7f7; border: 1px dashed #cdd9db; }

table { border-radius: 12px; overflow: hidden; }
th { background: #f4f7f7; }
.event-item.info > i { background: var(--green-600); }

/* النوافذ والتنبيهات */
.modal { border: 1px solid rgba(255,255,255,.5); border-radius: 20px; box-shadow: 0 28px 90px rgba(17,27,33,.28); }
.modal::backdrop { background: rgba(17,27,33,.64); }
.modal-heading { position: sticky; top: -1.35rem; z-index: 2; padding-top: 1.35rem; background: #fff; }
.recovery-code-box { color: #005c4b; border-color: #6bc7b3; background: #e8f8f4; }
.quoted-question { color: #345a51; border-right-color: var(--green-600); background: #edf8f5; }
.toast { background: #202c33; }
.toast.success { color: #073b31; background: #86efac; }

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .68rem 1rem;
  border: 1px solid #efb4b4;
  border-radius: 10px;
  color: #a52828;
  background: #fff7f7;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.danger-button:hover { color: #fff; background: #bd2f2f; border-color: #bd2f2f; }
.danger-button:disabled { opacity: .55; cursor: wait; }
.group-picker { margin: 0; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; }
.group-picker legend { padding-inline: .35rem; color: var(--ink); font-weight: 800; }
.group-choice-list { display: grid; gap: .55rem; max-height: 300px; overflow: auto; }
.group-choice-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem;
  border: 1px solid #dce7e5;
  border-radius: 11px;
  background: #f8fbfa;
}
.group-choice-item > input { width: 18px; height: 18px; accent-color: var(--green-600); }
.group-choice-item strong { display: block; color: var(--ink); font-size: .82rem; }
.group-choice-item small { color: var(--muted); }
.default-group-toggle { display: flex; align-items: center; gap: .3rem; white-space: nowrap; color: #31645a; font-size: .7rem; }
.default-group-toggle input { width: 16px; height: 16px; accent-color: var(--green-600); }
.connection-change-summary { padding: .8rem; border-radius: 12px; color: #6a4a00; background: #fff7dd; }
.group-review-list { display: grid; gap: .8rem; }
.group-review-card { padding: .9rem; border: 1px solid #dce7e5; border-radius: 13px; background: #f8fbfa; }
.group-review-card h3 { margin: 0 0 .2rem; font-size: .92rem; }
.group-review-card > p { margin: 0 0 .65rem; color: var(--muted); font-size: .74rem; }
.group-review-card .group-choice-list { max-height: 220px; }
.review-resume-row { display: flex; align-items: center; gap: .45rem; margin-top: .65rem; color: #245b51; font-size: .78rem; font-weight: 700; }
.review-resume-row input { width: 17px; height: 17px; accent-color: var(--green-600); }
.review-groups-modal { width: min(760px, calc(100vw - 2rem)); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 270px; padding: 2rem; }
  .auth-brand.auth-brand-image {
    min-height: 0;
    height: auto;
    aspect-ratio: 2048 / 1638;
    padding: 0;
  }
  .auth-cover-image { height: 100%; min-height: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    inset: 0 0 0 auto;
    width: min(300px, 88vw);
    transform: translateX(110%);
    box-shadow: -18px 0 48px rgba(17,27,33,.2);
  }
  .sidebar.open { transform: translateX(0); }
  .inquiry-card { grid-template-columns: 1fr; }
  .contact-block { align-items: center; }
  .inquiry-actions { grid-column: auto; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .main-content { padding-inline: .7rem; }
  .inquiry-bulk-actions { align-items: stretch; flex-direction: column; }
  .inquiry-bulk-actions .danger-button { width: 100%; }
  .topbar { min-height: 76px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 118px; padding: .9rem; }
  .stat-card strong { font-size: 1.72rem; }
  .panel, .inquiry-card { border-radius: 15px; }
  .conversation-snippet { padding: .65rem; }
  .message-bubble, .reply-bubble { max-width: 94%; }
  .modal {
    width: 100vw;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .modal form, .recovery-code-content { padding: 1.1rem; }
  .modal-heading { top: -1.1rem; padding-top: 1.1rem; }
  .message-type-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 410px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 108px; }
}
