:root {
  --emerald: #1cdc8b;
  --emerald-deep: #0fa86b;
  --teal: #06b6d4;
  --navy: #0f1829;
  --navy-soft: #162338;
  --light: #f7f9fd;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: rgba(247, 249, 253, 0.9);
  --text: #0f1829;
  --muted: #6a7d8f;
  --border: rgba(15, 24, 41, 0.1);
  --border-strong: rgba(15, 24, 41, 0.16);
  --focus-ring: rgba(6, 182, 212, 0.34);
  --shadow-soft: 0 10px 24px rgba(15, 24, 41, 0.06);
  --shadow-hover: 0 14px 30px rgba(15, 24, 41, 0.1);
  --gradient-accent: linear-gradient(135deg, rgba(28, 220, 139, 0.9), rgba(6, 182, 212, 0.86));
  --gradient-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.9));
  --success: #14b86f;
  --danger: #ef4444;
  --warning: #facc15;
  --info: #06b6d4;
  --operator-halotel: #fb923c;
  --operator-airtel: #ef4444;
  --operator-yas: #facc15;
  --operator-vodacom: #3b82f6;
}

html.theme-dark,
body.theme-dark {
  --surface: rgba(20, 32, 51, 0.92);
  --surface-strong: #142033;
  --surface-muted: rgba(20, 32, 51, 0.88);
  --text: #e6edf8;
  --muted: #a8bcc7;
  --border: rgba(156, 174, 199, 0.16);
  --border-strong: rgba(156, 174, 199, 0.24);
  --focus-ring: rgba(28, 220, 139, 0.28);
  --shadow-soft: 0 26px 60px rgba(2, 6, 23, 0.34);
  --shadow-hover: 0 30px 70px rgba(2, 6, 23, 0.46);
  --gradient-panel: linear-gradient(180deg, rgba(20, 32, 51, 0.98), rgba(15, 24, 41, 0.96));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fcfdff 0%, var(--light) 100%);
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark {
  background: linear-gradient(180deg, #060d19 0%, #0f1829 100%);
}

body.nav-drawer-open {
  overflow: hidden;
}

body.command-palette-open,
body.detail-drawer-open,
body.mobile-more-open,
body.transfer-confirmation-open,
body.transfer-approval-open {
  overflow: hidden;
}

.surface-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 24, 41, 0.46);
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.command-palette-open .surface-overlay,
body.detail-drawer-open .surface-overlay {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 100;
  width: min(460px, 100vw);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.detail-drawer[hidden],
.surface-overlay[hidden] {
  display: none !important;
}

.detail-drawer-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
  pointer-events: auto;
  background: var(--surface-strong);
  border-left: 1px solid var(--border);
  box-shadow: -28px 0 60px rgba(15, 24, 41, 0.2);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

body.detail-drawer-open .detail-drawer-panel {
  transform: translateX(0);
}

.detail-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.detail-drawer-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.detail-drawer-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.12;
  font-weight: 900;
}

.detail-drawer-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-drawer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-chip,
.detail-copy-all-btn,
.detail-copy-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.detail-chip {
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

.detail-chip[data-tone="halotel"] {
  border-color: rgba(251, 146, 60, 0.32);
  background: rgba(251, 146, 60, 0.12);
  color: #b45309;
}

.detail-chip[data-tone="airtel"] {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.detail-chip[data-tone="yas"] {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.16);
  color: #854d0e;
}

.detail-chip[data-tone="vodacom"] {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.detail-copy-all-btn,
.detail-copy-btn {
  border: 1px solid rgba(6, 182, 212, 0.22);
  background: rgba(6, 182, 212, 0.1);
  color: #0b7e9a;
}

.detail-copy-all-btn {
  padding: 0 14px;
}

.detail-drawer-grid {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}

.detail-field dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-field dd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.45;
}

.detail-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-copy-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
}

body.theme-dark .surface-overlay {
  background: rgba(0, 0, 0, 0.62);
}

body.theme-dark .detail-drawer-panel {
  background: #142033;
  border-left-color: rgba(156, 174, 199, 0.16);
}

body.theme-dark .detail-chip,
body.theme-dark .detail-field {
  border-color: rgba(156, 174, 199, 0.16);
  background: rgba(156, 174, 199, 0.08);
}

body.theme-dark .detail-copy-all-btn,
body.theme-dark .detail-copy-btn {
  border-color: rgba(6, 182, 212, 0.28);
  background: rgba(6, 182, 212, 0.16);
  color: #65d8eb;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 1200;
  transform: translateY(-160%);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

a,
button,
input,
select,
textarea,
summary {
  font: inherit;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  border: 1px solid rgba(15, 24, 41, 0.16);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 -1px 0 rgba(15, 24, 41, 0.08);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.theme-dark kbd {
  border-color: rgba(156, 174, 199, 0.18);
  background: rgba(9, 15, 25, 0.88);
  box-shadow: inset 0 -1px 0 rgba(156, 174, 199, 0.1);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 22px 16px 16px;
  background: rgba(15, 24, 41, 0.97);
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 12px 0 28px rgba(15, 24, 41, 0.12);
  z-index: 20;
}

body.theme-dark .sidebar {
  background: rgba(6, 11, 20, 0.98);
  border-right-color: rgba(156, 174, 199, 0.08);
  box-shadow: 20px 0 60px rgba(2, 6, 23, 0.34);
}

.brand-panel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.nav-toggle-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
}

.nav-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(28, 220, 139, 1), rgba(6, 182, 212, 0.9));
  color: #fff;
  box-shadow: 0 18px 28px rgba(6, 182, 212, 0.2);
}

.logo-wrap svg {
  width: 22px;
  height: 22px;
}

.brand-copy span {
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-copy small {
  display: none;
}

.brand-badge {
  display: none;
}

.sidebar-context {
  padding: 16px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) padding-box,
    linear-gradient(135deg, rgba(28, 220, 139, 0.45), rgba(6, 182, 212, 0.22)) border-box;
  border: 1px solid transparent;
}

.sidebar-context p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.6;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-section-label {
  margin: 10px 10px 4px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item,
.mobile-bottom-nav-item,
.ghost-btn,
.filter-btn,
.page-btn,
.status-retry,
.send-submit,
.settings-tab,
.collapse-btn,
.toggle-switch,
.menu-toggle,
.message-action-btn,
.quick-sender-chip,
.quick-filter-chip,
.switch-btn,
.range-chip {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: none;
}

body.theme-dark .nav-item:hover {
  background: rgba(156, 174, 199, 0.08);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: none;
}

.side-nav-separator {
  height: 1px;
  margin: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
}

body.theme-dark .side-nav-separator {
  background: rgba(156, 174, 199, 0.14);
}

.mobile-bottom-nav {
  display: none;
}

.mobile-more-scrim,
.mobile-more-sheet {
  display: none;
}

.nav-item-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.nav-item-disabled:hover {
  transform: none;
  background: transparent;
}

.nav-badge {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-status-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-status-card strong {
  display: block;
  margin: 0 0 4px;
  color: #fff;
  font-size: 14px;
}

.sidebar-status-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-status-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 6px rgba(28, 220, 139, 0.12);
  flex-shrink: 0;
}

.collapse-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.04);
  align-self: center;
  flex-shrink: 0;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-left: 14px;
  padding-right: 14px;
}

.content {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(247, 249, 253, 0.94);
  border-bottom: 1px solid rgba(15, 24, 41, 0.08);
  backdrop-filter: blur(12px);
}

body.theme-dark .topbar {
  background: rgba(8, 14, 24, 0.84);
  border-bottom-color: rgba(156, 174, 199, 0.1);
}

.topbar-group,
.topbar-actions,
.profile-shell {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.topbar-copy {
  display: grid;
  gap: 4px;
}

.topbar-eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(15, 24, 41, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--navy);
}

body.theme-dark .menu-toggle {
  border-color: rgba(156, 174, 199, 0.12);
  background: rgba(20, 32, 51, 0.88);
  color: var(--text);
}

.topbar-utility {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 24, 41, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.topbar-utility svg {
  width: 18px;
  height: 18px;
}

.topbar-utility-label {
  white-space: nowrap;
}

.topbar-utility-compact {
  width: 44px;
  padding: 0;
  justify-content: center;
}

body.theme-dark .topbar-utility {
  border-color: rgba(156, 174, 199, 0.12);
  background: rgba(20, 32, 51, 0.88);
  color: var(--text);
}

.shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(15, 24, 41, 0.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.theme-dark .shortcut-chip {
  background: rgba(20, 32, 51, 0.88);
  color: var(--muted);
}

.profile-shell {
  padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 24, 41, 0.08);
}

body.theme-dark .profile-shell {
  background: rgba(20, 32, 51, 0.92);
  border-color: rgba(156, 174, 199, 0.12);
}

.profile-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.profile-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-meta strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

body.theme-dark .profile-meta strong {
  color: var(--text);
}

.profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}

.page-wrap {
  padding: 28px 32px 36px;
  position: relative;
  animation: pageFade 0.2s ease both;
}

.page-wrap[aria-busy="true"]::before {
  content: "";
  position: absolute;
  left: 36px;
  right: 36px;
  top: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--teal), var(--emerald));
  background-size: 220% 100%;
  animation: busyBar 1s linear infinite;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-copy {
  max-width: 760px;
}

.page-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.page-copy p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 560px;
}

.page-eyebrow,
.card-kicker,
.label {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-kicker {
  margin-bottom: 10px;
}

.label {
  color: rgba(15, 24, 41, 0.52);
  margin-bottom: 8px;
}

.label .required-indicator {
  color: var(--danger);
  margin-right: 2px;
}

.subtle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.summary-card,
.status-card,
.empty-state {
  background: var(--surface-strong);
  border: 1px solid rgba(15, 24, 41, 0.08);
  border-radius: 24px;
  box-shadow: none;
}

.summary-card {
  padding: 22px 22px 20px;
}

.summary-card h3 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-btn,
.filter-btn,
.page-btn,
.status-retry,
.send-submit {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost-btn,
.page-btn,
.status-retry,
.filter-btn {
  background: var(--surface-strong);
  border-color: rgba(15, 24, 41, 0.1);
  color: var(--navy);
}

.ghost-btn.strong,
.filter-btn.action-primary,
.send-submit {
  box-shadow: none;
}

.action-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #fff;
}

.action-secondary {
  background: var(--surface-strong);
  border-color: rgba(15, 24, 41, 0.1);
  color: var(--navy);
}

.send-submit {
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #fff;
}

.ghost-btn:hover,
.filter-btn:hover,
.page-btn:hover,
.status-retry:hover,
.send-submit:hover,
.settings-tab:hover,
.collapse-btn:hover,
.range-chip:hover,
.message-action-btn:hover,
.switch-btn:hover,
.quick-sender-chip:hover,
.quick-filter-chip:hover,
.nav-item:hover,
.menu-toggle:hover,
.topbar-utility:hover,
.panel-close-btn:hover {
  transform: none;
  box-shadow: none;
}

.ghost-btn svg,
.filter-btn svg,
.send-submit svg,
.page-btn svg,
.status-retry svg {
  width: 18px;
  height: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.status-badge-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.status-badge-success {
  background: rgba(20, 184, 111, 0.12);
  color: #0e8c57;
}

.status-badge-loading {
  background: rgba(6, 182, 212, 0.12);
  color: #0b7e9a;
}

.status-badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #c62828;
}

.status-badge-success .status-badge-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 9px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.status-badge-danger .status-badge-icon::before,
.status-badge-danger .status-badge-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.status-badge-danger .status-badge-icon::before {
  transform: rotate(45deg);
}

.status-badge-danger .status-badge-icon::after {
  transform: rotate(-45deg);
}

.status-badge-loading .status-badge-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.status-card {
  margin-top: 24px;
  padding: 24px 24px 22px;
}

.status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.status-card h4 {
  margin: 18px 0 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-meta {
  color: rgba(15, 24, 41, 0.54);
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.status-pill.active {
  background: rgba(20, 184, 111, 0.14);
  color: #0e8c57;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.14);
  color: #c62828;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.table-pagination {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-info,
.page-current {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pagination-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  user-select: text;
}

.empty-state {
  margin-top: 18px;
  min-height: 300px;
  padding: 26px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: rgba(15, 24, 41, 0.22);
}

.empty-state h5 {
  margin: 14px 0 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 420px;
}

.compact-empty-state {
  min-height: 160px;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
}

.floating-field {
  display: block;
  min-width: 0;
  position: relative;
}

.floating-field-search > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.floating-field > .send-input-wrap,
.floating-field > .messages-field-wrap {
  position: relative;
}

.floating-field input,
.floating-field select,
.messages-field-wrap input {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgba(15, 24, 41, 0.12);
  border-radius: 14px;
  padding: 20px 16px 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--navy);
  font-size: 16px;
  transition: all 0.2s ease;
}

.floating-field-search input {
  padding-left: 44px;
}

body.theme-dark .floating-field input,
body.theme-dark .floating-field select,
body.theme-dark .messages-field-wrap input {
  background: rgba(20, 32, 51, 0.56);
  border-color: rgba(156, 174, 199, 0.16);
  color: var(--text);
}

.floating-field input:focus,
.floating-field select:focus,
.messages-field-wrap input:focus {
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

body.theme-dark .floating-field input:focus,
body.theme-dark .floating-field select:focus,
body.theme-dark .messages-field-wrap input:focus {
  background: rgba(20, 32, 51, 0.92);
}

.floating-label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  transition: all 0.2s ease;
}

.floating-field-search > .floating-label {
  left: 44px;
  max-width: calc(100% - 60px);
}

.floating-field input:focus ~ .floating-label,
.floating-field select:focus ~ .floating-label,
.floating-field input:not(:placeholder-shown) ~ .floating-label,
.floating-field select:not([value=""]) ~ .floating-label {
  top: 8px;
  font-size: 10px;
  color: var(--teal);
}

.helper-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 288px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }

  body.nav-drawer-open .sidebar {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .page-wrap {
    padding: 16px 12px 24px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .topbar {
    padding: 12px 16px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .page-copy h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  button,
  input,
  select,
  textarea {
    min-height: 48px;
  }

  .floating-field input,
  .floating-field select,
  .messages-field-wrap input {
    min-height: 52px;
  }

  .ghost-btn,
  .filter-btn,
  .page-btn,
  .status-retry,
  .send-submit {
    min-height: 48px;
    padding: 0 16px;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions > * {
    width: 100%;
  }

  .topbar-utility:not(.theme-toggle):not([data-install-app]) {
    display: none;
  }

  .profile-shell {
    display: none;
  }

  .panel-close-btn {
    width: 40px;
    height: 40px;
  }

  .mobile-more-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 24, 41, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .mobile-more-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    max-height: min(72vh, 520px);
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(15, 24, 41, 0.1);
    border-bottom: 0;
    background: var(--surface-strong);
    box-shadow: 0 -24px 56px rgba(15, 24, 41, 0.2);
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.24s ease;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-more-toggle:checked ~ .mobile-more-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-toggle:checked ~ .mobile-more-sheet {
    transform: translateY(0);
  }

  .mobile-more-handle {
    width: 44px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(15, 24, 41, 0.18);
  }

  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 14px;
  }

  .mobile-more-head strong {
    color: var(--navy);
    font-size: 18px;
    font-weight: 900;
  }

  .mobile-more-head label {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(15, 24, 41, 0.06);
    color: var(--navy);
  }

  .mobile-more-head svg {
    width: 20px;
    height: 20px;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-more-item {
    display: grid;
    min-height: 88px;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(15, 24, 41, 0.08);
    background: rgba(15, 24, 41, 0.04);
    color: var(--navy);
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-more-item.active {
    border-color: rgba(6, 182, 212, 0.28);
    background: rgba(6, 182, 212, 0.12);
    color: var(--teal);
  }

  .mobile-more-item svg {
    width: 22px;
    height: 22px;
  }

  body.theme-dark .mobile-more-sheet {
    border-color: rgba(156, 174, 199, 0.14);
    background: var(--surface-strong);
  }

  body.theme-dark .mobile-more-handle,
  body.theme-dark .mobile-more-head label,
  body.theme-dark .mobile-more-item {
    background: rgba(156, 174, 199, 0.08);
  }

  body.theme-dark .mobile-more-head strong,
  body.theme-dark .mobile-more-head label,
  body.theme-dark .mobile-more-item {
    color: var(--text);
  }
}

@media (max-width: 480px) {
  .page-wrap {
    padding: 12px 8px 20px;
  }

  .page-header {
    gap: 12px;
  }

  .page-copy h2 {
    font-size: 1.5rem;
  }

  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .topbar-group {
    gap: 8px;
  }

  .floating-field input,
  .floating-field select,
  .messages-field-wrap input {
    padding: 16px 12px 6px;
  }

  .floating-field-search input {
    padding-left: 42px;
  }

  .floating-field-search > svg {
    left: 14px;
  }

  .floating-field-search > .floating-label {
    left: 42px;
    max-width: calc(100% - 56px);
  }

  .mobile-more-grid {
    grid-template-columns: 1fr;
  }

  .mobile-more-item {
    min-height: 58px;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    justify-items: start;
    text-align: left;
  }
}

@keyframes pageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes busyBar {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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