@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #0c0f12;
  --bg-2: #141924;
  --card: rgba(18, 22, 30, 0.82);
  --muted: #8d99aa;
  --text: #eef3ff;
  --accent: #f6b86b;
  --accent-2: #ff7a66;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

body.light-theme {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #1e293b;
  --accent: #f59e0b;
  --accent-2: #ea580c;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Light theme: override the gradient background */
body.light-theme {
  background: #f1f5f9;
}

/* Light theme: hide the colorful orbs */
body.light-theme .bg-orb {
  display: none;
}

body.light-theme .bg-grid {
  opacity: 0.03;
}

/* Light theme: Sidebar stays dark for contrast */
body.light-theme .side {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-right: 1px solid #334155;
}

body.light-theme .side .nav-item {
  color: #94a3b8;
}

body.light-theme .side .nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

body.light-theme .side .nav-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-left: 3px solid #f59e0b;
}

body.light-theme .side .user-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

body.light-theme .side .ghost-btn {
  color: #94a3b8;
  border-color: #475569;
}

body.light-theme .side .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Light theme: Main content area */
body.light-theme .main {
  background: #f8fafc;
}

body.light-theme .page-head h1 {
  color: #0f172a;
}

body.light-theme .page-head p {
  color: #64748b;
}

/* Light theme: Cards and panels with shadows and rounded corners */
body.light-theme .panel,
body.light-theme .stat-card,
body.light-theme .login-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.light-theme .stat-card {
  border-radius: 12px;
}

body.light-theme .stat-label {
  color: #64748b;
}

body.light-theme .stat-value {
  color: #0f172a;
}

body.light-theme .stat-meta {
  color: #94a3b8;
}

/* Light theme: Form inputs with clean borders */
body.light-theme .field input,
body.light-theme .field select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #1e293b;
}

body.light-theme .field input:focus,
body.light-theme .field select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  outline: none;
}

body.light-theme .field input::placeholder {
  color: #94a3b8;
}

body.light-theme .field span {
  color: #475569;
}

/* Light theme: Buttons */
body.light-theme .primary-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

body.light-theme .primary-btn:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

body.light-theme .ghost-btn {
  color: #475569;
  border-color: #cbd5e1;
  border-radius: 10px;
}

body.light-theme .ghost-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

/* Light theme: Tables */
body.light-theme .table-row {
  background: #475569;
  border-bottom: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  transition: all 0.2s ease;
}

body.light-theme .table-row div {
  color: #ffffff;
}

body.light-theme .table-row:hover {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-theme .table-row:hover div {
  color: #1e293b;
}

body.light-theme .table-row .ghost-btn {
  color: #e2e8f0;
  border-color: #94a3b8;
}

body.light-theme .table-row:hover .ghost-btn {
  color: #475569;
  border-color: #cbd5e1;
}

body.light-theme .table-head {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  border-radius: 10px 10px 0 0;
}

body.light-theme .table-head div {
  color: #475569;
}

/* Light theme: Tags */
body.light-theme .tag {
  background: #e2e8f0;
  color: #475569;
  border-radius: 6px;
}

/* Light theme: Modal */
body.light-theme .modal-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Light theme: Alerts */
body.light-theme .alert {
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
}

/* Light theme: Check cards (permissions grid) */
body.light-theme .check-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

body.light-theme .check-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

body.light-theme .check-card input[type="checkbox"] {
  accent-color: #f59e0b;
  width: 18px;
  height: 18px;
}

body.light-theme .check-card .tag {
  background: #f1f5f9;
  color: #64748b;
}

/* Light theme: Access grid area */
body.light-theme .access-grid {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* Light theme: Select dropdown */
body.light-theme select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #1e293b;
  padding: 10px 12px;
}

body.light-theme select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  outline: none;
}

/* Light theme: Panel headers */
body.light-theme .panel h2 {
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

body.light-theme .panel-head h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #1a2130, var(--bg));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  z-index: 0;
}

.orb-1 {
  background: #ff8a65;
  top: -120px;
  right: -80px;
}

.orb-2 {
  background: #4dd4ff;
  bottom: -140px;
  left: -120px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  animation: fadeUp 0.6s ease;
}

.side {
  padding: 28px 24px;
  background: linear-gradient(160deg, rgba(18, 22, 30, 0.95), rgba(10, 12, 16, 0.85));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  padding: 10px 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #131313;
  border-radius: 14px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.side-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-pill {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.main {
  padding: 32px 40px 40px;
}

.view {
  display: none;
  animation: fadeUp 0.5s ease;
}

.view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 32px;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.stat-meta {
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* Action Cards - Modern Quick Actions */
.panel-grid .ghost-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  min-height: 120px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.panel-grid .ghost-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.panel-grid .ghost-btn::after {
  font-size: 28px;
  display: block;
  order: -1;
  transition: transform 0.3s ease;
}

.panel-grid .ghost-btn:nth-child(1)::after {
  content: '👤';
}

.panel-grid .ghost-btn:nth-child(2)::after {
  content: '📹';
}

.panel-grid .ghost-btn:nth-child(3)::after {
  content: '🔐';
}

.panel-grid .ghost-btn:nth-child(4)::after {
  content: '📈';
}

.panel-grid .ghost-btn:nth-child(5)::after {
  content: '📜';
}

.panel-grid .ghost-btn:hover {
  background: linear-gradient(145deg, rgba(246, 184, 107, 0.08) 0%, rgba(255, 122, 102, 0.05) 100%);
  border-color: rgba(246, 184, 107, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.panel-grid .ghost-btn:hover::before {
  opacity: 1;
}

.panel-grid .ghost-btn:hover::after {
  transform: scale(1.15);
}

.panel-grid .ghost-btn:active {
  transform: translateY(-2px);
}

/* Light theme action cards */
body.light-theme .panel-grid .ghost-btn {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .panel-grid .ghost-btn:hover {
  background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  background: rgba(10, 12, 16, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.primary-btn {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #151515;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(255, 122, 102, 0.3);
}

.ghost-btn {
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.alert {
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
}

.table {
  display: grid;
  gap: 10px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 0.6fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border);
  font-size: 13px;
}

.table-head {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 11px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.6);
  font-size: 13px;
}

.login-card {
  max-width: 380px;
  margin: 60px auto;
  padding: 28px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card .primary-btn {
  margin-top: 24px;
  width: 100%;
}

.login-card h1 {
  margin-top: 0;
}

/* Login view fullscreen centered layout */
#login-view.active~* {
  display: none;
}

#login-view.active {
  position: fixed;
  inset: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: radial-gradient(circle at top left, #1a2130, var(--bg));
  padding: 20px;
}

/* Login view background decoration */
#login-view.active::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  background: #ff8a65;
  top: -120px;
  right: -80px;
  z-index: -1;
}

#login-view.active::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  background: #4dd4ff;
  bottom: -140px;
  left: -120px;
  z-index: -1;
}

/* Light theme login view */
body.light-theme #login-view.active {
  background: #f1f5f9;
}

body.light-theme #login-view.active::before,
body.light-theme #login-view.active::after {
  display: none;
}

/* Hide sidebar when login is active */
body:has(#login-view.active) .side {
  display: none !important;
}

body:has(#login-view.active) .mobile-menu {
  display: none !important;
}

body:has(#login-view.active) .main {
  margin: 0 !important;
  padding: 0 !important;
}

body:has(#login-view.active) .app-shell {
  display: block;
}

/* Ensure login-card stays properly styled */
#login-view.active .login-card {
  margin: 0;
  max-width: 400px;
  width: 100%;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
    background: rgba(18, 22, 30, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    font-size: 14px;
    padding: 8px 10px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-sub {
    display: none;
  }

  .nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(18, 22, 30, 0.98);
    backdrop-filter: blur(10px);
    padding: 12px;
    gap: 8px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }

  .nav-item {
    padding: 10px 14px;
    font-size: 13px;
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .side-footer {
    display: none;
  }

  .main {
    margin-top: 116px;
    padding: 16px;
    min-height: calc(100vh - 116px);
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 28px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-grid .ghost-btn {
    min-height: 80px;
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .access-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    margin: 20px;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 12px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
    margin: 0;
    order: -1;
    min-width: 50px;
  }

  .stat-label {
    margin-bottom: 2px;
  }

  .stat-meta {
    display: none;
  }

  /* Tablas responsivas - formato tarjeta */
  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }

  .table-row div {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-row div::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    opacity: 0.7;
  }

  .table-row div:last-child {
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .table-row .ghost-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .access-grid {
    grid-template-columns: 1fr;
  }

  .check-card {
    padding: 14px;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .primary-btn,
  .ghost-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .field input,
  .field select {
    padding: 12px 14px;
    font-size: 16px;
    /* Evita zoom en iOS */
  }

  .login-card {
    padding: 20px;
    margin: 12px;
  }

  .login-card h1 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .nav {
    top: 56px;
    padding: 8px;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 70px;
  }

  .main {
    margin-top: 110px;
    padding: 10px;
  }

  .page-head h1 {
    font-size: 20px;
  }

  .panel {
    padding: 12px;
    margin-bottom: 16px;
  }

  .panel h2 {
    font-size: 16px;
  }

  .modal-content {
    border-radius: 16px;
    margin: 10px;
  }

  .modal-head {
    padding: 14px;
  }

  .modal-head h3 {
    font-size: 16px;
  }
}


.nav-item:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Log and Group refined tags */
.tag-group {
  background: var(--accent);
  color: #151515;
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

#logsTable .table-row {
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr;
}

/* Modal Preview */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(0);
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-head {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  position: relative;
  background: #000;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.modal-loader {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 122, 102, 0.2);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Mobile: Light theme adjustments */
@media (max-width: 980px) {
  body.light-theme .side {
    background: rgba(30, 41, 59, 0.98);
  }

  body.light-theme .nav {
    background: rgba(30, 41, 59, 0.98);
  }
}

/* Floating user menu for mobile */
.mobile-user-btn {
  display: none;
}

/* Mobile menu hidden by default on all screens */
.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .mobile-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #151515;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .mobile-user-btn:active {
    transform: scale(0.95);
  }

  .mobile-menu {
    display: none;
    position: fixed;
    top: 56px;
    right: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    z-index: 200;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
  }

  .mobile-menu.active {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-menu .ghost-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 13px;
  }

  .mobile-menu .user-pill {
    padding: 8px 12px;
    margin-bottom: 4px;
    font-size: 11px;
    text-align: center;
  }

  body.light-theme .mobile-menu {
    background: #ffffff;
    border-color: #e2e8f0;
  }
}