/* FeelChat admin — dark surfaces and the app's accent, so the dashboard reads
   as part of the same product. No framework, no build step. */

:root {
  --page: #070408;
  --card: #18101A;
  --card-2: #1f1522;
  --border: rgba(244, 114, 182, 0.14);
  --border-soft: rgba(255, 255, 255, 0.07);
  --accent: #E0447C;
  --accent-bright: #F472B6;
  --accent-tint: rgba(224, 68, 124, 0.14);
  --text: #F5F3F6;
  --text-dim: #B3A9B8;
  --text-faint: #7C7382;
  --danger: #F87171;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --ok: #34D399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --warn: #FBBF24;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Shell ─────────────────────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: #0d080f;
  border-right: 1px solid var(--border-soft);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; padding: 0 8px; }
.brand span { color: var(--accent); }
.brand small {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-faint); margin-top: 2px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; text-decoration: none;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.sidebar nav a.active { background: var(--accent-tint); color: var(--accent-bright); }
.sidebar nav .ico { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 14px; display: grid; gap: 6px; }
.who { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 6px; }
.who strong { font-size: 13px; }
.role {
  align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-bright);
}
.role-editor { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.muted-link { color: var(--text-faint); font-size: 13px; padding: 2px 4px; }

.main { flex: 1; min-width: 0; padding: 26px 30px 70px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.5px; }
.page-head .sub { margin: 4px 0 0; color: var(--text-dim); }

/* ── Flashes ───────────────────────────────────────────────────────────────── */

.flash {
  padding: 12px 15px; border-radius: 12px; margin-bottom: 16px;
  border: 1px solid var(--border-soft); font-weight: 500;
}
.flash-success { background: var(--ok-bg); border-color: rgba(52,211,153,0.3); color: #A7F3D0; }
.flash-error { background: var(--danger-bg); border-color: rgba(239,68,68,0.3); color: #FECACA; }
.flash-info { background: rgba(255,255,255,0.05); color: var(--text-dim); }

/* ── Cards & layout helpers ────────────────────────────────────────────────── */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h2 .count { color: var(--text-faint); font-weight: 600; font-size: 13px; margin-left: 6px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ── Stats ─────────────────────────────────────────────────────────────────── */

.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat .label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-faint);
}
.stat .value { font-size: 27px; font-weight: 800; letter-spacing: -0.6px; margin-top: 6px; }
.stat .delta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.stat.accent .value { color: var(--accent-bright); }

/* ── Tables ────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th {
  font-size: 11px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--text-faint); border-bottom-color: var(--border);
}
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
tbody tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }

.empty { padding: 34px 12px; text-align: center; color: var(--text-dim); }

/* ── Badges ────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.3px;
  background: rgba(255,255,255,0.07); color: var(--text-dim);
}
.badge-pro { background: var(--accent-tint); color: var(--accent-bright); }
.badge-ok { background: var(--ok-bg); color: #6EE7B7; }
.badge-warn { background: rgba(251,191,36,0.14); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ── Forms ─────────────────────────────────────────────────────────────────── */

label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
label .hint { display: block; font-weight: 500; color: var(--text-faint); margin-top: 3px; font-size: 11px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border-soft);
  color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
input[type=file] { color: var(--text-dim); font-size: 13px; }

.field { margin-bottom: 15px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check label { margin: 0; font-size: 13px; color: var(--text); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); border-color: var(--border-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(239,68,68,0.35); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

.inline-form { display: inline; }

/* ── Images ────────────────────────────────────────────────────────────────── */

.thumb {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  background: var(--card-2); border: 1px solid var(--border-soft); display: inline-block;
}
.thumb-lg { width: 68px; height: 90px; border-radius: 10px; }
.thumb-empty {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12px;
}

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item {
  background: var(--card-2); border: 1px solid var(--border-soft);
  border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
}
.media-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #000; }
.media-meta { padding: 9px 10px; display: grid; gap: 5px; }
.media-meta .cap { font-size: 12px; color: var(--text-dim); word-break: break-word; }

/* ── Chart ─────────────────────────────────────────────────────────────────── */

.chart { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding-top: 8px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .bar i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar.alt i { background: rgba(244,114,182,0.35); }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.chart-legend b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ── Transcript ────────────────────────────────────────────────────────────── */

.msg { display: flex; margin-bottom: 10px; }
.msg .bubble { max-width: 74%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant .bubble { background: var(--card-2); border-bottom-left-radius: 5px; }
.msg .stamp { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 5px; }

/* ── Pagination ────────────────────────────────────────────────────────────── */

.pagination { display: flex; align-items: center; gap: 14px; padding-top: 14px; }
.pagination .page-of { color: var(--text-dim); font-size: 13px; }
.pagination-note { padding-top: 12px; font-size: 13px; }

/* ── Login ─────────────────────────────────────────────────────────────────── */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 30px; }
.login-card .brand { text-align: center; margin-bottom: 22px; padding: 0; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 20px 16px 60px; }
}
