/* ── VARIABLES ──────────────────────────────────────────── */
:root {
  --bg: #050507;
  --bg2: #0a0a10;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-gold: rgba(212,175,55,0.25);
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-dim: rgba(212,175,55,0.15);
  --text: #e8e6df;
  --text-dim: rgba(232,230,223,0.45);
  --text-muted: rgba(232,230,223,0.25);
  --accent-blue: #3a7bd5;
  --accent-red: #c0392b;
  --accent-green: #2ecc71;
  --accent-orange: #e67e22;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; overflow: hidden; }

/* ── PAGES ──────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: flex; height: 100vh; width: 100vw; }

/* ── LOGIN ──────────────────────────────────────────────── */
#login-page {
  position: relative; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: .4;
}
.glow { position: absolute; border-radius: 50%; filter: blur(120px); }
.glow-1 { width: 500px; height: 500px; top: -100px; left: -100px; background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%); }
.glow-2 { width: 400px; height: 400px; bottom: -100px; right: -50px; background: radial-gradient(circle, rgba(58,123,213,0.06) 0%, transparent 70%); }
.login-container {
  position: relative; z-index: 1;
  background: rgba(10,10,16,0.8);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 360px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(212,175,55,0.1);
}
.login-logo { font-family: var(--font-display); font-size: 2.8rem; letter-spacing: 0.12em; text-align: center; }
.logo-s { color: var(--gold); }
.logo-even { color: var(--text); }
.login-sub { text-align: center; color: var(--text-dim); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; margin: 8px 0 32px; font-family: var(--font-mono); }
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ── FIELDS ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); font-family: var(--font-mono); }
input, select, textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border .2s;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: rgba(212,175,55,0.4); }
select { cursor: pointer; }
select option { background: #0a0a10; }
textarea { resize: vertical; min-height: 80px; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.08));
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary:hover { background: rgba(212,175,55,0.2); box-shadow: 0 0 20px rgba(212,175,55,0.15); }
.btn-sm { padding: 7px 14px; font-size: 11px; }
.btn-filter {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); padding: 6px 14px; cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  transition: all .2s;
}
.btn-filter.active, .btn-filter:hover { border-color: var(--border-gold); color: var(--gold); }
.btn-logout {
  background: transparent; border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-sm);
  color: var(--text-dim); padding: 8px 16px; cursor: pointer; font-family: var(--font-mono);
  font-size: 11px; width: 100%; transition: all .2s;
}
.btn-logout:hover { border-color: rgba(192,57,43,0.4); color: #e74c3c; }
.btn-danger {
  background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.3);
  color: #e74c3c; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 11px;
  font-family: var(--font-mono); transition: all .2s;
}
.btn-danger:hover { background: rgba(192,57,43,0.2); }
.btn-success {
  background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3);
  color: #2ecc71; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 11px;
  font-family: var(--font-mono); transition: all .2s;
}
.btn-success:hover { background: rgba(46,204,113,0.2); }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); height: 100vh;
  background: rgba(8,8,12,0.95);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 0;
  flex-shrink: 0;
}
.sidebar-top { padding: 28px 20px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 4px; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.1em; }
.logo-tag { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); letter-spacing: 0.2em; margin-left: 6px; margin-top: 6px; }
.user-chip { margin-top: 16px; font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.user-chip .chip-role { color: var(--gold); font-size: 10px; }

.nav-links { list-style: none; padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-dim); font-size: 13px;
  transition: all .15s; margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--border-gold); }
.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.sidebar-bottom { padding: 16px; border-top: 1px solid var(--border); }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; height: 100vh; background: var(--bg); }

.inner-page { display: none; padding: 36px 40px; min-height: 100%; }
.inner-page.active { display: block; }

.page-header { margin-bottom: 32px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-header h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 400; line-height: 1; }
.page-header .subtitle { color: var(--text-dim); font-size: 13px; flex: 1; }
.accent { color: var(--gold); }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-head h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 400; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── STATS ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border-gold); }
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-mono); margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--gold); }

/* ── ACTIVITY ────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.02);
  font-size: 12px;
}
.activity-item .act-user { color: var(--gold); font-family: var(--font-mono); min-width: 80px; }
.activity-item .act-action { color: var(--text); flex: 1; }
.activity-item .act-time { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }

.sessions-list { display: flex; flex-direction: column; gap: 8px; }
.session-item {
  padding: 10px 14px; border-radius: 8px; background: rgba(255,255,255,0.02);
  font-size: 12px; display: flex; justify-content: space-between; align-items: center;
}
.session-name { font-family: var(--font-mono); color: var(--gold-light); }
.session-media { color: var(--text-dim); font-size: 11px; }
.session-badge { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-family: var(--font-mono); }

/* ── USERS TABLE ─────────────────────────────────────────── */
.users-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 14px; text-align: left; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: var(--surface-hover); }
tbody td { padding: 12px 14px; font-size: 13px; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 10px; font-family: var(--font-mono); }
.badge-active { background: rgba(46,204,113,0.1); color: #2ecc71; border: 1px solid rgba(46,204,113,0.2); }
.badge-inactive { background: rgba(192,57,43,0.1); color: #e74c3c; border: 1px solid rgba(192,57,43,0.2); }
.badge-admin { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--border-gold); }

/* ── REQUESTS ────────────────────────────────────────────── */
.filter-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.requests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.request-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.req-title { font-family: var(--font-display); font-size: 1.1rem; }
.req-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.req-status { font-size: 10px; padding: 3px 10px; border-radius: 20px; font-family: var(--font-mono); width: fit-content; }
.req-pending { background: rgba(230,126,34,0.1); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.req-approved { background: rgba(46,204,113,0.1); color: #2ecc71; border: 1px solid rgba(46,204,113,0.2); }
.req-declined { background: rgba(192,57,43,0.1); color: #e74c3c; border: 1px solid rgba(192,57,43,0.2); }
.req-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── KANBAN ──────────────────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
@media (max-width: 1000px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
.kanban-col {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 400px;
}
.kanban-col-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 16px; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-todo { background: rgba(255,255,255,0.3); }
.dot-progress { background: #3a7bd5; }
.dot-review { background: #e67e22; }
.dot-done { background: #2ecc71; }
.col-count { margin-left: auto; background: var(--surface); border: 1px solid var(--border); padding: 1px 7px; border-radius: 20px; font-size: 10px; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; }
.kanban-card {
  background: rgba(10,10,16,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.kanban-card:hover { border-color: var(--border-gold); transform: translateY(-1px); }
.kc-title { font-size: 13px; margin-bottom: 6px; }
.kc-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kc-priority { font-size: 9px; padding: 2px 7px; border-radius: 20px; font-family: var(--font-mono); }
.pri-high { background: rgba(192,57,43,0.1); color: #e74c3c; }
.pri-medium { background: rgba(230,126,34,0.1); color: #e67e22; }
.pri-low { background: rgba(46,204,113,0.1); color: #2ecc71; }
.kc-assignee { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── NOTES ───────────────────────────────────────────────── */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.note-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: border-color .2s;
}
.note-card:hover { border-color: var(--border-gold); }
.note-title { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 8px; }
.note-preview { font-size: 12px; color: var(--text-dim); line-height: 1.5; max-height: 60px; overflow: hidden; }
.note-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.note-shared { color: var(--gold); }

/* ── CHAT ────────────────────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 160px); }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 70%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.msg-bubble {
  padding: 10px 16px; border-radius: 14px; font-size: 13px; line-height: 1.4;
}
.mine .msg-bubble { background: var(--gold-dim); border: 1px solid var(--border-gold); color: var(--gold-light); border-bottom-right-radius: 4px; }
.theirs .msg-bubble { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); padding: 0 4px; }
.chat-input-row { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; }

/* ── TIKTOK ──────────────────────────────────────────────── */
.ai-form { display: flex; flex-direction: column; gap: 14px; }
.tt-result {
  margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;
}
.tt-result-field { margin-bottom: 12px; }
.tt-result-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 4px; }
.tt-result-val { font-size: 13px; line-height: 1.5; }
.tt-hashtags { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-tag { background: var(--gold-dim); border: 1px solid var(--border-gold); color: var(--gold); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-family: var(--font-mono); }
.tiktok-list { display: flex; flex-direction: column; gap: 10px; max-height: 500px; overflow-y: auto; }
.tt-idea-item {
  padding: 12px 14px; background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .2s;
}
.tt-idea-item:hover { border-color: var(--border-gold); }
.tt-idea-title { font-size: 13px; margin-bottom: 4px; }
.tt-idea-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.tt-status-idea { color: var(--text-dim); }
.tt-status-filming { color: var(--accent-orange); }
.tt-status-done { color: var(--accent-green); }

/* ── ADMIN ───────────────────────────────────────────────── */
.admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 400px; }
.admin-users-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(255,255,255,0.02); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px;
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: rgba(10,10,16,0.98);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 32px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}
.modal-title { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 20px; }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; justify-content: flex-end; }

/* ── MISC ────────────────────────────────────────────────── */
.error-msg { background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.3); color: #e74c3c; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.success-msg { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.hidden { display: none !important; }
.shimmer { position: relative; overflow: hidden; }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-gold); }
