/* ============================================================
   Orbit Global Informasi - Workspace design system
   Self-contained styles for the authenticated console & admin
   shells. Loaded AFTER portal.css (Tailwind build) and scoped
   under .ws-shell so it never collides with the marketing site.
   ============================================================ */

:root {
  --ws-bg: #f1f5f9;
  --ws-surface: #ffffff;
  --ws-surface-2: #f8fafc;
  --ws-border: #e2e8f0;
  --ws-border-strong: #cbd5e1;
  --ws-text: #0f172a;
  --ws-text-soft: #475569;
  --ws-text-muted: #94a3b8;
  --ws-brand: #11505c;
  --ws-brand-strong: #0c3b44;
  --ws-brand-soft: #e6f4f6;
  --ws-accent: #3aa9b8;
  --ws-rail: #0b1220;
  --ws-rail-soft: #131c2e;
  --ws-rail-text: #cbd5e1;
  --ws-rail-muted: #64748b;
  --ws-success: #15803d;
  --ws-success-bg: #ecfdf5;
  --ws-warning: #b45309;
  --ws-warning-bg: #fffbeb;
  --ws-danger: #b91c1c;
  --ws-danger-bg: #fef2f2;
  --ws-info: #1d4ed8;
  --ws-info-bg: #eff6ff;
  --ws-radius: 16px;
  --ws-radius-sm: 10px;
  --ws-radius-lg: 22px;
  --ws-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --ws-shadow-md: 0 10px 30px -18px rgba(15, 23, 42, .35);
  --ws-shadow-pop: 0 24px 60px -28px rgba(15, 23, 42, .45);
  --ws-sidebar-w: 280px;
}

/* Admin accent variation */
.ws-shell.is-admin {
  --ws-bg: #f7f8fc;
  --ws-brand: #312e81;
  --ws-brand-strong: #1e1b4b;
  --ws-brand-soft: #eef2ff;
  --ws-accent: #6366f1;
  --ws-rail: #10172a;
  --ws-rail-soft: #1e1b4b;
  --ws-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -26px rgba(30, 41, 59, .34);
}

.ws-shell *,
.ws-shell *::before,
.ws-shell *::after { box-sizing: border-box; }

/* hidden must always win, even over grid/flex display rules */
.ws-shell [hidden] { display: none !important; }

.ws-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--ws-sidebar-w) minmax(0, 1fr);
  background: var(--ws-bg);
  color: var(--ws-text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.ws-shell.is-admin {
  background:
    radial-gradient(circle at 24% 0%, rgba(99, 102, 241, .11), transparent 30%),
    radial-gradient(circle at 100% 18%, rgba(17, 80, 92, .08), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, var(--ws-bg) 56%, #fff 100%);
}
.ws-shell.is-admin::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(49, 46, 129, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 46, 129, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 72%);
}

/* ----------------------------------------------------------
   Sidebar
   ---------------------------------------------------------- */
.ws-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ws-rail);
  color: var(--ws-rail-text);
  border-right: 1px solid rgba(255, 255, 255, .06);
  z-index: 60;
}
.ws-shell.is-admin .ws-sidebar {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(99, 102, 241, .36), transparent 31%),
    radial-gradient(circle at 92% 3%, rgba(58, 169, 184, .18), transparent 28%),
    linear-gradient(160deg, #111827 0%, #1e1b4b 54%, #0f172a 100%);
  box-shadow: 16px 0 40px -34px rgba(15, 23, 42, .75);
}
.ws-shell.is-admin .ws-sidebar::after {
  content: "";
  position: absolute;
  inset: 76px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  text-decoration: none;
}
.ws-brand img { width: 52px; height: 44px; object-fit: contain; flex: none; }
.ws-shell.is-admin .ws-brand {
  min-height: 76px;
  padding: 16px 20px;
}
.ws-shell.is-admin .ws-brand img {
  width: auto;
  height: 44px;
  max-width: 58px;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .3));
}
.ws-shell.is-admin .ws-brand-text strong { font-size: 17px; }
.ws-shell.is-admin .ws-brand-text small { font-size: 10px; letter-spacing: .17em; }
.ws-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.ws-brand-text strong { font-size: 18px; font-weight: 750; letter-spacing: 0; white-space: nowrap; }
.ws-brand-text small {
  margin-top: 5px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .18em; color: var(--ws-rail-muted);
  white-space: nowrap;
}

.ws-nav { flex: 1; overflow-y: auto; padding: 14px 12px 18px; }
.ws-nav::-webkit-scrollbar { width: 6px; }
.ws-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 99px; }

.ws-nav-group { margin-top: 16px; }
.ws-nav-group:first-child { margin-top: 0; }
.ws-nav-group-label {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ws-rail-muted);
}

.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 11px;
  color: var(--ws-rail-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.ws-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ws-nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.ws-nav-item.is-active {
  background: linear-gradient(100deg, var(--ws-accent), rgba(58, 169, 184, .55));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(58, 169, 184, .9);
}
.ws-shell.is-admin .ws-nav { padding: 14px 12px 16px; }
.ws-shell.is-admin .ws-nav-group { margin-top: 14px; }
.ws-shell.is-admin .ws-nav-group-label { padding: 5px 12px; font-size: 9.5px; letter-spacing: .13em; }
.ws-shell.is-admin .ws-nav-item { color: rgba(226, 232, 240, .82); padding: 8px 12px; font-size: 13px; }
.ws-shell.is-admin .ws-nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ws-shell.is-admin .ws-nav-item.is-active {
  background: linear-gradient(100deg, #6366f1, rgba(58, 169, 184, .34));
  color: #fff;
  box-shadow: 0 14px 30px -18px rgba(99, 102, 241, .95);
}
.ws-nav-item.is-active svg { opacity: 1; }

.ws-sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 14px;
}
.ws-usercard {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}
.ws-avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--ws-accent), var(--ws-brand-strong));
}
.ws-usercard-text { min-width: 0; line-height: 1.25; }
.ws-usercard-text strong { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-usercard-text span { display: block; font-size: 11px; color: var(--ws-rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----------------------------------------------------------
   Main / topbar
   ---------------------------------------------------------- */
.ws-main { min-width: 0; display: flex; flex-direction: column; }
.ws-shell.is-admin .ws-main { position: relative; z-index: 1; }

.ws-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 76px;
  padding: 16px 28px;
  background: rgba(248, 250, 252, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ws-border);
}
.ws-shell.is-admin .ws-topbar {
  background: rgba(255, 255, 255, .82);
  border-bottom-color: rgba(226, 232, 240, .74);
  box-shadow: 0 18px 44px -42px rgba(15, 23, 42, .48);
}
.ws-topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.ws-burger {
  display: none; flex: none;
  width: 38px; height: 38px;
  border: 1px solid var(--ws-border); border-radius: 10px;
  background: #fff; cursor: pointer; color: var(--ws-text);
  align-items: center; justify-content: center;
}
.ws-burger svg { width: 20px; height: 20px; }
.ws-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ws-text-muted); }
.ws-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.ws-crumb { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 18px; line-height: 1.2; }
.ws-crumb-group { color: var(--ws-text-muted); font-weight: 650; white-space: nowrap; }
.ws-crumb-sep { color: var(--ws-border-strong); }
.ws-crumb-page { color: var(--ws-text); font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-topbar-actions { display: flex; align-items: center; gap: 10px; }

.ws-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  font-size: 12px; font-weight: 600; color: var(--ws-text-soft);
}
.ws-chip .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ws-success); }

.ws-content { padding: 24px 26px 48px; }
.ws-shell.is-admin .ws-content { padding: 28px 30px 56px; }
.ws-content > * + * { margin-top: 18px; }

/* ----------------------------------------------------------
   Page intro
   ---------------------------------------------------------- */
.ws-pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ws-pagehead > div:first-child { flex: 1 1 420px; min-width: 0; }
.ws-pagehead h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.ws-shell.is-admin .ws-pagehead {
  align-items: center;
  padding: 22px 24px;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: var(--ws-radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .76)),
    radial-gradient(circle at 92% 14%, rgba(99, 102, 241, .15), transparent 30%);
  box-shadow: var(--ws-shadow-sm);
}
.ws-shell.is-admin .ws-pagehead h1 { font-size: 22px; font-weight: 750; }
.ws-pagehead p { margin: 4px 0 0; color: var(--ws-text-soft); max-width: 80ch; }
.ws-pagehead-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------
   Cards & panels
   ---------------------------------------------------------- */
.ws-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  box-shadow: var(--ws-shadow-sm);
}
.ws-shell.is-admin .ws-card {
  border-color: rgba(226, 232, 240, .9);
  box-shadow: var(--ws-shadow-sm);
}
.ws-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ws-border);
}
.ws-card-head h2 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.ws-card-head p { font-size: 12.5px; color: var(--ws-text-soft); margin: 3px 0 0; }
.ws-card-body { padding: 20px; }
.ws-card-body > * + * { margin-top: 16px; }

.ws-grid { display: grid; gap: 16px; }
.ws-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ----------------------------------------------------------
   Stat cards
   ---------------------------------------------------------- */
.ws-stat {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  padding: 18px;
  box-shadow: var(--ws-shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
}
.ws-shell.is-admin .ws-stat {
  min-height: 136px;
  border-color: rgba(226, 232, 240, .9);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.9));
}
.ws-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ws-stat-label { font-size: 12px; font-weight: 600; color: var(--ws-text-soft); }
.ws-stat-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--ws-brand-soft); color: var(--ws-brand);
}
.ws-shell.is-admin .ws-stat-icon {
  background: #eef2ff;
  color: var(--ws-accent);
}
.ws-stat-icon svg { width: 18px; height: 18px; }
.ws-stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.ws-stat-hint { font-size: 12px; color: var(--ws-text-muted); }

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.ws-btn:active { transform: translateY(1px); }
.ws-btn svg { width: 16px; height: 16px; }
.ws-btn-primary { background: var(--ws-brand); color: #fff; }
.ws-btn-primary:hover { background: var(--ws-brand-strong); }
.ws-shell.is-admin .ws-btn-primary { background: var(--ws-accent); }
.ws-shell.is-admin .ws-btn-primary:hover { background: #4f46e5; }
.ws-btn-ghost { background: var(--ws-surface); border-color: var(--ws-border); color: var(--ws-text-soft); }
.ws-btn-ghost:hover { background: var(--ws-surface-2); border-color: var(--ws-border-strong); color: var(--ws-text); }
.ws-btn-danger { background: var(--ws-danger); color: #fff; }
.ws-btn-danger:hover { background: #991b1b; }
.ws-btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.ws-btn-block { width: 100%; }
.ws-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Admin login mirrors the customer login rhythm, with an admin accent. */
.admin-auth .form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .18);
}
.admin-auth .btn-primary {
  background: #6366f1;
  border-color: #6366f1;
}
.admin-auth .btn-primary:hover { background: #4f46e5; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.ws-form { display: grid; gap: 18px; }
.ws-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ws-label { font-size: 12.5px; font-weight: 600; color: var(--ws-text); min-height: 17px; }
.ws-hint { font-size: 12px; color: var(--ws-text-muted); margin-top: 2px; }
/* Push the hint to the bottom so neighbouring fields in a grid row stay aligned. */
.ws-field .ws-hint { margin-top: auto; }
.ws-input,
.ws-select,
.ws-textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ws-border-strong);
  border-radius: var(--ws-radius-sm);
  background: #fff;
  font-size: 13.5px;
  color: var(--ws-text);
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ws-input::placeholder, .ws-textarea::placeholder { color: var(--ws-text-muted); }
.ws-input:focus, .ws-select:focus, .ws-textarea:focus {
  outline: none;
  border-color: var(--ws-accent);
  box-shadow: 0 0 0 3px rgba(58, 169, 184, .18);
}
.ws-shell.is-admin .ws-input:focus,
.ws-shell.is-admin .ws-select:focus,
.ws-shell.is-admin .ws-textarea:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }

/* Select: remove native chrome, add custom chevron */
.ws-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 38px; 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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.ws-textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.ws-input[type="color"] { padding: 4px; cursor: pointer; border-radius: var(--ws-radius-sm); overflow: hidden; }
.ws-input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ws-input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.ws-input[type="color"]::-moz-color-swatch { border: none; border-radius: 7px; }

/* File input: hide native button, render a clean custom control */
.ws-input[type="file"] {
  padding: 0; line-height: 40px; cursor: pointer; color: var(--ws-text-soft);
}
.ws-input[type="file"]::-webkit-file-upload-button,
.ws-input[type="file"]::file-selector-button {
  height: 40px; margin: 0 12px 0 0; padding: 0 14px;
  border: none; border-right: 1px solid var(--ws-border);
  background: var(--ws-surface-2); color: var(--ws-text);
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s ease;
}
.ws-input[type="file"]::-webkit-file-upload-button:hover,
.ws-input[type="file"]::file-selector-button:hover { background: var(--ws-brand-soft); color: var(--ws-brand); }

.ws-form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: stretch; }
/* Align the submit button row inside a grid with the inputs (label has min-height). */
.ws-form-grid .ws-field .ws-btn { margin-top: auto; }
.ws-form-grid .ws-field-action { justify-content: flex-end; padding-top: 23px; }
.ws-form-grid .ws-field-action .ws-btn { width: 100%; min-height: 42px; margin-top: 0; }
.ws-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Selectable option cards (e.g. scope picker) */
.ws-option-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.ws-option {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--ws-border-strong); border-radius: var(--ws-radius-sm);
  background: #fff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.ws-option:hover { border-color: var(--ws-accent); }
.ws-option input { position: absolute; opacity: 0; pointer-events: none; }
.ws-option-box {
  width: 18px; height: 18px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--ws-border-strong); border-radius: 6px;
  display: grid; place-items: center; color: #fff; transition: background .15s ease, border-color .15s ease;
}
.ws-option-box svg { width: 12px; height: 12px; opacity: 0; }
.ws-option input:checked ~ .ws-option-box { background: var(--ws-brand); border-color: var(--ws-brand); }
.ws-shell.is-admin .ws-option input:checked ~ .ws-option-box { background: var(--ws-accent); border-color: var(--ws-accent); }
.ws-option input:checked ~ .ws-option-box svg { opacity: 1; }
.ws-option:has(input:checked) { border-color: var(--ws-accent); background: var(--ws-brand-soft); }
.ws-option-text { min-width: 0; line-height: 1.35; }
.ws-option-text strong { display: block; font-size: 13px; font-weight: 600; }
.ws-option-text span { display: block; font-size: 12px; color: var(--ws-text-muted); }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.ws-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ws-table-meta { font-size: 12.5px; color: var(--ws-text-muted); }
.ws-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--ws-border); border-radius: var(--ws-radius-sm); }
.ws-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ws-table thead th {
  text-align: left; padding: 11px 14px;
  background: var(--ws-surface-2);
  border-bottom: 1px solid var(--ws-border);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ws-text-soft); white-space: nowrap;
}
.ws-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--ws-border); color: var(--ws-text); vertical-align: top; }
.ws-table tbody tr:last-child td { border-bottom: none; }
.ws-table tbody tr:hover { background: var(--ws-surface-2); }
.ws-table .ws-cell-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--ws-text-soft); }

/* ----------------------------------------------------------
   Badges / status pills
   ---------------------------------------------------------- */
.ws-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  border: 1px solid transparent;
}
.ws-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.ws-badge-success { background: var(--ws-success-bg); color: var(--ws-success); }
.ws-badge-warning { background: var(--ws-warning-bg); color: var(--ws-warning); }
.ws-badge-danger { background: var(--ws-danger-bg); color: var(--ws-danger); }
.ws-badge-info { background: var(--ws-info-bg); color: var(--ws-info); }
.ws-badge-neutral { background: var(--ws-surface-2); color: var(--ws-text-soft); border-color: var(--ws-border); }
.ws-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ws-copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.ws-copy-row .ws-input { flex: 1; min-width: 0; }
.ws-key-prefix {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border: 1px solid var(--ws-border); border-radius: 8px;
  background: var(--ws-surface-2); cursor: pointer; color: var(--ws-text-soft);
  font-size: 12px; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ws-key-prefix:hover { border-color: var(--ws-accent); color: var(--ws-text); }
.ws-key-prefix svg { width: 14px; height: 14px; opacity: .7; }
.ws-key-prefix.is-copied { border-color: var(--ws-success); color: var(--ws-success); background: var(--ws-success-bg); }
.ws-key-mask { letter-spacing: 1px; opacity: .5; margin-left: 1px; }

/* ----------------------------------------------------------
   Alerts / notices
   ---------------------------------------------------------- */
.ws-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px; border-radius: var(--ws-radius-sm);
  font-size: 13px; border: 1px solid transparent;
}
.ws-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ws-alert-success { background: var(--ws-success-bg); color: var(--ws-success); border-color: rgba(21, 128, 61, .2); }
.ws-alert-danger { background: var(--ws-danger-bg); color: var(--ws-danger); border-color: rgba(185, 28, 28, .2); }
.ws-alert-info { background: var(--ws-info-bg); color: var(--ws-info); border-color: rgba(29, 78, 216, .18); }

.ws-notice {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--ws-border);
  border-left: 3px solid var(--ws-accent);
  border-radius: var(--ws-radius-sm);
  background: var(--ws-surface);
  color: var(--ws-text-soft); font-size: 13px;
}
.ws-notice svg { width: 18px; height: 18px; flex: none; color: var(--ws-accent); margin-top: 1px; }

/* ----------------------------------------------------------
   Empty states
   ---------------------------------------------------------- */
.ws-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px;
  padding: 40px 20px;
  border: 1px dashed var(--ws-border-strong);
  border-radius: var(--ws-radius-sm);
  background: var(--ws-surface-2);
  color: var(--ws-text-muted);
}
.ws-empty svg { width: 30px; height: 30px; color: var(--ws-border-strong); }
.ws-empty strong { color: var(--ws-text-soft); font-size: 14px; }
.ws-empty span { font-size: 12.5px; max-width: 42ch; }

/* ----------------------------------------------------------
   Code & detail blocks
   ---------------------------------------------------------- */
.ws-code {
  display: block;
  background: #0b1220; color: #e2e8f0;
  border-radius: var(--ws-radius-sm);
  padding: 16px 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.ws-kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 1px; background: var(--ws-border); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-sm); overflow: hidden; }
.ws-kv dt { background: var(--ws-surface-2); padding: 9px 13px; font-size: 12px; font-weight: 600; color: var(--ws-text-soft); }
.ws-kv dd { background: #fff; padding: 9px 13px; margin: 0; font-size: 13px; word-break: break-word; }

/* ----------------------------------------------------------
   Steps / checklist
   ---------------------------------------------------------- */
.ws-steps { display: grid; gap: 12px; }
.ws-step {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  background: var(--ws-surface);
}
.ws-step-num {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--ws-brand-soft); color: var(--ws-brand);
}
.ws-step-body { min-width: 0; flex: 1; }
.ws-step-body h3 { font-size: 14px; font-weight: 650; margin: 0 0 3px; }
.ws-step-body p { font-size: 12.5px; color: var(--ws-text-soft); margin: 0 0 9px; }

.ws-dialog { border: none; border-radius: var(--ws-radius); padding: 0; box-shadow: var(--ws-shadow-pop); max-width: 560px; width: calc(100vw - 40px); }
.ws-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.ws-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--ws-border); }
.ws-dialog-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ws-dialog-body { padding: 18px; max-height: 60vh; overflow: auto; }
.ws-dialog-body > * + * { margin-top: 14px; }
.ws-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--ws-border); background: var(--ws-surface-2); }
.ws-dialog-meta { font-size: 12px; color: var(--ws-text-muted); }
.ws-dialog-meta strong { color: var(--ws-text); font-weight: 600; }

/* ----------------------------------------------------------
   Misc utilities
   ---------------------------------------------------------- */
.ws-muted { color: var(--ws-text-muted); }
.ws-soft { color: var(--ws-text-soft); }
.ws-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ws-divider { height: 1px; background: var(--ws-border); border: none; margin: 4px 0; }
.ws-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-row.between { justify-content: space-between; }
.ws-scrim { display: none; }

/* Admin runtime control cards */
.ws-control-list { display: grid; gap: 16px; }
.ws-control-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-sm);
}
.ws-control-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.ws-control-main h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}
.ws-control-main p {
  margin: 4px 0 10px;
  color: var(--ws-text-soft);
}

/* ----------------------------------------------------------
   SDK phone preview (Brand page)
   ---------------------------------------------------------- */
.ws-sdk-stage {
  display: grid; place-items: center;
  padding: 28px 16px;
  border-radius: var(--ws-radius);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(58,169,184,.16), transparent 60%),
    linear-gradient(180deg, #0b1220, #131c2e);
  min-height: 460px;
}
.ws-phone {
  width: 264px; max-width: 100%;
  background: #0f172a;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.06);
}
.ws-phone-screen {
  position: relative;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 440px;
}
.ws-phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 110px; height: 22px; background: #0f172a;
  border-radius: 0 0 14px 14px; z-index: 5;
}
.ws-sdk-header {
  display: flex; align-items: center; gap: 9px;
  padding: 20px 18px 16px;
  color: #fff;
}
.ws-sdk-header .ws-sdk-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
}
.ws-sdk-header strong { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.ws-sdk-header span { display: block; font-size: 10.5px; opacity: .8; }
.ws-sdk-body { flex: 1; padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 16px; background: #f8fafc; }
.ws-sdk-steps { display: flex; gap: 6px; }
.ws-sdk-steps i {
  height: 4px; flex: 1; border-radius: 99px; background: #e2e8f0; display: block;
}
.ws-sdk-steps i.on { background: var(--ws-sdk-accent, #11505c); }
.ws-sdk-title { font-size: 15px; font-weight: 700; color: #0f172a; margin: 2px 0 0; }
.ws-sdk-sub { font-size: 12px; color: #64748b; margin: 2px 0 0; line-height: 1.5; }
.ws-sdk-frame {
  position: relative; margin: 6px auto; width: 150px; height: 188px;
  border-radius: 18px; background: #eef2f6; overflow: hidden;
  display: grid; place-items: center;
}
.ws-sdk-frame svg { width: 70px; height: 70px; color: #94a3b8; }
.ws-sdk-frame::before, .ws-sdk-frame::after,
.ws-sdk-frame i::before, .ws-sdk-frame i::after {
  content: ""; position: absolute; width: 24px; height: 24px;
  border: 3px solid var(--ws-sdk-accent, #11505c); border-radius: 4px;
}
.ws-sdk-frame::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.ws-sdk-frame::after { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.ws-sdk-frame i { position: absolute; inset: 0; pointer-events: none; }
.ws-sdk-frame i::before { bottom: 10px; left: 10px; top: auto; border-right: none; border-top: none; }
.ws-sdk-frame i::after { bottom: 10px; right: 10px; top: auto; border-left: none; border-top: none; }
.ws-sdk-cta {
  margin-top: auto;
  display: block; text-align: center;
  padding: 12px; border-radius: 12px;
  background: var(--ws-sdk-accent, #11505c); color: #fff;
  font-size: 13px; font-weight: 600;
}
.ws-sdk-secure {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10.5px; color: #94a3b8;
}
.ws-sdk-secure svg { width: 13px; height: 13px; }

/* SDK preview device toggle */
.ws-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--ws-surface-2); border: 1px solid var(--ws-border); border-radius: 10px;
}
.ws-seg button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: none; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ws-text-soft); border-radius: 7px;
}
.ws-seg button svg { width: 15px; height: 15px; }
.ws-seg button.is-active { background: #fff; color: var(--ws-brand); box-shadow: var(--ws-shadow-sm); }

/* SDK web browser mockup */
.ws-web {
  width: 100%; max-width: 460px;
  border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: 0 30px 60px -28px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.1);
}
.ws-web-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #e2e8f0; }
.ws-web-dots { display: flex; gap: 5px; }
.ws-web-dots i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; display: block; }
.ws-web-url { flex: 1; background: #fff; border-radius: 7px; padding: 5px 10px; font-size: 11px; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.ws-web-body { padding: 26px; background: #f8fafc; }
.ws-web-modal { max-width: 320px; margin: 0 auto; background: #fff; border-radius: 16px; box-shadow: var(--ws-shadow-md); overflow: hidden; }
.ws-web-modal .ws-sdk-header { padding: 16px 18px; }
.ws-web-modal .ws-sdk-body { background: #fff; }
.ws-hide { display: none !important; }

/* ----------------------------------------------------------
   API Tester
   ---------------------------------------------------------- */
.ws-service-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ws-service {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; cursor: pointer; text-align: left;
  border: 1px solid var(--ws-border-strong); border-radius: var(--ws-radius);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.ws-service:hover { border-color: var(--ws-accent); box-shadow: var(--ws-shadow-sm); }
.ws-service.is-active { border-color: var(--ws-accent); box-shadow: 0 0 0 3px rgba(58,169,184,.16); background: var(--ws-brand-soft); }
.ws-service-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ws-brand-soft); color: var(--ws-brand); }
.ws-service-icon svg { width: 20px; height: 20px; }
.ws-service strong { font-size: 14px; font-weight: 650; }
.ws-service span { font-size: 12.5px; color: var(--ws-text-soft); line-height: 1.4; }

.ws-capture {
  position: relative; width: 100%; max-width: 360px; margin: 0 auto;
  aspect-ratio: 4 / 3; border-radius: var(--ws-radius);
  overflow: hidden; background: #0b1220;
  display: grid; place-items: center;
}
.ws-capture.is-portrait { aspect-ratio: 3 / 4; max-width: 300px; }
.ws-capture video, .ws-capture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-capture-placeholder { color: #64748b; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; padding: 20px; text-align: center; }
.ws-capture-placeholder svg { width: 34px; height: 34px; }
.ws-capture-oval {
  position: absolute; inset: 12% 22%; border: 3px solid rgba(255,255,255,.7);
  border-radius: 50%; pointer-events: none;
}
.ws-capture-scan {
  position: absolute; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ws-accent), transparent);
  animation: wsScan 2.4s ease-in-out infinite;
}
@keyframes wsScan { 0%,100% { top: 16%; } 50% { top: 84%; } }
.ws-capture-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.ws-capture-badge {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(15,23,42,.7); color: #fff;
}
.ws-capture-badge .ws-rec { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: wsBlink 1s steps(2,start) infinite; }
@keyframes wsBlink { 50% { opacity: .2; } }
.ws-prompt {
  text-align: center; font-weight: 650; font-size: 15px; padding: 12px;
  border-radius: var(--ws-radius-sm); background: var(--ws-brand-soft); color: var(--ws-brand);
}
.ws-shot-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .ws-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .ws-shell { grid-template-columns: 1fr; }
  .ws-sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 280px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .ws-shell.nav-open .ws-sidebar { transform: translateX(0); }
  .ws-shell.nav-open .ws-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(15, 23, 42, .5);
  }
  .ws-burger { display: inline-flex; }
  .ws-content { padding: 18px 16px 40px; }
  .ws-topbar { min-height: 68px; padding: 12px 16px; }
  .ws-form-grid .ws-field-action { padding-top: 0; }
}

@media (max-width: 640px) {
  .ws-grid.cols-2, .ws-grid.cols-3, .ws-grid.cols-4 { grid-template-columns: 1fr; }
  .ws-kv { grid-template-columns: 1fr; }
  .ws-kv dt { padding-bottom: 2px; }
  .ws-table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ws-table-stack tbody td { display: flex; justify-content: space-between; gap: 14px; padding: 9px 14px; border: none; }
  .ws-table-stack tbody td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ws-text-muted);
  }
  .ws-table-stack tbody tr { display: block; border-bottom: 1px solid var(--ws-border); padding: 4px 0; }
  .ws-table-stack tbody tr:last-child { border-bottom: none; }
  .ws-table-wrap { border: 1px solid var(--ws-border); }
}
