/* ============================================================
   SPNZ Digital Solutions — Main Stylesheet
   Aesthetic: Sonic Dark | Fonts: Syne + Figtree
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:          #07070F;
  --bg-2:        #0D0D1C;
  --bg-card:     #111126;
  --bg-card-h:   #17173A;
  --border:      rgba(255,255,255,0.06);
  --border-s:    rgba(255,255,255,0.12);
  --accent:      #00E5A0;
  --accent-glow: rgba(0,229,160,0.18);
  --accent-dim:  rgba(0,229,160,0.10);
  --accent-2:    #7C5CFC;
  --accent-2g:   rgba(124,92,252,0.15);
  --text:        #EEEEF5;
  --text-2:      #9090B0;
  --text-3:      #55556A;
  --success:     #22C55E;
  --warn:        #F59E0B;
  --danger:      #EF4444;
  --info:        #38BDF8;
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius:      10px;
  --radius-lg:   16px;
  --trans:       all 0.22s cubic-bezier(.4,0,.2,1);
}
[data-theme="light"] {
  --bg:        #F4F4FA;
  --bg-2:      #EBEBF5;
  --bg-card:   #FFFFFF;
  --bg-card-h: #F0F0FC;
  --border:    rgba(0,0,0,0.07);
  --border-s:  rgba(0,0,0,0.14);
  --text:      #0D0D22;
  --text-2:    #4A4A70;
  --text-3:    #9090A8;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Figtree', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Typography ────────────────────────────────────────────── */
.font-display { font-family: 'Syne', sans-serif; }
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
.text-accent { color: var(--accent); }
.text-accent-2 { color: var(--accent-2); }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px;
  transition: var(--trans); white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #050a08;
  box-shadow: 0 0 24px rgba(0,229,160,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: 0 4px 32px rgba(0,229,160,0.45);
}
.btn-secondary {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border-s);
}
.btn-secondary:hover { background: var(--bg-card-h); border-color: var(--accent); }
.btn-ghost { color: var(--text-2); padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); background: var(--border); border-radius: var(--radius); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--trans);
}
.card:hover { border-color: var(--border-s); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ── Badges / Status Pills ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warn    { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-info    { background: rgba(56,189,248,0.15); color: var(--info); }
.badge-muted   { background: var(--border); color: var(--text-2); }
.badge-accent  { background: var(--accent-dim); color: var(--accent); }
.badge-purple  { background: var(--accent-2g); color: var(--accent-2); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.form-input, .form-select, .form-textarea {
  background: var(--bg-2); border: 1px solid var(--border-s);
  border-radius: var(--radius); color: var(--text);
  padding: 10px 14px; font-size: 14px;
  transition: var(--trans); outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-input::placeholder { color: var(--text-3); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-2); padding: 12px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-2);
  border-bottom: 1px solid var(--border); text-align: left;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-card-h); }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: var(--radius); border: 1px solid var(--border); flex-wrap: wrap; }
.tab-btn {
  padding: 7px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: var(--trans); cursor: pointer;
}
.tab-btn.active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,0.3); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Dropdown ──────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border-s);
  border-radius: var(--radius-lg); min-width: 200px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: var(--trans); z-index: 999;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-2);
  font-size: 13px; transition: var(--trans); cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-card-h); color: var(--text); }
.dropdown-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.dropdown-item:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--trans);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-s);
  border-radius: var(--radius-lg); padding: 28px;
  max-width: 480px; width: 90%;
  transform: scale(0.95) translateY(12px);
  transition: var(--trans);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Dashboard Layout ──────────────────────────────────────── */
.dashboard { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--bg-2); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: var(--trans);
}
.sidebar-logo {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; color: #050a08;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; }
.sidebar-logo .logo-text span { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3); padding: 10px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: var(--trans); cursor: pointer;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--accent);
  color: #050a08; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 100px;
}

/* Topbar */
.topbar {
  height: var(--topbar-h); background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 90;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; color: #050a08;
  flex-shrink: 0;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: var(--trans); position: relative;
}
.icon-btn:hover { background: var(--bg-card); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-2);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}
.page-content { padding: 24px; flex: 1; max-width: 1400px; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; }
.page-header p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* ── Stats Row ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px; transition: var(--trans);
}
.stat-card:hover { border-color: var(--border-s); transform: translateY(-2px); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.stat-val { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; }
.stat-change { font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}

/* ── Notification Dropdown ─────────────────────────────────── */
.notif-menu { min-width: 320px; right: 0; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-header h4 { font-size: 13px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; transition: var(--trans); cursor: pointer; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-card-h); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: var(--text-3); }
.notif-text { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Kanban ────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.kanban-col { background: var(--bg-2); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 14px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kanban-col-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kanban-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
  cursor: grab; transition: var(--trans);
}
.kanban-card:hover { border-color: var(--border-s); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }

/* ── Upload Zone ───────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-s); border-radius: var(--radius-lg);
  padding: 28px 20px; text-align: center; cursor: pointer; transition: var(--trans);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-dim); }
.upload-zone svg { margin: 0 auto 10px; color: var(--text-3); }
.upload-zone p { font-size: 13px; color: var(--text-2); }
.upload-zone span { color: var(--accent); font-weight: 600; }

/* ── Credits Badge ─────────────────────────────────────────── */
.credits-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-dim); border: 1px solid rgba(0,229,160,0.2);
  border-radius: 100px; padding: 6px 14px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}

/* ── Chat Layout ───────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 0; height: calc(100vh - var(--topbar-h) - 48px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chat-sidebar { background: var(--bg-2); border-right: 1px solid var(--border); overflow-y: auto; }
.chat-sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.chat-room {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  cursor: pointer; transition: var(--trans); border-bottom: 1px solid var(--border);
}
.chat-room:hover { background: var(--bg-card-h); }
.chat-room.active { background: var(--accent-dim); }
.chat-room-name { font-size: 13px; font-weight: 600; }
.chat-room-preview { font-size: 11px; color: var(--text-2); }
.chat-main { display: flex; flex-direction: column; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg.own { flex-direction: row-reverse; }
.chat-bubble {
  max-width: 65%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
  background: var(--bg-card); border: 1px solid var(--border);
}
.chat-msg.own .chat-bubble { background: var(--accent-dim); border-color: rgba(0,229,160,0.2); color: var(--text); }
.chat-time { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.chat-input-area { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }
.chat-input { flex: 1; background: var(--bg-2); border: 1px solid var(--border-s); border-radius: 10px; padding: 10px 14px; color: var(--text); font-size: 13.5px; resize: none; outline: none; max-height: 120px; }
.chat-input:focus { border-color: var(--accent); }

/* ── Misc ──────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border-s);
  border-radius: var(--radius); padding: 8px 14px;
}
.search-bar input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 220px; }
.search-bar input::placeholder { color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-2); }
.empty-state svg { margin: 0 auto 16px; color: var(--text-3); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-s); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%,100% { box-shadow:0 0 20px var(--accent-glow); } 50% { box-shadow:0 0 40px var(--accent-glow); } }
.anim-fade-up { animation: fadeUp 0.4s ease both; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
}
