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

/* ===== VARIABLES — Light (default) ===== */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1e40af;
  --primary-light: #e0e7ff;
  --primary-soft:  #eef2ff;
  --accent:        #4338ca;
  --accent-soft:   #eef2ff;

  --success:       #16a34a;
  --success-light: #ddf6e3;
  --warning:       #d97706;
  --warning-light: #fff4db;
  --danger:        #dc2626;
  --danger-light:  #ffe6e6;
  --info:          #0284c7;
  --info-light:    #dbeafe;

  --bg:       #f4f7ff;
  --surface:  #ffffff;
  --border:   #d6d9ec;
  --border2:  #e7ecf8;

  --text:     #111827;
  --text2:    #475569;
  --text3:    #7b8a9d;

  --radius:   10px;
  --shadow:   0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-md:0 20px 60px rgba(15, 23, 42, 0.12);
}

/* ===== VARIABLES — Dark ===== */
[data-theme="dark"] {
  --primary:       #60a5fa;
  --primary-dark:  #2563eb;
  --primary-light: #1e40af;
  --primary-soft:  #334155;
  --accent:        #818cf8;
  --accent-soft:   #1e293b;

  --success:       #4ade80;
  --success-light: #0f172a;
  --warning:       #fbbf24;
  --warning-light: #341f07;
  --danger:        #f87171;
  --danger-light:  #2b0c0c;
  --info:          #38bdf8;
  --info-light:    #071f3a;

  --bg:       #0f172a;
  --surface:  #111827;
  --border:   #243b55;
  --border2:  #334155;

  --text:     #f8fafc;
  --text2:    #cbd5e1;
  --text3:    #94a3b8;

  --shadow:   0 12px 30px rgba(0,0,0,0.35);
  --shadow-md:0 20px 60px rgba(0,0,0,0.45);
}

/* ══════════ PARTICLES CANVAS ══════════ */
#particles-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.auth-page:has(#particles-canvas) { position:relative; }

/* ══════════ PAGE ENTRANCE LOADER ══════════ */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.page-loader .loader-ring {
  width: 40px; height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }

/* ══════════ PAGE TRANSITION ══════════ */
.page-enter {
  animation: pageFadeIn 0.5s ease-out;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════ GLOW CURSOR ══════════ */
#glow-cursor {
  position: fixed;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: transform, left, top;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Glow orbs fixed on body */
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
body::before {
  width: 600px; height: 600px;
  top: -200px; right: -200px;
  background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
  animation: orbFloat1 20s ease-in-out infinite;
}
body::after {
  width: 500px; height: 500px;
  bottom: -150px; left: -150px;
  background: radial-gradient(circle, rgba(99,102,241,0.06), transparent 70%);
  animation: orbFloat2 25s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-60px, 40px); }
  66% { transform: translate(40px, -30px); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(50px, -50px); }
  66% { transform: translate(-30px, 40px); }
}

[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(96,165,250,0.06), transparent 70%);
}
[data-theme="dark"] body::after {
  background: radial-gradient(circle, rgba(129,140,248,0.05), transparent 70%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* Theme transition */
body, .navbar, .sidebar, .card, .stat-card, .table-wrap,
.form-control, .modal, .auth-card, .timeline-content, .float-card {
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; height: 60px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(214,217,236,0.6);
  box-shadow: 0 4px 24px rgba(15,23,42,0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, height 0.25s;
}
.navbar.scrolled {
  height: 52px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 6px 32px rgba(15,23,42,0.1), 0 1px 0 rgba(255,255,255,0.9) inset;
}
[data-theme="dark"] .navbar {
  background: rgba(15,23,42,0.82);
  border-bottom-color: rgba(36,59,85,0.6);
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
}
[data-theme="dark"] .navbar.scrolled {
  background: rgba(15,23,42,0.96);
}

/* Brand */
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.2px;
  transition: opacity 0.2s;
}
.navbar-brand:hover { opacity: 0.8; }

.navbar-brand .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 900; color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 3px 10px rgba(37,99,235,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.navbar-brand:hover .logo-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 6px 18px rgba(37,99,235,0.45);
}

/* Nav links */
.navbar-nav { display: flex; align-items: center; gap: 2px; }
.navbar-nav a {
  padding: 6px 13px; border-radius: 8px;
  color: var(--text2); text-decoration: none;
  font-size: 0.86rem; font-weight: 500;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.navbar-nav a:hover { background: rgba(37,99,235,0.07); color: var(--text); }
.navbar-nav a.active {
  background: rgba(37,99,235,0.1); color: var(--primary);
  font-weight: 600;
}
.navbar-nav a.active::after {
  content: ''; position: absolute; bottom: -3px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2.5px; border-radius: 2px;
  background: var(--primary);
}
.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle button — replaces ugly inline style */
.theme-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.25s;
  font-family: inherit; line-height: 1; flex-shrink: 0;
}
.theme-btn:hover {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.4);
  transform: rotate(18deg) scale(1.12);
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* ===== SIDEBAR ===== */
.layout { display: flex; padding-top: 60px; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  position: fixed; top: 60px; left: 0;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 1.25rem; }
.sidebar-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
  color: var(--text3); text-transform: uppercase;
  padding: 0 8px; margin-bottom: 4px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  color: var(--text2); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link .icon { font-size: 1rem; width: 18px; text-align: center; }

/* ===== BADGE ===== */
.badge {
  margin-left: auto; padding: 4px 10px;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  border: 1px solid transparent;
}
.badge-primary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.18);
}
.badge-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
}
.badge-warning {
  background: rgba(217, 119, 6, 0.14);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.18);
}
.badge-success {
  background: rgba(22, 163, 74, 0.14);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.18);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1; margin-left: 220px;
  padding: 1.5rem;
  min-height: calc(100vh - 56px);
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.page-subtitle { color: var(--text3); font-size: 0.85rem; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(214,217,236,0.85);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
[data-theme="dark"] .card {
  background: rgba(17,24,39,0.94);
  border-color: rgba(58,75,100,0.8);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,235,0.28);
}
.btn {
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.btn:hover {
  transform: translateY(-1px);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

.stat-card {
  background: linear-gradient(180deg, var(--surface), var(--primary-soft));
  border: 1px solid rgba(37,99,235,0.16);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  border-left: 6px solid transparent;
  box-shadow: 0 12px 30px rgba(37,99,235,0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.stat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 40px rgba(37,99,235,0.18), 0 0 20px rgba(37,99,235,0.08);
}
.stat-card.blue   { border-left-color: var(--primary); }
.stat-card.green  { border-left-color: var(--success); }
.stat-card.red    { border-left-color: var(--danger); }
.stat-card.yellow { border-left-color: var(--warning); }

.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); }
.stat-icon.green  { background: var(--success-light); }
.stat-icon.red    { background: var(--danger-light); }
.stat-icon.yellow { background: var(--warning-light); }

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label { color: var(--text3); font-size: 0.78rem; margin-top: 3px; }

/* ===== TABLE ===== */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}
.table-wrap:hover {
  border-color: rgba(37,99,235,0.2);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.05), var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg); padding: 10px 14px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.4px; text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
tbody tr { border-top: 1px solid var(--border); transition: all 0.2s ease; }
tbody tr:hover { background: rgba(37,99,235,0.04); }
tbody tr:active {
  background: rgba(37,99,235,0.08);
  transform: scale(0.998);
}
tbody td { padding: 11px 14px; font-size: 0.85rem; color: var(--text); }
[data-theme="dark"] tbody tr:hover { background: rgba(96,165,250,0.04); }
[data-theme="dark"] tbody tr:active { background: rgba(96,165,250,0.08); }

/* ===== PRIORITY BADGES ===== */
.priority {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}
.priority.high   { background: var(--danger-light);  color: var(--danger); }
.priority.medium { background: var(--warning-light); color: var(--warning); }
.priority.low    { background: var(--success-light); color: var(--success); }

/* ===== STATUS BADGES ===== */
.status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}
.status.pending     { background: var(--warning-light); color: var(--warning); }
.status.in-progress { background: var(--info-light);    color: var(--info); }
.status.resolved    { background: var(--success-light); color: var(--success); }
.status.cancelled   { background: #f1f3f5; color: var(--text3); }

/* ===== SENTIMENT BADGE ===== */
.sentiment {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}
.sentiment.positive   { background: var(--success-light); color: var(--success); }
.sentiment.neutral    { background: #f1f3f5; color: var(--text3); }
.sentiment.negative   { background: var(--danger-light);  color: var(--danger); }
.sentiment.frustrated { background: #fff0f6; color: #c2255c; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
  will-change: transform;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 28px rgba(37,99,235,0.18);
}
.btn-primary::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(37,99,235,0.32);
}
.btn-primary:hover::after { opacity: 1; }

.btn-secondary {
  background: rgba(37,99,235,0.08); color: var(--primary); border-color: transparent;
}
.btn-secondary::after {
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.08), transparent);
}
.btn-secondary:hover {
  background: rgba(37,99,235,0.14);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(37,99,235,0.15);
}
.btn-secondary:hover::after { opacity: 1; }

.btn-danger {
  background: var(--danger-light); color: var(--danger); border-color: #ffc9c9;
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(220,38,38,0.3); }

.btn-success {
  background: var(--success-light); color: var(--success); border-color: #b2f2bb;
}
.btn-success:hover { background: var(--success); color: #fff; border-color: var(--success); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(22,163,74,0.3); }

.btn-sm  { padding: 5px 11px; font-size: 0.78rem; }
.btn-icon{ padding: 7px; border-radius: var(--radius); }
.btn-large { padding: 11px 24px; font-size: 0.95rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text2); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.875rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.2s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23868e96' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }
.gap-1  { gap: 1rem; }

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 0.85rem; display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 1rem; border: 1px solid transparent;
}
.alert-success { background: var(--success-light); border-color: #b2f2bb; color: var(--success); }
.alert-danger  { background: var(--danger-light);  border-color: #ffc9c9; color: var(--danger); }
.alert-info    { background: var(--info-light);    border-color: #a5d8ff; color: var(--info); }
.alert-warning { background: var(--warning-light); border-color: #ffe066; color: var(--warning); }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 7px 12px;
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.875rem; width: 200px;
}
.search-bar input::placeholder { color: var(--text3); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; width: 90%; max-width: 520px;
  transform: translateY(12px); transition: transform 0.2s;
  box-shadow: var(--shadow-md);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title  { font-size: 1rem; font-weight: 700; }
.modal-close  {
  background: var(--bg); border: 1px solid var(--border); color: var(--text2);
  width: 28px; height: 28px; border-radius: var(--radius);
  cursor: pointer; font-size: 0.9rem;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); border-color: #ffc9c9; }

/* ===== HERO (Landing) ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
  background: var(--surface);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); border: 1px solid #bac8ff;
  color: var(--primary); padding: 4px 14px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; margin-bottom: 1.25rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; line-height: 1.15;
  margin-bottom: 1rem; color: var(--text);
}
.hero-sub {
  font-size: 1rem; color: var(--text2); max-width: 520px; margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== FLOATING CARDS ===== */
.float-cards {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 2.5rem;
}
.float-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 500; color: var(--text2);
  box-shadow: var(--shadow);
}

/* ===== COMPLAINT CARD ===== */
.complaint-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  margin-bottom: 0.75rem; transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.complaint-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.complaint-meta    { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.complaint-title   { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.complaint-preview { color: var(--text2); font-size: 0.82rem; margin-bottom: 8px; }
.complaint-footer  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }

/* ===== SENTIMENT METER ===== */
.sentiment-bar {
  height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; margin-top: 4px;
}
.sentiment-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.sentiment-fill.positive { background: var(--success); }
.sentiment-fill.neutral  { background: #adb5bd; }
.sentiment-fill.negative { background: var(--danger); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: 8px 16px; border: none; background: none;
  color: var(--text3); font-size: 0.85rem; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab:hover:not(.active) { color: var(--text2); }

/* ===== AUTH ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding-top: 56px;
  position: relative;
  z-index: 1;
}
.auth-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 16px;
  padding: 2rem; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.1), 0 1px 0 rgba(255,255,255,0.6) inset;
  animation: authFloatIn 0.6s ease-out;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--success));
  border-radius: 16px 16px 0 0;
}
.auth-card:hover {
  box-shadow: 0 24px 80px rgba(37,99,235,0.15);
  transform: translateY(-2px);
}
[data-theme="dark"] .auth-card {
  background: rgba(17,24,39,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-color: rgba(36,59,85,0.6);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05) inset;
}
@keyframes authFloatIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 1.5rem;
}
.auth-logo .icon {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ===== TIMELINE ===== */
.timeline { padding-left: 1rem; }
.timeline-item { position: relative; padding-bottom: 1.25rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute; left: -4px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
}
.timeline-time    { font-size: 0.72rem; color: var(--text3); margin-bottom: 3px; }
.timeline-content {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; font-size: 0.83rem;
}

/* ===== SPINNER ===== */
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.15);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== UTILITIES ===== */
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; justify-content: center; }
.gap-sm         { gap: 0.5rem; }
.gap            { gap: 0.75rem; }
.gap-lg         { gap: 1.25rem; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.flex-wrap      { flex-wrap: wrap; }
.w-full         { width: 100%; }
.text-muted     { color: var(--text2); }
.text-small     { font-size: 0.78rem; }
.text-center    { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 0.75rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot       { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--success); }
.dot-yellow{ background: var(--warning); }
.dot-red   { background: var(--danger); }
.dot-blue  { background: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .page-header { flex-wrap: wrap; gap: 1rem; }
  .page-title { width: 100%; }
  .navbar-actions { gap: 6px; }
  .btn { width: auto; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: 0.72rem; }
  .btn { width: 100%; justify-content: center; }
  .btn-sm { width: auto; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 720px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-subtitle { margin-top: 0.5rem; }
  .search-bar input { width: 100%; }
}

@media (max-width: 600px) {
  .main-content { padding: 0.9rem; }
  .page-title { font-size: 1.2rem; }
  .stat-icon { width: 34px; height: 34px; font-size: 1rem; }
  .stat-value { font-size: 1.2rem; }
  .status, .priority, .sentiment { padding: 4px 8px; font-size: 0.68rem; }
  .btn { padding: 10px 14px; }
  .auth-card, .card { padding: 1rem; }
}

/* ══════════ ENHANCED MOBILE 2026 ══════════ */

/* Mobile hamburger button */
.navbar-toggle {
  display: none;
  width: 36px; height: 36px;
  border: none; background: none;
  cursor: pointer; padding: 6px;
  flex-direction: column; justify-content: space-around;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.navbar-toggle:hover { background: var(--bg); }
.navbar-toggle span {
  display: block;
  width: 22px; height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s ease;
}
.navbar-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 149;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.sidebar-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* Mobile sidebar slide-in */
@media (max-width: 768px) {
  .navbar-toggle { display: flex; }
  .navbar-nav {
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 8px; gap: 2px;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 150;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .navbar-nav.open {
    transform: translateY(0);
    opacity: 1;
  }
  .navbar-nav a { padding: 10px 14px; font-size: 0.95rem; }
  .navbar-nav a.active::after { display: none; }
  .navbar-nav a.active { background: var(--primary-light); border-radius: var(--radius); }

  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 260px; height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    padding-top: 72px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar-overlay { display: block; }

  .main-content { margin-left: 0; padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: 0.72rem; }
  .btn { width: 100%; justify-content: center; }
  .btn-sm { width: auto; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap::after {
    content: '← Scroll →';
    display: block;
    text-align: center;
    padding: 6px;
    font-size: 0.7rem;
    color: var(--text3);
    background: var(--bg);
    opacity: 0.8;
  }
  table { min-width: 720px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .page-subtitle { margin-top: 0.5rem; }
  .search-bar { width: 100%; }
  .search-bar input { width: 100%; }
}

@media (max-width: 600px) {
  .main-content { padding: 0.75rem; }
  .page-title { font-size: 1.1rem; }
  .stat-icon { width: 30px; height: 30px; font-size: 0.9rem; }
  .stat-value { font-size: 1.1rem; }
  .status, .priority, .sentiment { padding: 3px 6px; font-size: 0.65rem; }
  .btn { padding: 10px 14px; font-size: 0.82rem; }
  .auth-card, .card { padding: 0.9rem; border-radius: 8px; }
  .modal { padding: 1rem; width: 95%; }
  .navbar { padding: 0 0.85rem; height: 54px; }
  .navbar-brand { font-size: 0.9rem; gap: 7px; }
  .navbar-brand .logo-icon { width: 28px; height: 28px; font-size: 0.7rem !important; }
  .sidebar { width: 240px; }
  h2 { font-size: 1.2rem !important; }
  h3 { font-size: 1rem !important; }
  .table-wrap { border-radius: 6px; }
  thead th { padding: 8px 10px; font-size: 0.7rem; }
  tbody td { padding: 8px 10px; font-size: 0.78rem; }
  .form-group { margin-bottom: 0.8rem; }
  .form-control { padding: 7px 10px; font-size: 0.85rem; }
}

/* Extra small screens */
@media (max-width: 400px) {
  .main-content { padding: 0.6rem; }
  .navbar { padding: 0 0.65rem; height: 50px; }
  .navbar-brand .brand-text { display: none; }
  .card { padding: 0.75rem; }
  .auth-card { padding: 0.75rem; }
  .stats-grid { gap: 0.6rem; }
  .stat-card { padding: 0.75rem; gap: 0.65rem; }
  .stat-value { font-size: 1rem; }
  .navbar-actions { gap: 4px; }
  .btn { padding: 8px 12px; font-size: 0.78rem; }
}

/* Hide glow cursor and particles on touch devices */
@media (hover: none) and (pointer: coarse) {
  #glow-cursor { display: none !important; }
  body::before, body::after { animation: none !important; opacity: 0.3; }
  #particles-canvas { display: none; }
  .card:hover { transform: none; }
  .stat-card:hover { transform: none; }
  .navbar-brand:hover .logo-icon { transform: none; }
  .btn:hover { transform: none; }
  .sidebar-link:active { background: var(--primary-light); }
}

/* Landscape mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .sidebar { width: 200px; padding-top: 66px; }
  .sidebar-link { padding: 5px 8px; font-size: 0.78rem; }
  .main-content { padding: 0.75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .navbar { height: 50px; }
  .layout { padding-top: 50px; }
}

/* Dark mode mobile sidebar */
[data-theme="dark"] .sidebar.open {
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .navbar-nav.open {
  border-bottom-color: rgba(58,75,100,0.8);
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .main-content { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}
