/* Shared dark theme for login / events / visions pages.
   templates/timeline.html intentionally does NOT use this file. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:        #000000;
  --bg-soft:   #050505;
  --surface:   #0d0d0d;
  --surface-2: #161616;
  --border:    #2a2a2a;
  --border-hover: #FA5509;
  --text:      #ffffff;
  --text-dim:  #ffffff;
  --text-faint:#cccccc;
  --accent:    #FA5509;
  --accent-2:  #FA5509;
  --accent-3:  #FA5509;
  --danger:    #ef4444;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; }

/* ── Brand / logo ───────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  font-size: 16px; flex-shrink: 0;
}
.brand-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Top bar ────────────────────────────────────────────────────── */
.topbar {
  background: rgba(20,24,36,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
}
.user-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
}

.btn-ghost {
  font-size: 13px; color: var(--text-dim); text-decoration: none;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .15s; background: transparent; cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); color: #fff; border-color: var(--border-hover); }

.nav-links { display: flex; gap: 10px; align-items: center; }

/* ── Main layout ────────────────────────────────────────────────── */
main { padding: 40px; max-width: 1240px; margin: 0 auto; }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-faint); margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}
.page-title {
  font-size: 26px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 12px;
}
.page-subtitle { font-size: 14px; color: var(--text-faint); margin-top: 6px; }

.count-badge {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: rgba(250,85,9,0.12); border: 1px solid rgba(250,85,9,0.25);
  border-radius: 999px; padding: 3px 10px;
}

/* ── Search box ─────────────────────────────────────────────────── */
.search-box { position: relative; width: 100%; max-width: 320px; }
.search-box input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 10px 14px 10px 36px;
  font-size: 13px; outline: none; transition: border-color .15s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-faint); pointer-events: none;
}

/* ── Card grid ──────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }

.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: var(--text);
  transition: all .2s ease; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(135deg, rgba(250,85,9,0.1), rgba(250,85,9,0.04));
  transition: opacity .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 42px; height: 42px; border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.card-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; color: var(--accent); word-break: break-word; }
.card-meta { font-size: 12px; color: var(--text-faint); }
.card-action {
  margin-top: auto; padding-top: 16px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 4px; position: relative; z-index: 1;
}

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 60px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-faint);
}
.empty-state .icon { font-size: 32px; margin-bottom: 12px; opacity: .6; }
.empty-state .title { color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }

/* ── Admin: stat cards ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--text); transition: all .2s ease;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ── Admin: panel / table ───────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
}
.panel h3 { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 600; color: var(--text-faint); font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; padding: 0 12px 10px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .muted { color: var(--text-faint); }

.role-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
}
.role-badge.admin { color: var(--accent-2); background: rgba(250,85,9,0.12); border: 1px solid rgba(250,85,9,0.25); }
.role-badge.user { color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); }

.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 18px; }
.form-inline .field { display: flex; flex-direction: column; gap: 6px; }
.form-inline label { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.form-inline input, .form-inline select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; outline: none; transition: border-color .15s;
}
.form-inline input:focus, .form-inline select:focus { border-color: var(--accent); }

.btn-small {
  padding: 9px 16px; border-radius: var(--radius-sm); border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; background: linear-gradient(135deg, var(--accent-3), var(--accent)); color: #fff;
}
.btn-small:hover { box-shadow: 0 4px 12px rgba(250,85,9,0.3); }
.btn-danger {
  padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(239,68,68,0.3); font-size: 12px;
  cursor: pointer; background: rgba(239,68,68,0.08); color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.15); }

.alert-error {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: var(--radius-sm);
  color: var(--danger); font-size: 13px; padding: 12px 16px; margin-bottom: 20px;
}

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Toast notification ─────────────────────────────────────────── */
.toast {
  position: fixed; top: 24px; right: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); padding: 14px 18px;
  box-shadow: var(--shadow); color: var(--text);
  font-size: 13px; font-weight: 500; max-width: 360px;
  transform: translateX(120%); opacity: 0; pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.toast .toast-icon {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #000; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.toast .toast-msg { flex: 1; }
.toast .toast-close {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0; flex-shrink: 0;
}
.toast .toast-close:hover { color: var(--text); }

/* ── Confirm modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; width: 100%; max-width: 380px;
  transform: translateY(-12px); transition: transform .15s ease;
}
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.modal-body { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 20px; }
.modal-body b { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-danger-solid {
  padding: 9px 16px; border-radius: var(--radius-sm); border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--danger); color: #fff;
}
.btn-danger-solid:hover { opacity: .9; }

/* ── Row order controls (up/down arrows) ───────────────────────── */
.order-controls { display: flex; gap: 4px; }
.order-btn {
  width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-dim); cursor: pointer;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  transition: all .15s; padding: 0;
}
.order-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.order-btn:disabled { opacity: .3; cursor: default; }

/* ── Password field with show/hide toggle ──────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm) !important; font-size: 13px; outline: none; transition: border-color .15s;
  padding: 10px 34px 10px 12px !important; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.pw-wrap input:focus { border-color: var(--accent); }
.pw-eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--text-faint); padding: 4px; line-height: 1;
}
.pw-eye-btn:hover { color: var(--text); }
