/* WontelCorp Mobile CSS v4.0 — Dark Blue Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --blue:        #2196F3;
  --blue-mid:    #42A5F5;
  --blue-light:  #90CAF9;
  --blue-pale:   #0D2B4A;
  --white:       #fff;
  --bg:          #091523;
  --card:        #0F2035;
  --card2:       #142840;
  --text:        #E2EDF8;
  --text2:       #6B9BBD;
  --border:      #1A3550;
  --success-bg:  #0A2218;
  --success:     #4CAF50;
  --warn-bg:     #2A1800;
  --warn:        #FFB74D;
  --danger-bg:   #2A0A0A;
  --danger:      #EF5350;
  --shadow:      0 2px 16px rgba(0,0,0,0.45);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.55);
  --radius:      16px;
  --radius-sm:   10px;
  --topbar-h:    56px;
  --tabbar-h:    64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  overflow-x: clip; /* clip instead of hidden — allows children to scroll horizontally */
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + 16px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ============================================================
   PAGE WRAP
   ============================================================ */
.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 16px) 16px 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: linear-gradient(90deg, #0A1E3A 0%, #0D2748 100%);
  color: #fff;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.topbar-brand span {
  font-weight: 400;
  opacity: 0.6;
  font-size: 13px;
  margin-left: 6px;
}

.topbar-profile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(33,150,243,0.2);
  border: 1px solid rgba(33,150,243,0.35);
  color: var(--blue-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background .15s;
}

.topbar-profile:hover {
  background: rgba(33,150,243,0.35);
}

/* ============================================================
   TAB BAR
   ============================================================ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabbar-h);
  background: #0A1E3A;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  transition: color .15s;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.tab-item i {
  font-size: 20px;
  color: var(--text2);
  transition: color .15s;
}

.tab-item.active {
  color: var(--blue-mid);
}

.tab-item.active i {
  color: var(--blue-mid);
}

.tab-item.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--blue-mid);
  border-radius: 50%;
  margin-top: 1px;
}

/* ============================================================
   MORE DRAWER
   ============================================================ */
.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0D2240;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform .3s ease;
  z-index: 300;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}

.drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto;
}

.drawer-inner {
  padding: 0 16px 32px;
}

.drawer-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 12px;
  padding: 0 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.drawer-link:hover {
  background: var(--blue-pale);
  color: var(--blue-mid);
}

.drawer-link i {
  width: 20px;
  color: var(--blue-mid);
  font-size: 16px;
  text-align: center;
}

.drawer-link.danger {
  color: var(--danger);
}

.drawer-link.danger i {
  color: var(--danger);
}

.drawer-link.danger:hover {
  background: var(--danger-bg);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 299;
  display: none;
}

.drawer-overlay.open {
  display: block;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin-bottom: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* ============================================================
   STAT CHIPS
   ============================================================ */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.stat-chip {
  background: var(--blue-pale);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #1A3D6A;
}

.stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue-mid);
  line-height: 1;
}

.stat-frac {
  font-size: 13px;
  color: var(--text2);
  margin-left: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

/* Default .btn (no modifier) = subtle dark panel button */
.btn:not([class*="btn-"]),
.btn.btn-default {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:not([class*="btn-"]):hover,
.btn.btn-default:hover {
  background: #1A3A5C;
  border-color: #2B5280;
}

.btn-primary {
  background: linear-gradient(135deg, #1565C0, var(--blue));
  color: #fff;
  box-shadow: 0 4px 16px rgba(33,150,243,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(33,150,243,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--blue-mid);
  border: 1.5px solid var(--blue-mid);
}

.btn-outline:hover {
  background: var(--blue-pale);
}

.btn-warn {
  background: rgba(255,183,77,0.15);
  color: var(--warn);
  border: 1px solid rgba(255,183,77,0.25);
}

.btn-warn:hover {
  background: rgba(255,183,77,0.25);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,83,80,0.25);
}

.btn-danger:hover {
  background: #3D0F0F;
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--card2);
  color: var(--text);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text2);
  margin-bottom: 6px;
}

.input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #0A1E38;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}

.input[disabled],
.input:disabled {
  opacity: 0.5;
  background: #091520;
  cursor: not-allowed;
}

.input.error {
  border-color: var(--danger);
}

textarea.input {
  resize: vertical;
  min-height: 70px;
}

/* Placeholder color for dark inputs */
.input::placeholder { color: #3A6080; }

/* Inputs inside .form-group always go full-width */
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.form-group select,
.form-group textarea {
  width: 100%;
}

/* ── Global fallback: any bare input/select/textarea without .input class ── */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="file"]):not(.btn):not(.input),
select:not(.input),
textarea:not(.input) {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #0A1E38;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="file"]):not(.btn):not(.input):focus,
select:not(.input):focus,
textarea:not(.input):focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not(.btn):not(.input)::placeholder,
textarea:not(.input)::placeholder { color: #3A6080; }
select:not(.input) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B9BBD' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select:not(.input) option { background: #0F2035; color: var(--text); }
textarea:not(.input) { resize: vertical; min-height: 70px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 380px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-hint {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 44px;
}

.input-wrap .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  background: none;
  border: none;
  padding: 0;
}

/* ============================================================
   TABLES
   ============================================================ */

/* Any .card that contains a table — override the inline overflow:hidden */
.card:has(.tbl) {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.tbl {
  width: 100%;
  min-width: 480px; /* force scroll on narrow screens */
  border-collapse: collapse;
}

.tbl th {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text2);
  padding: 10px 12px;
  background: #091B30;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.tbl td {
  padding: 12px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap; /* keep cells from wrapping — forces horizontal scroll */
}

.tbl tr:hover td {
  background: rgba(33,150,243,0.06);
}

.tbl .empty td {
  text-align: center;
  padding: 32px;
  color: var(--text2);
  white-space: normal; /* allow wrap in empty state */
}

.tbl .empty i {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.3;
}

.right  { text-align: right; }
.center { text-align: center; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge.blue  { background: rgba(33,150,243,0.15);  color: var(--blue-mid); border: 1px solid rgba(33,150,243,0.3); }
.badge.green { background: rgba(76,175,80,0.15);   color: #66BB6A;         border: 1px solid rgba(76,175,80,0.3); }
.badge.amber { background: rgba(255,183,77,0.15);  color: var(--warn);     border: 1px solid rgba(255,183,77,0.3); }
.badge.red   { background: rgba(239,83,80,0.15);   color: var(--danger);   border: 1px solid rgba(239,83,80,0.3); }
.badge.gray  { background: rgba(107,155,189,0.1);  color: var(--text2);    border: 1px solid rgba(107,155,189,0.2); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-bg.show {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.modal-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text2);
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}

.modal-close:hover {
  background: var(--card2);
  color: var(--text);
}

.modal-body {
  padding: 16px 20px;
}

.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  min-width: 200px;
  max-width: 90vw;
}

.toast {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: slideDown .3s ease;
  text-align: center;
}

.toast.success { background: #1B5E20; color: #A5D6A7; border: 1px solid #2E7D32; }
.toast.error   { background: #4A0A0A; color: #EF9A9A; border: 1px solid var(--danger); }
.toast.info    { background: #0D2B4A; color: var(--blue-light); border: 1px solid var(--blue); }

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h1,
.page-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.page-header p,
.page-header .muted {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.muted {
  color: var(--text2);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

code {
  font-family: 'Consolas', 'Courier New', monospace;
  background: #091B30;
  color: var(--blue-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1565C0, var(--blue));
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

/* Flex helpers */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-14  { font-size: 14px; }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--blue-pale);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #1A3D6A;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1565C0, var(--blue-mid));
  border-radius: 4px;
  transition: width .4s ease;
}

/* Alert boxes */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert i { flex-shrink: 0; margin-top: 1px; }

.alert.success { background: var(--success-bg); color: var(--success); border-color: rgba(76,175,80,0.25); }
.alert.warn    { background: var(--warn-bg);    color: var(--warn);    border-color: rgba(255,183,77,0.25); }
.alert.danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(239,83,80,0.25); }
.alert.info    { background: var(--blue-pale);  color: var(--blue-mid);border-color: rgba(33,150,243,0.25); }

/* Step dots for wizard */
.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s, transform .2s;
}

.step-dot.active {
  background: var(--blue);
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(33,150,243,0.5);
}

.step-dot.done {
  background: var(--blue-light);
}

/* Section label */
.section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin: 20px 0 10px;
}

/* List items */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

/* Tag */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--blue-pale);
  color: var(--text2);
  border: 1px solid var(--border);
}

/* Shimmer loading */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, #0F2035 25%, #142840 50%, #0F2035 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

/* File upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #091B30;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.upload-area i {
  font-size: 32px;
  color: var(--blue-mid);
  display: block;
  margin-bottom: 8px;
}

/* OTP input */
.otp-input {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
  padding: 16px 14px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #091B30;
  color: var(--text);
}

.otp-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(33,150,243,0.15);
}

/* Countdown timer */
.countdown {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}

.countdown.urgent {
  color: var(--warn);
}

/* ============================================================
   LOGIN / SETUP STANDALONE PAGES
   (no topbar/tabbar — used for login.php, setup.php, portal.php)
   ============================================================ */
body.standalone {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #070F1C;
}

.login-hero {
  background: linear-gradient(160deg, #0A1E3A 0%, #0D2E55 50%, #0F3060 100%);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 24px 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.login-hero-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, rgba(33,150,243,0.25), rgba(66,165,245,0.15));
  border: 2px solid rgba(33,150,243,0.4);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--blue-mid);
  margin-bottom: 14px;
  box-shadow: 0 0 30px rgba(33,150,243,0.2);
}

.login-hero h1 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  text-align: center;
}

.login-hero p {
  font-size: 13px;
  color: rgba(144,202,249,0.75);
  text-align: center;
  margin-bottom: 0;
}

.login-card-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 32px;
  margin-top: -24px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px 20px 16px 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
}

.login-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.login-footer-links a {
  color: var(--blue-mid);
}

/* Wizard-specific */
.wizard-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

/* ============================================================
   BOTTOM-NAV (legacy footer nav — agent/installer/member footers)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabbar-h);
  background: #0A1E3A;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  transition: color .15s;
  position: relative;
  padding: 0 4px;
}

.bottom-nav a i {
  font-size: 20px;
  display: block;
  margin-bottom: 1px;
}

.bottom-nav a.active {
  color: var(--blue-mid);
}

.bottom-nav a.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--blue-mid);
  border-radius: 50%;
  margin-top: 1px;
}

/* ============================================================
   ACTION BUTTONS IN TABLE ROWS
   ============================================================ */
.actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============================================================
   SELECT / DROPDOWN DARK STYLE
   ============================================================ */
select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B9BBD' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  appearance: none;
}

select.input option {
  background: #0F2035;
  color: var(--text);
}

/* ============================================================
   CHECKBOX / RADIO DARK STYLE
   ============================================================ */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================================
   DESKTOP SIDEBAR LAYOUT (≥ 900px)
   ============================================================ */

/* Hidden on mobile — only shown via the media query below */
.desktop-sidebar { display: none; }

@media (min-width: 900px) {
  body {
    /* Keep display:block — sidebar is position:fixed, page-wrap uses margin-left */
    padding-bottom: 0;
  }

  /* Hide all mobile-only chrome */
  .topbar         { display: none !important; }
  .tabbar         { display: none !important; }
  .bottom-nav     { display: none !important; }
  .drawer         { display: none !important; }
  .drawer-overlay { display: none !important; }

  /* ── Sidebar ── */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    background: linear-gradient(180deg, #0A1E3A 0%, #091523 100%);
    border-right: 1px solid var(--border);
    z-index: 100;
    overflow-y: auto;
  }

  .sidebar-brand {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-brand-name {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
  }
  .sidebar-brand-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text2);
    margin-top: 3px;
  }

  .sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
  }
  .sidebar-nav-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text2);
    padding: 10px 10px 4px;
    opacity: 0.5;
  }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    text-decoration: none;
    color: #b6c2d2;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
  }
  .sidebar-link i {
    width: 18px;
    font-size: 14px;
    text-align: center;
    color: var(--text2);
    flex-shrink: 0;
  }
  .sidebar-link:hover {
    background: rgba(33,150,243,0.08);
    color: #fff;
  }
  .sidebar-link:hover i { color: var(--blue-mid); }
  .sidebar-link.active {
    background: linear-gradient(135deg, rgba(33,150,243,0.2), rgba(66,165,245,0.1));
    color: #fff;
    border-color: rgba(66,165,245,0.25);
  }
  .sidebar-link.active i { color: var(--blue-mid); }
  .sidebar-link.danger        { color: var(--danger); }
  .sidebar-link.danger i      { color: var(--danger); }
  .sidebar-link.danger:hover  { background: var(--danger-bg); color: var(--danger); }

  .sidebar-user {
    padding: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-user-card {
    background: rgba(33,150,243,0.05);
    border: 1px solid rgba(33,150,243,0.1);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-user-info .who  { font-size: 12px; font-weight: 700; color: #fff; }
  .sidebar-user-info .role { font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

  /* ── Main content area ── */
  .page-wrap {
    max-width: none;
    margin: 0 0 0 220px;
    padding: 28px 32px;
  }

  /* Toast: top-right corner on desktop */
  .toast-wrap {
    left: auto;
    right: 24px;
    top: 20px;
    transform: none;
  }

  /* Stats: more columns on wide screens */
  .stat-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  /* Tables: no forced horizontal scroll on desktop */
  .tbl { min-width: 0; }
}

/* ============================================================
   SCROLLBAR (webkit)
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #091523;
}
::-webkit-scrollbar-thumb {
  background: #1A3550;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2B5280;
}
