/* ============================================================
   SFTCRM — Light mode + toggle widget
   Only loaded when user switches from default dark mode.
   ============================================================ */

/* ── Light mode ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:       #f0f2f5;
  --surface:  #ffffff;
  --surface2: #f4f6f9;
  --border:   #dde1e9;
  --text:     #1a1f2e;
  --muted:    #7a8499;
  --accent:   #f97316;
  --accent2:  #0ea5e9;
  --danger:   #ef4444;
  --success:  #22c55e;
  --warning:  #f59e0b;
}

[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="light"] .sidebar {
  background: #1a1f2e;
  border-right-color: #2d3748;
}

[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border); }

[data-theme="light"] input[type=text],
[data-theme="light"] input[type=email],
[data-theme="light"] input[type=tel],
[data-theme="light"] input[type=password],
[data-theme="light"] input[type=number],
[data-theme="light"] input[type=date],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="light"] tr:hover td { background: rgba(0,0,0,0.02); }
[data-theme="light"] .modal-backdrop { background: rgba(0,0,0,0.45); }

[data-theme="light"] .login-page {
  background: var(--bg);
  background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(249,115,22,0.08) 0%, transparent 70%);
}

/* ── Dark mode re-assert (in case browser has no data-theme yet) ── */
[data-theme="dark"] {
  --bg:       #0e0f11;
  --surface:  #16181c;
  --surface2: #1e2027;
  --border:   #2a2d36;
  --text:     #e8eaf0;
  --muted:    #6b7280;
  --accent:   #f97316;
  --accent2:  #47c8ff;
  --danger:   #ff4757;
  --success:  #2ecc71;
  --warning:  #f39c12;
}

/* ── Toggle widget ──────────────────────────────────────────── */
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  user-select: none;
  opacity: .7;
  transition: opacity .15s;
}
.dark-toggle:hover { opacity: 1; }

.toggle-track {
  width: 34px;
  height: 18px;
  background: #374151;
  border-radius: 9px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.dark-toggle.is-dark .toggle-track { background: var(--accent); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.dark-toggle.is-dark .toggle-thumb { transform: translateX(16px); }

.toggle-icon { font-size: 12px; line-height: 1; }
