/* ==========================================================================
   PHP SMS Gateway - Modern Clean SaaS Design System
   White/slate surfaces, no blue sidebars, crisp icons, action-colored buttons,
   equal spacing, aligned compact tables, responsive shell.
   ========================================================================== */

:root {
  /* Brand accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  /* State colors */
  --success: #16a34a;
  --success-hover: #15803d;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;

  --info: #0891b2;
  --info-hover: #0e7490;
  --info-soft: #ecfeff;
  --info-border: #a5f3fc;

  /* Neutrals */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --bg-page: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

  --sidebar-w: 260px;
  --header-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

p { margin: 0 0 12px; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }

code {
  background: var(--slate-100);
  color: var(--slate-800);
  border: 1px solid var(--slate-200);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

pre {
  background: var(--slate-900);
  color: #f1f5f9;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 16px;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==================================================================== Layout */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

/* ============================================================== Content Header */
.content-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.crumb-separator {
  color: var(--slate-400);
  font-size: 12px;
}

.crumb-current {
  font-weight: 600;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
  text-decoration: none;
}
.user-pill:hover {
  background: var(--slate-200);
  text-decoration: none;
  color: var(--text-main);
}

.balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}
.balance-badge:hover {
  background: #dbeafe;
  text-decoration: none;
}
.balance-badge strong { font-weight: 700; }
.balance-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* =================================================================== Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px 16px;
  z-index: 30;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--slate-100);
  margin-bottom: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-role {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--border);
}
.badge-role.client {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Mini balance card in sidebar */
.sidebar-balance-card {
  margin: 0 4px 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-balance-card .balance-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--slate-500);
}
.sidebar-balance-card .balance-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sidebar-balance-card .balance-topup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
}
.sidebar-balance-card .balance-topup:hover {
  text-decoration: underline;
}

/* Sidebar navigation links */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar .group {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-item:hover {
  background: var(--slate-100);
  color: var(--text-main);
  text-decoration: none;
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-item.active .icon {
  color: var(--primary);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--slate-400);
  transition: color 0.15s ease;
}
.nav-item:hover .icon {
  color: var(--slate-700);
}

.nav-admin-item {
  color: #b45309;
}
.nav-admin-item:hover {
  background: var(--warning-soft);
  color: #92400e;
}
.nav-admin-item .icon {
  color: #d97706;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logout-form { margin: 0; }
.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 0;
  color: var(--danger);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.logout-btn:hover {
  background: var(--danger-soft);
  color: var(--danger-hover);
}
.logout-btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--danger);
}

/* =================================================================== Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 15px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
button:hover, .btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
  color: #ffffff;
}
button:active, .btn:active {
  transform: translateY(1px);
}
button:focus-visible, .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Specific button colors based on purpose */
.btn-success, button.success {
  background: var(--success);
}
.btn-success:hover, button.success:hover {
  background: var(--success-hover);
}

.btn-danger, button.danger, .danger {
  background: var(--danger);
}
.btn-danger:hover, button.danger:hover, .danger:hover {
  background: var(--danger-hover);
}

.btn-warning, button.warning {
  background: var(--warning);
  color: #ffffff;
}
.btn-warning:hover, button.warning:hover {
  background: var(--warning-hover);
}

.btn-info {
  background: var(--info);
}
.btn-info:hover {
  background: var(--info-hover);
}

/* Neutral / Secondary */
.btn-light, button.light, .light {
  background: #ffffff;
  color: var(--slate-700);
  border: 1px solid var(--border-strong);
}
.btn-light:hover, button.light:hover, .light:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
  color: var(--text-main);
}

/* Size modifiers — keep every action the same visual scale site-wide */
.btn-sm, button.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
  gap: 5px;
}
.btn-xs, button.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  gap: 4px;
}

/* Text link button */
button.link, .link {
  background: none;
  border: 0;
  color: var(--primary);
  padding: 0;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
}
button.link:hover, .link:hover {
  background: none;
  text-decoration: underline;
  color: var(--primary-hover);
}

/* ===================================================================== Forms */
label {
  display: block;
  margin: 10px 0 5px;
  font-weight: 600;
  font-size: 13px;
  color: var(--slate-700);
}

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--slate-100);
  color: var(--slate-500);
  cursor: not-allowed;
}

input[type=checkbox], input[type=radio] {
  width: auto;
  box-shadow: none;
  cursor: pointer;
}

/* Compact inline input (used in table rows next to .btn-sm) */
.input-xs, input.input-xs {
  width: auto;
  padding: 5px 8px;
  font-size: 12.5px;
  line-height: 1.3;
  border-radius: var(--radius-xs);
}

textarea {
  min-height: 90px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
}

/* Multi-column form layout — removes the tall single-column stack */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
  align-items: start;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid > .full { grid-column: 1 / -1; }
.form-grid label:first-child { margin-top: 10px; }

/* A single form field cell */
.field { min-width: 0; margin-bottom: 2px; }
.field > .hint { margin-top: 4px; }

/* Standard width for a full-page create/edit form card */
.form-card { max-width: 920px; }

/* Consistent form action bar */
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.4;
}

/* ===================================================================== Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.row {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  margin-bottom: 18px;
}
.row > .card { margin-bottom: 0; }
.row > * { min-width: 0; }

/* ===================================================================== Stats */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat .n {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =================================================================== Tables */
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13.5px;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

th {
  background: var(--slate-50);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: 0; }
table tr:hover td { background: #fafcff; }

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table form { margin: 0; }

/* Keep data rows on single lines by default; long texts opt-in via .wrap */
.table-wrap th, .table-wrap td { white-space: nowrap; }
td.wrap, th.wrap {
  white-space: normal;
  word-break: break-word;
  min-width: 200px;
  max-width: 500px;
}

/* Scrollable message cell: keeps rows to a single line, scrolls when long */
.msg-cell {
  display: block;
  width: 280px;
  max-height: 46px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.35;
}

/* ==================================================================== Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-info {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.badge-bad {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.badge-muted {
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--border);
}
.badge-warn {
  background: var(--warning-soft);
  color: #92400e;
  border: 1px solid var(--warning-border);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.prefix-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}
.prefix-chip form { margin: 0; }

/* =================================================================== Flashes */
.flash {
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 13.5px;
  box-shadow: var(--shadow-xs);
}
.flash-success {
  background: var(--success-soft);
  color: #14532d;
  border-color: var(--success-border);
}
.flash-error {
  background: var(--danger-soft);
  color: #7f1d1d;
  border-color: var(--danger-border);
}
.flash-warning {
  background: var(--warning-soft);
  color: #78350f;
  border-color: var(--warning-border);
}
.flash-info {
  background: var(--primary-soft);
  color: #1e3a8a;
  border-color: var(--primary-border);
}

/* =================================================================== Utility */
.muted { color: var(--text-muted); }
.inline { display: inline; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar form { margin: 0; }

.pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.pager a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
}
.pager a:hover {
  background: var(--slate-100);
  border-color: var(--border-strong);
  text-decoration: none;
}
.pager a.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ============================================================== Searchable Select */
.search-select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.search-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-select-btn:hover {
  border-color: var(--slate-400);
  background: #ffffff;
  color: var(--text-main);
}

.search-select-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-select-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.search-select-arrow {
  margin-left: 8px;
  font-size: 10px;
  color: var(--slate-400);
}

.search-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 200px;
}

.search-select-searchbox {
  padding: 8px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
}

.search-select-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #ffffff;
}

.search-select-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.search-select-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.search-select-option {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.1s ease;
}

.search-select-option:hover {
  background: var(--slate-100);
  color: var(--text-main);
}

.search-select-option.is-selected {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ====================================================================== Auth */
.auth-body {
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 34px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  text-align: left;
  font-size: 20px;
  margin-bottom: 20px;
}
.brand-big {
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 4px;
}
.auth-card .foot {
  margin-top: 20px;
  font-size: 13px;
  text-align: center;
  color: var(--text-muted);
}
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.captcha-row img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.captcha-row input { flex: 1; }

/* ================================================================ API docs */
.doc-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.doc-base .doc-base-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.doc-base code { font-size: 13px; font-weight: 600; }
.doc-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.method-badge {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}
.method-get { background: #0ea5e9; }
.method-post { background: #16a34a; }
.doc-endpoint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.doc-sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 0 0 10px;
}
details.doc {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  margin-bottom: 12px;
  background: var(--surface);
}
details.doc > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-weight: 600;
  font-size: 13.5px;
}
details.doc > summary::-webkit-details-marker { display: none; }
details.doc > summary::after {
  content: '\25be';
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11px;
}
details.doc[open] > summary::after { content: '\25b4'; }
details.doc > summary .doc-endpoint { color: var(--text-muted); font-weight: 500; }
details.doc[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.doc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}
.doc-label:first-child { margin-top: 0; }

/* ================================================================ Responsive */
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .content-header { padding: 0 16px; }
  .container { padding: 18px 16px 36px; }
  .row { grid-template-columns: 1fr; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content-header { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .auth-card { padding: 24px; }
}
