/* Bela Helps admin - core styles */

:root {
  --bg: #FBFAF6;
  --panel: #FFFFFF;
  --ink: #1F1A17;
  --ink-soft: #4A423D;
  --ink-mute: #6F6760;
  --rule: #E8E2D8;
  --rule-soft: #F1ECE2;
  --accent: #C2185B;
  --accent-soft: #F8D5E3;
  --accent-deep: #6A1B9A;
  --coral: #E94B3C;
  --success: #2E7D32;
  --warning: #ED6C02;
  --error: #C62828;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; cursor: pointer; user-select: none;
  background: var(--accent); color: white;
  border: none; border-radius: 6px;
  padding: 8px 14px; font-weight: 600;
  transition: transform 0.05s, opacity 0.15s;
}
button:hover, .btn:hover { opacity: 0.92; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--rule); }
.btn-ghost:hover { background: var(--rule-soft); }
.btn-danger { background: var(--error); }

input[type=text], input[type=email], input[type=password], textarea, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.field { margin-bottom: 18px; }
.field .hint { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--rule);
  padding: 24px 16px;
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Quicksand', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: 28px;
}
.brand .dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  color: var(--ink-soft); font-weight: 500; font-size: 13.5px;
  text-decoration: none;
}
.nav a:hover { background: var(--rule-soft); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-mute); }
.sidebar-footer .user { color: var(--ink); font-weight: 600; }

.main { padding: 32px 40px; max-width: 1100px; }
.main h1 { font-family: 'Quicksand', 'Inter', sans-serif; font-size: 28px; margin: 0 0 6px 0; letter-spacing: -0.01em; }
.main h2 { font-size: 18px; margin: 32px 0 12px 0; }
.subtitle { color: var(--ink-mute); margin-bottom: 28px; font-size: 14px; }

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-title { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin: 0 0 12px 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.table thead { background: var(--rule-soft); }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-mute);
  border-bottom: 1px solid var(--rule);
}
.table td {
  padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--rule-soft); }
.table td.num { font-variant-numeric: tabular-nums; }
.table td a { color: var(--ink); font-weight: 500; }
.table td a:hover { color: var(--accent); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-active { background: #E6F4EA; color: var(--success); }
.badge-paused { background: #FFF4E5; color: var(--warning); }
.badge-archived { background: var(--rule-soft); color: var(--ink-mute); }
.badge-demo { background: var(--accent-soft); color: var(--accent); }
.badge-hipaa { background: #E3F2FD; color: #1565C0; }

/* Forms (detail pages) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.form-grid .full { grid-column: 1 / -1; }

/* Error / toast */
.alert { padding: 12px 16px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.alert-error { background: #FFEBEE; color: var(--error); border: 1px solid #FFCDD2; }
.alert-success { background: #E6F4EA; color: var(--success); border: 1px solid #C8E6C9; }
.alert-info { background: var(--accent-soft); color: var(--accent); border: 1px solid #F8BBD0; }

/* Empty state */
.empty {
  padding: 48px 20px; text-align: center; color: var(--ink-mute);
  background: var(--panel); border: 1px dashed var(--rule); border-radius: 8px;
}
.empty .icon { font-size: 32px; opacity: 0.5; margin-bottom: 8px; }

/* Code / JSON */
pre, code {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}
pre {
  background: #1F1A17; color: #F5EFE3;
  padding: 16px 20px; border-radius: 8px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.6;
  margin: 0 0 16px 0;
}

/* Login page (no sidebar) */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #FFF6EC 0%, #F8D5E3 100%);
}
.login-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px -20px rgba(31, 26, 23, 0.15);
  border: 1px solid var(--rule);
}
.login-card .brand-large {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--accent);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}
.login-card .brand-large .e-tilt { display: inline-block; transform: rotate(-15deg); transform-origin: 50% 60%; }
.login-card .brand-subtitle { color: var(--ink-mute); font-size: 13px; margin: 0 0 28px 0; }
