/* Tom The Lizard -- Dashboard Styles */
/* Inspired by: green lizard character on warm yellow background */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Lizard palette -- dark mode */
  --bg-base: #0c1210;
  --bg-surface: #111a16;
  --bg-surface-2: #162420;
  --bg-surface-hover: #1c2e28;
  --bg-input: #0c1210;
  --border: #1e3530;
  --border-subtle: #192a25;
  --text-primary: #dce8e2;
  --text-secondary: #7a9d8e;
  --text-muted: #405c50;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.1);
  --accent-glow: rgba(74, 222, 128, 0.18);
  --accent-2: #facc15;
  --accent-2-dim: rgba(250, 204, 21, 0.1);
  --success: #4ade80;
  --success-dim: rgba(74, 222, 128, 0.1);
  --warning: #facc15;
  --warning-dim: rgba(250, 204, 21, 0.1);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 210px;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-card: 0 1px 4px rgba(0,0,0,0.3);
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 13px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ====== SIDEBAR ====== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.2s;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-header h1 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.sidebar-header .subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -1px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 12px;
  opacity: 0.7;
}

.sidebar-nav a:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile */
.hamburger {
  display: none;
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ====== MAIN ====== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 22px 28px;
  max-width: calc(900px + var(--sidebar-w) + 56px);
}

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

.page-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

/* ====== CARDS ====== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  overflow: hidden;
}

.card-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ====== METRIC CARDS ====== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background var(--transition);
}

.metric-card.ok::before { background: var(--accent); }
.metric-card.warn::before { background: var(--warning); }
.metric-card.err::before { background: var(--danger); }

.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.metric-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ====== STATUS DOT ====== */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}

.dot.green { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.dot.red { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot.yellow { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.dot.gray { background: #4a5c54; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.dot.green { animation: pulse 2.5s infinite; }

/* ====== STAT ROWS ====== */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
}

.stat-row .label { color: var(--text-secondary); }
.stat-row .value { font-family: var(--font-mono); font-size: 12px; }

/* ====== INTEGRATION PILLS ====== */
.int-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.int-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.int-pill:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.int-pill .pill-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* ====== TABLES ====== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.data-table thead tr { text-align: left; }

.data-table th {
  padding: 6px 10px 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-surface-hover); }

/* Service badges */
.svc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.svc-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.svc-jira { background: #0052CC; }
.svc-conf { background: #1868DB; }
.svc-tom { background: #E8473C; }

.mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

/* ====== MESSAGES ====== */
.msg-list { max-height: 380px; overflow-y: auto; }

.msg-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

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

.msg-item .time {
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 10px;
  padding-top: 1px;
}

.msg-item .dir {
  font-family: var(--font-mono);
  width: 18px;
  text-align: center;
  font-size: 10px;
  padding-top: 1px;
}

.msg-item .dir.in { color: var(--accent); }
.msg-item .dir.out { color: var(--text-muted); }
.msg-item .text { flex: 1; word-break: break-word; line-height: 1.5; }

.msg-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px;
  font-size: 12px;
}

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

.form-group label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-weight: 600;
}

input[type="text"], input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { resize: vertical; min-height: 80px; font-family: var(--font-sans); }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='%23405c50' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ====== BUTTONS ====== */
.btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.btn:hover { background: var(--bg-surface-hover); border-color: var(--text-muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0c1210; }
.btn-primary:hover { background: #22c55e; }
.btn-danger { color: var(--danger); border-color: var(--danger-dim); }
.btn-danger:hover { background: var(--danger-dim); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface-hover); }

.btn-icon {
  padding: 4px 7px;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  line-height: 1;
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon.success { border-color: var(--accent); color: var(--accent); }

/* ====== TOGGLE ====== */
.toggle {
  position: relative;
  width: 36px; height: 20px;
  background: #2a3d35;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle.on::after { transform: translateX(16px); }

/* ====== BADGE ====== */
.badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

.badge-warn { background: var(--warning-dim); color: var(--warning); }
.badge-ok { background: var(--success-dim); color: var(--success); }
.badge-info { background: var(--accent-dim); color: var(--accent); }

/* ====== CREDENTIAL LIST ====== */
.cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.cred-row:last-child { border-bottom: none; }
.cred-row-dot { width: 20px; flex-shrink: 0; }
.cred-row-info { flex: 1; min-width: 0; }

.cred-row-label {
  font-weight: 700;
  font-size: 13px;
}

.cred-row-value {
  width: 120px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cred-row-action {
  width: 32px;
  flex-shrink: 0;
  text-align: center;
}

/* ====== TOAST ====== */
.toast {
  position: fixed;
  top: 14px; right: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  z-index: 1000;
  animation: slideIn 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.toast.ok { border-left: 3px solid var(--accent); }
.toast.err { border-left: 3px solid var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====== VIEWS ====== */
.view { display: none; }
.view.active { display: block; }

.link {
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.link:hover { text-decoration: underline; }

.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}

/* ====== VOCAB CHIPS ====== */
.vocab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.vocab-chip:hover { border-color: var(--text-muted); }

.vocab-chip.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
  color: #a78bfa;
}

.vocab-chip .chip-x {
  font-size: 9px;
  opacity: 0.5;
  cursor: pointer;
}

.vocab-chip .chip-x:hover { opacity: 1; }

/* ====== PLACES ====== */
.place-slot { margin-bottom: 4px; }

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

.place-slot-icon { font-size: 16px; }
.place-slot-label { font-weight: 800; font-size: 12px; min-width: 44px; }
.place-slot-name { flex: 1; font-size: 13px; font-weight: 600; }

.place-slot-addr {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 48px;
  margin-top: 2px;
}

.custom-place-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.custom-place-item:last-child { border-bottom: none; }
.custom-place-item .cp-label { font-weight: 700; font-size: 11px; min-width: 50px; color: var(--accent); }
.custom-place-item .cp-name { flex: 1; }
.custom-place-item .cp-coords { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* Search */
.search-input-wrap { position: relative; }
.search-input-wrap input { padding-right: 30px; }

.search-spinner {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.search-results { max-height: 200px; overflow-y: auto; }

.search-result-item {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}

.search-result-item:hover { background: var(--bg-surface-hover); }
.search-result-item.selected { background: var(--accent-dim); border-color: var(--accent); }

.search-result-item .sr-name { font-weight: 700; font-size: 12px; }
.search-result-item .sr-addr { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

.search-selected {
  padding: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-top: 8px;
}

.search-selected-name { font-weight: 700; font-size: 13px; }
.search-selected-addr { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.search-selected-coords { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }

/* ====== INTEGRATION SERVICE CARDS ====== */
.int-service-card { padding: 0; overflow: visible; }

.int-service-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.int-service-panel {
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  background: var(--bg-surface-2);
}

.int-cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
}

.int-cred-row label {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  min-width: 80px;
}

.int-cred-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ====== THEME TOGGLE ====== */
.theme-toggle {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.theme-toggle:hover { opacity: 1; }

/* ====== SCHEDULER ====== */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.task-card:hover { border-color: var(--accent); background: var(--bg-surface-hover); }
.task-card .task-toggle { flex-shrink: 0; }
.task-card .task-info { flex: 1; min-width: 0; }

.task-card .task-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card .task-schedule {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.task-card .task-meta { text-align: right; flex-shrink: 0; }

.task-card .task-last {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.task-card .task-run-btn {
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-top: 4px;
  font-weight: 600;
}

.task-card .task-run-btn:hover { border-color: var(--accent); color: var(--accent); }
.task-card.disabled { opacity: 0.5; }

/* Time picker */
.time-picker { display: flex; align-items: center; gap: 4px; }
.time-picker select { width: 70px; text-align: center; }
.time-sep { font-size: 16px; font-weight: 800; color: var(--text-muted); }

/* Recurrence pills */
.recurrence-pills { display: flex; gap: 5px; flex-wrap: wrap; }

.rec-pill {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.rec-pill:hover { border-color: var(--text-muted); color: var(--text-primary); }
.rec-pill.active { background: var(--accent); border-color: var(--accent); color: #0c1210; }

/* Day picker */
.day-picker { display: flex; gap: 4px; }

.day-btn {
  width: 40px; height: 32px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: var(--font-mono);
}

.day-btn:hover { border-color: var(--text-muted); }
.day-btn.active { background: var(--accent); border-color: var(--accent); color: #0c1210; }

input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  color-scheme: dark;
}

input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ====== LIGHT THEME ====== */
[data-theme="light"] {
  --bg-base: #f5f7f0;
  --bg-surface: #ffffff;
  --bg-surface-2: #f0f4ea;
  --bg-surface-hover: #e8eddf;
  --bg-input: #f5f7f0;
  --border: #d4dcc8;
  --border-subtle: #e4ebd8;
  --text-primary: #1a2e1a;
  --text-secondary: #5a7a5a;
  --text-muted: #94b094;
  --accent: #16a34a;
  --accent-dim: rgba(22, 163, 74, 0.08);
  --accent-glow: rgba(22, 163, 74, 0.12);
  --accent-2: #ca8a04;
  --accent-2-dim: rgba(202, 138, 4, 0.08);
  --success: #16a34a;
  --success-dim: rgba(22, 163, 74, 0.08);
  --warning: #ca8a04;
  --warning-dim: rgba(202, 138, 4, 0.08);
  --danger: #dc2626;
  --danger-dim: rgba(220, 38, 38, 0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06);
}

[data-theme="light"] .sidebar { background: #fafdf5; }
[data-theme="light"] .dot.green { box-shadow: none; }
[data-theme="light"] .dot.red { box-shadow: none; }
[data-theme="light"] .dot.yellow { box-shadow: none; }
[data-theme="light"] .toast { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.25); }
[data-theme="light"] input[type="date"] { color-scheme: light; }
[data-theme="light"] .btn-primary { color: white; }
[data-theme="light"] .btn-primary:hover { background: #15803d; }
[data-theme="light"] .rec-pill.active { color: white; }
[data-theme="light"] .day-btn.active { color: white; }

[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='%235a7a5a' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
}

/* ====== ONBOARDING ====== */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-card {
  width: 440px;
  max-width: 92vw;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
}

.ob-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.ob-dot.done { background: var(--accent); }

.ob-step { display: none; }
.ob-step.active { display: block; animation: obFadeIn 0.3s; }

@keyframes obFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ob-hero {
  font-size: 48px;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1;
}

.ob-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.ob-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.ob-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.ob-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.ob-link {
  color: var(--accent);
  text-decoration: none;
}

.ob-link:hover { text-decoration: underline; }

.ob-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.ob-actions > div {
  display: flex;
  gap: 8px;
}

/* Place rows in onboarding */
.ob-place-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.ob-place-icon { font-size: 20px; }

.ob-place-info { flex: 1; }

.ob-place-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
}

.ob-place-name {
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}

.ob-done-check {
  animation: obBounce 0.5s ease;
}

@keyframes obBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.ob-error {
  color: var(--danger);
  font-size: 11px;
  margin-top: 4px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .overlay.open { display: block; }
  .main { margin-left: 0; padding: 52px 14px 14px; }
  .card-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .int-pills { flex-direction: column; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
}
