/* ==========================================================================
   Jawwib — warm workspace UI
   Cream surfaces, espresso type, teal accent. Human copy, quiet chrome.
   ========================================================================== */

:root {
  --bg: #F6F3EE;
  --bg-tint: #EFEBE3;
  --surface: #FFFFFF;
  --surface-muted: #FAF8F4;
  --ink: #1C1917;
  --ink-soft: #44403C;
  --muted: #78716C;
  --faint: #A8A29E;
  --line: #E8E4DC;
  --line-strong: #D6D0C6;

  --accent: #0F766E;
  --accent-hover: #0D5F59;
  --accent-soft: #D1FAE5;
  --accent-ink: #065F46;

  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --rose: #BE123C;
  --rose-soft: #FFE4E6;
  --sky: #1D4ED8;
  --sky-soft: #DBEAFE;
  --violet: #6D28D9;
  --violet-soft: #EDE9FE;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 16px 40px rgba(28, 25, 23, 0.10);

  --ease: 160ms ease;
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: var(--faint);
  --text-main: var(--ink);
  --border: var(--line);
  --border-subtle: var(--line);
  --surface-card: var(--surface);
  --bg-card: var(--surface);
  --danger: var(--rose);
  --green: var(--accent);
  --blue: var(--sky);
  --font-sans: var(--font);
  --font-mono: var(--mono);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .hero-title, .auth-title, .brand-name, .section-title,
.panel-title, .stat-number, .kpi-val, .metric-value {
  font-family: var(--display);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.monospace, code, .font-mono { font-family: var(--mono); }
code {
  background: var(--bg-tint);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.86em;
}

.view-container { position: relative; width: 100%; }

#login-view { display: none; }
#login-view.active { display: flex; }
#dashboard-view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
html.is-authenticated #login-view { display: none !important; }
html.is-authenticated #dashboard-view { display: flex !important; flex-direction: column; }

/* -------------------------------------------------------------------------- */
/* Auth                                                                       */
/* -------------------------------------------------------------------------- */

#login-view {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 20px;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(15, 118, 110, 0.10), transparent 55%),
    var(--bg);
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  animation: fadeUp 360ms ease both;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.auth-header { margin-bottom: 28px; }

.brand-badge { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px; }

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.03em; }
.brand-tag {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-subtitle { font-size: 0.95rem; color: var(--muted); line-height: 1.5; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute;
  left: 12px;
  color: var(--faint);
  display: flex;
  z-index: 1;
  pointer-events: none;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 11px 14px;
  color: var(--ink);
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-input.with-icon { padding-left: 42px; }
.form-input.with-action { padding-right: 42px; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--faint); }
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.form-select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-select option { background: #fff; color: var(--ink); }
.form-select.select-sm, .input-sm { padding: 8px 12px; font-size: 0.84rem; }
.form-select.select-xs { padding: 4px 8px; font-size: 0.75rem; min-width: 132px; }

.input-action-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.input-action-btn:hover { color: var(--ink); }

.form-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-tint); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9F1239; }
.btn-danger-outline {
  background: transparent;
  color: var(--rose);
  border-color: #FECDD3;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--rose-soft); }
.btn-icon-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.btn-icon-ghost:hover { background: var(--bg-tint); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 0.95rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 5px 9px; font-size: 0.75rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.text-danger { color: var(--rose); }

/* -------------------------------------------------------------------------- */
/* App header                                                                 */
/* -------------------------------------------------------------------------- */

.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section { display: flex; align-items: center; gap: 10px; }
.brand-details { display: flex; flex-direction: column; }
.brand-title-row { display: flex; align-items: center; gap: 8px; }
.version-tag {
  font-size: 0.68rem;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-weight: 600;
}
.brand-sub { font-size: 0.74rem; color: var(--muted); }

.nav-segmented {
  display: flex;
  align-items: center;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.nav-tab:hover { color: var(--ink); background: rgba(255,255,255,0.6); }
.nav-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid;
  background: var(--surface);
}
.status-badge.status-ready { background: var(--accent-soft); color: var(--accent-ink); border-color: #A7F3D0; }
.status-badge.status-starting,
.status-badge.status-idle { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }
.status-badge.status-error,
.status-badge.status-disconnected { background: var(--rose-soft); color: var(--rose); border-color: #FECDD3; }
.status-badge.status-live { background: var(--accent-soft); color: var(--accent-ink); border-color: #A7F3D0; }
.status-pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-starting .status-pulse-dot { animation: pulse 1.4s ease-in-out infinite; }

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

.dashboard-body { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp 240ms ease; }

.hero-card, .panel-card, .content-card, .stat-card, .capability-card, .metric-card, .kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.hero-card { padding: 28px 32px; margin-bottom: 28px; }
.connection-layout { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.connection-info { flex: 1; min-width: 0; }

.pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 650;
}
.hero-card .pill-chip { margin-bottom: 12px; }
.chip-emerald { background: var(--accent-soft); color: var(--accent-ink); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-blue { background: var(--sky-soft); color: var(--sky); }
.chip-purple { background: var(--violet-soft); color: var(--violet); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }

.hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.25;
}
.hero-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.55; max-width: 540px; margin-bottom: 20px; }

.device-spec-grid { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.device-spec-card {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}
.spec-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.spec-value { font-size: 0.88rem; font-weight: 650; color: var(--ink); }
.code-val { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; }

.lifecycle-actions, .session-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.connected-badge-panel, .encrypted-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 26px;
  background: var(--accent-soft);
  border: 1px solid #A7F3D0;
  border-radius: var(--r-lg);
  min-width: 140px;
  text-align: center;
  color: var(--accent-ink);
}
.shield-graphic { color: var(--accent); }
.shield-caption, .encrypted-badge-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qr-steps-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.qr-step-item { display: flex; align-items: center; gap: 12px; }
.step-circle {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text { font-size: 0.9rem; color: var(--ink-soft); }
.qr-action-toolbar { display: flex; gap: 8px; }
.qr-scanner-frame { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-frame-inner {
  position: relative;
  padding: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.qr-corner { position: absolute; width: 14px; height: 14px; border-color: var(--accent); border-style: solid; border-width: 0; }
.qr-corner.top-left { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.qr-corner.top-right { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; }
.qr-corner.bottom-left { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; }
.qr-corner.bottom-right { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }
.qr-canvas-box { width: 196px; height: 196px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; }
.qr-footer-timer { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--muted); }
.refresh-spinner, .loading-spinner-ring {
  display: inline-block;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.refresh-spinner { width: 10px; height: 10px; }
.state-loading { justify-content: center; }
.loading-state-box { text-align: center; padding: 12px 0; width: 100%; }
.loading-spinner-ring { width: 40px; height: 40px; border-width: 3px; margin: 0 auto 16px; }

/* -------------------------------------------------------------------------- */
/* Metrics / services                                                         */
/* -------------------------------------------------------------------------- */

.section-header { margin-bottom: 14px; }
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.section-subtitle { font-size: 0.84rem; color: var(--muted); }

.metrics-grid, .orders-kpi-grid, .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card, .metric-card { padding: 18px 18px 16px; }
.stat-card-header, .metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stat-title, .metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.stat-icon-wrapper, .metric-icon, .kpi-icon-box {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.icon-emerald, .icon-green, .bg-emerald-light { background: var(--accent-soft); color: var(--accent); }
.icon-blue, .bg-blue-light { background: var(--sky-soft); color: var(--sky); }
.icon-indigo, .icon-purple, .bg-purple-light { background: var(--violet-soft); color: var(--violet); }
.icon-amber, .bg-amber-light { background: var(--amber-soft); color: var(--amber); }
.stat-number, .metric-value, .kpi-val {
  font-size: 1.7rem;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1.1;
  display: block;
}
.stat-meta, .metric-desc, .kpi-sub { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }

.capabilities-grid, .services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
.capability-card, .service-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.capability-icon, .service-icon-wrap {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tint); color: var(--accent);
}
.capability-title, .service-name { font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.capability-desc, .service-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tech-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-tint);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* -------------------------------------------------------------------------- */
/* Panels / tables                                                            */
/* -------------------------------------------------------------------------- */

.panel-card, .content-card { padding: 22px; margin-bottom: 18px; }
.panel-header, .content-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.panel-title, .content-card-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.panel-subtitle, .content-card-subtitle { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }

.data-table, .orders-data-table { width: 100%; border-collapse: collapse; }
.data-table th, .orders-data-table th {
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  white-space: nowrap;
}
.data-table td, .orders-data-table td {
  padding: 14px 12px;
  font-size: 0.86rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:hover, .orders-data-table tbody tr:hover { background: var(--surface-muted); }
.orders-table-wrapper { overflow-x: auto; }
.orders-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box-wrap { min-width: 200px; }
.search-box-wrap .form-input { min-width: 200px; }

.order-id, .cell-strong { font-weight: 650; color: var(--ink); }
.cell-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.order-items-cell { max-width: 260px; }
.order-address-cell { max-width: 200px; }
.order-phone-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.order-phone-link:hover { text-decoration: underline; }
.order-charges-badge {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--bg-tint);
  padding: 3px 8px;
  border-radius: 6px;
}

.customer-avatar, .customer-avatar-badge, .contact-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-right: 10px;
}

.badge-pill, .badge, .order-status, .meeting-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 0.71rem;
  font-weight: 650;
}
.badge { background: var(--bg-tint); color: var(--ink-soft); }
.package-features li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}
.badge-counter {
  min-width: 18px; height: 18px; border-radius: var(--r-full);
  background: var(--ink); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.badge-live { background: var(--accent-soft); color: var(--accent-ink); }
.badge-pickup, .status-confirmed, .badge-order-confirmed { background: var(--accent-soft); color: var(--accent-ink); }
.badge-prep, .status-pending, .badge-order-preparing { background: var(--amber-soft); color: var(--amber); }
.badge-delivery, .badge-order-ready { background: var(--sky-soft); color: var(--sky); }
.badge-completed, .badge-order-completed { background: var(--violet-soft); color: var(--violet); }
.badge-cancel, .status-cancelled, .badge-order-cancelled { background: var(--rose-soft); color: var(--rose); }
.chip-blue { background: var(--sky-soft); color: var(--sky); }

/* -------------------------------------------------------------------------- */
/* Campaign studio                                                            */
/* -------------------------------------------------------------------------- */

.campaign-workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}
.studio-step { margin-bottom: 22px; }
.step-badge-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-counter {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-title { font-size: 0.9rem; font-weight: 650; color: var(--ink); }

.dropzone-frame {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-muted);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.dropzone-frame:hover, .dropzone-frame.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone-icon-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.dropzone-main-text { font-size: 0.9rem; color: var(--ink-soft); }
.dropzone-sub-text { font-size: 0.78rem; color: var(--muted); }

.file-preview-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--surface-muted);
}
.preview-card-header { display: flex; align-items: center; justify-content: space-between; }
.file-info-group { display: flex; align-items: center; gap: 10px; }
.file-badge-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.file-name { display: block; font-size: 0.88rem; color: var(--ink); }
.file-status-text { font-size: 0.74rem; color: var(--accent); }
.preview-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.p-stat-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; text-align: center;
}
.p-stat-val { display: block; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.p-stat-lbl { font-size: 0.7rem; color: var(--muted); }

.chips-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chips-title { font-size: 0.75rem; color: var(--muted); }
.chip-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--r-full);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--mono);
}
.chip-pill:hover { border-color: var(--accent); color: var(--accent); }

.pace-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pace-radio-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  background: var(--surface);
}
.pace-radio-card input { display: none; }
.pace-radio-card.active { border-color: var(--accent); background: var(--accent-soft); }
.pace-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.pace-name { font-weight: 700; font-size: 0.88rem; }
.pace-delay { font-size: 0.75rem; color: var(--accent); font-weight: 600; display: block; margin-bottom: 4px; }
.pace-desc { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.studio-footer { margin-top: 8px; }

.monitor-progress-box { margin-bottom: 16px; }
.progress-bar-track, .progress-bar-wrap {
  width: 100%; height: 8px;
  background: var(--bg-tint);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width 0.4s ease; }
.progress-bar-fill.fill-warning { background: #D97706; }
.progress-bar-fill.fill-danger { background: var(--rose); }
.progress-meta-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.78rem; color: var(--muted); }
.progress-pct { font-weight: 700; color: var(--ink); }

.monitor-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.monitor-kpi-grid .kpi-card { padding: 12px; }
.kpi-lbl { font-size: 0.7rem; color: var(--muted); display: block; margin-bottom: 4px; }
.kpi-num { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.kpi-info { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.monitor-control-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.terminal-container {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #1C1917;
  color: #E7E5E4;
}
.terminal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #292524;
  border-bottom: 1px solid #44403C;
}
.terminal-dots { display: flex; gap: 5px; }
.term-dot { width: 8px; height: 8px; border-radius: 50%; }
.term-dot.red { background: #F87171; }
.term-dot.yellow { background: #FBBF24; }
.term-dot.green { background: #34D399; }
.terminal-title { font-size: 0.72rem; color: #A8A29E; font-weight: 600; }
.terminal-live-tag { margin-left: auto; font-size: 0.68rem; color: #6EE7B7; font-weight: 700; }
.terminal-body, .log-area {
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
}
.log-row { margin-bottom: 2px; }
.text-success, .text-emerald { color: #34D399; }
.text-indigo { color: #A5B4FC; }
.text-accent { color: #FBBF24; }
.terminal-body .text-muted { color: #A8A29E; }
.terminal-body .text-danger { color: #FDA4AF; }

.campaign-target-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.campaign-target-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 8px; background: var(--surface-muted); border: 1px solid var(--line); font-size: 0.83rem;
}

/* -------------------------------------------------------------------------- */
/* Meetings                                                                   */
/* -------------------------------------------------------------------------- */

.meetings-grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.meeting-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.meeting-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meeting-date-badge {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 650;
  background: var(--bg-tint); padding: 2px 8px; border-radius: 6px;
}
.meeting-time-tag { font-size: 0.78rem; color: var(--accent); font-weight: 650; }
.meeting-title { font-size: 0.95rem; font-weight: 700; }
.meeting-client-row { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }

.empty-state, .empty-agenda-box { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon-circle, .empty-state-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-tint); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: var(--muted);
}
.empty-title, .empty-state-title { font-size: 0.95rem; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }
.empty-desc, .empty-state-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.5; max-width: 420px; margin: 0 auto; }

/* -------------------------------------------------------------------------- */
/* Alerts / toasts / modals                                                   */
/* -------------------------------------------------------------------------- */

.alert-banner {
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-danger { background: var(--rose-soft); color: var(--rose); border-color: #FECDD3; }
.alert-success { background: var(--accent-soft); color: var(--accent-ink); border-color: #A7F3D0; }
.alert-info { background: var(--sky-soft); color: var(--sky); border-color: #BFDBFE; }
.alert-warning { background: var(--amber-soft); color: var(--amber); border-color: #FDE68A; }

#toast-container, .toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.86rem; font-weight: 600;
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideIn 240ms ease both;
  max-width: 340px;
}
.toast-success { background: var(--accent); }
.toast-error, .toast-danger { background: var(--rose); }
.toast-info { background: var(--ink); }

.modal-overlay, .modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 25, 23, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  animation: fadeIn 160ms ease;
}
.modal-box, .modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-card.modal-lg { max-width: 640px; }
.modal-header { padding: 18px 22px 12px; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-desc { padding: 0 22px 8px; color: var(--muted); font-size: 0.9rem; }
.modal-body { padding: 8px 22px 18px; }
.modal-card form { padding: 0 22px 8px; }
.modal-footer, .modal-actions {
  padding: 12px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-close-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: 6px;
}
.modal-close-btn:hover { background: var(--bg-tint); color: var(--ink); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.radio-pill-group { display: flex; gap: 8px; }
.radio-pill {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--surface);
}
.radio-pill input { display: none; }
.radio-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* Receipt */
.modal-receipt { max-width: 420px; padding: 8px 0 12px; }
.receipt-header-brand { text-align: center; padding: 20px 22px 8px; }
.receipt-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px; font-size: 1.2rem;
}
.receipt-title { font-size: 1.15rem; font-weight: 750; }
.receipt-subtitle { font-size: 0.78rem; color: var(--muted); }
.receipt-badge {
  display: inline-block; margin-top: 8px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 650;
  background: var(--bg-tint); padding: 3px 10px; border-radius: var(--r-full);
}
.receipt-divider { height: 1px; background: var(--line); margin: 12px 22px; }
.receipt-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 22px; }
.meta-label { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.meta-val { font-size: 0.84rem; color: var(--ink); }
.receipt-address-box { margin: 12px 22px 0; background: var(--surface-muted); border-radius: 8px; padding: 10px 12px; }
.receipt-address-text { font-size: 0.84rem; margin-top: 2px; }
.receipt-items-section { padding: 0 22px; }
.receipt-items-title { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.receipt-item-row { display: flex; justify-content: space-between; font-size: 0.86rem; padding: 4px 0; }
.receipt-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 22px; font-weight: 750;
}
.total-val { font-size: 1.1rem; }
.receipt-notes-box { margin: 12px 22px 0; background: var(--amber-soft); border-radius: 8px; padding: 10px; }
.notes-text { font-size: 0.84rem; color: var(--amber); }
.receipt-footer-msg { text-align: center; font-size: 0.8rem; color: var(--muted); padding: 12px 22px 0; }

/* -------------------------------------------------------------------------- */
/* Super-admin                                                                */
/* -------------------------------------------------------------------------- */

.super-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 100;
}
.super-header .header-container { padding: 0; max-width: 1180px; }
.super-brand-tag {
  background: var(--ink);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.super-subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.super-subnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
}
.super-subnav .nav-tab { border-radius: 0; padding: 12px 14px; box-shadow: none; }
.super-subnav .nav-tab.active {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.kpi-card.kpi-featured, .super-mrr-card {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.super-mrr-card .kpi-label, .kpi-featured .kpi-label { color: #A8A29E; }
.super-mrr-card .kpi-val, .kpi-featured .kpi-val { color: #fff; }

.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.package-card { padding: 22px; display: flex; flex-direction: column; position: relative; }
.package-card.featured { border-color: var(--accent); }
.package-badge-popular {
  position: absolute; top: -10px; right: 16px;
  background: var(--accent); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-full);
}
.package-name { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.package-price { font-size: 1.7rem; font-weight: 750; margin: 10px 0 14px; letter-spacing: -0.03em; }
.package-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; flex: 1; }
.package-features li, .package-feature-item {
  font-size: 0.84rem; color: var(--ink-soft);
  display: flex; align-items: flex-start; gap: 8px;
}
.package-ar { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.tenant-name { font-weight: 700; color: var(--ink); }
.tenant-id { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.owner-name { font-size: 0.84rem; font-weight: 650; }
.owner-email, .owner-phone { font-size: 0.75rem; color: var(--muted); }
.owner-phone { color: var(--accent); font-weight: 500; }
.price-hint { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.quota-row { font-size: 0.75rem; font-family: var(--mono); }

/* -------------------------------------------------------------------------- */
/* Footer / mobile nav / utilities                                            */
/* -------------------------------------------------------------------------- */

.app-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 28px;
  font-size: 0.75rem;
  color: var(--muted);
}
.footer-container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.mobile-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 90;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-nav .nav-tab {
  flex-direction: column;
  gap: 2px;
  font-size: 0.68rem;
  padding: 6px 8px;
  color: var(--muted);
  box-shadow: none;
  background: transparent;
}
.mobile-nav .nav-tab.active { color: var(--accent); background: transparent; box-shadow: none; }
.mobile-nav .badge-counter { display: none; }
.mobile-nav .badge-pill { display: none; }

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-align-center { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-md { gap: 12px; }
.gap-sm { gap: 8px; }
.gap-xs { gap: 6px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.py-xl { padding: 40px 0; }
.py-lg { padding: 24px 0; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .metrics-grid, .services-grid, .capabilities-grid, .orders-kpi-grid, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .campaign-workspace { grid-template-columns: 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .pace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-segmented { display: none; }
  .mobile-nav { display: flex; }
  .header-actions .status-badge { display: none; }
  .dashboard-body { padding: 20px 16px 96px; }
  .hero-card { padding: 20px 16px; }
  .connection-layout { flex-direction: column; }
  .auth-card { padding: 28px 20px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .metrics-grid, .capabilities-grid, .orders-kpi-grid, .kpi-grid { grid-template-columns: 1fr; }
  .header-container { padding: 10px 14px; }
  #toast-container { left: 16px; right: 16px; bottom: 84px; }
}
