/* ========================================
   TITANSAAS PREMIUM - DESIGN SYSTEM V2
   Modern, Dark-Themed, Fully Responsive
   ======================================== */

:root {
  /* Brand Palette - Premium Indigo & Violet */
  --primary: #818cf8;
  /* Indigo 400 */
  --primary-hover: #6366f1;
  /* Indigo 500 */
  --secondary: #c084fc;
  /* Purple 400 */
  --accent: #2dd4bf;
  /* Teal 400 */

  /* Status Colors */
  --success: #34d399;
  /* Emerald 400 */
  --warning: #fbbf24;
  /* Amber 400 */
  --danger: #f87171;
  /* Red 400 */

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  --gradient-surface: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  --gradient-glow: radial-gradient(
    circle at 50% 0%,
    rgba(99, 102, 241, 0.15),
    transparent 70%
  );

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  /* Animations */
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   THEME VARIABLES
   ======================================== */
:root,
[data-theme="dark"] {
  --bg-page: #0f172a;
  /* Slate 900 */
  --bg-surface: #1e293b;
  /* Slate 800 */
  --bg-surface-2: #334155;
  /* Slate 700 */

  --text-main: #f8fafc;
  /* Slate 50 */
  --text-muted: #94a3b8;
  /* Slate 400 */
  --text-on-primary: #ffffff;

  --border-color: rgba(148, 163, 184, 0.1);
  --border-focus: rgba(99, 102, 241, 0.5);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  /* Slate 50 */
  --bg-surface: #ffffff;
  /* White */
  --bg-surface-2: #f1f5f9;
  /* Slate 100 */

  --text-main: #0f172a;
  /* Slate 900 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-on-primary: #ffffff;

  --border-color: #e2e8f0;
  /* Slate 200 */
  --border-focus: rgba(99, 102, 241, 0.5);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  overflow-x: hidden;
  padding-top: 5.5rem;
  /* Fix for fixed navbar covering titles */
}

/* Remove padding for dashboard pages */
body:has(.dashboard-layout) {
  padding-top: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* ========================================
   LAYOUT & UTILITIES
   ======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted) !important;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mt-3 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mb-3 {
  margin-bottom: 3rem;
}

/* Grid System - Ultra Responsive */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 640px) {
  .grid {
    gap: 1.5rem;
  }
}

/* ========================================
   COMPONENTS - BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  border: 1px solid transparent;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--gradient-hover);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* ========================================
   COMPONENTS - CARDS (Glassmorphism)
   ======================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-smooth),
    box-shadow 0.4s var(--ease-smooth);
  will-change: transform;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-focus);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: var(--gradient-surface);
  pointer-events: none;
  opacity: 0.6;
}

/* ========================================
   COMPONENTS - FORMS (Floating Labels)
   ======================================== */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-2);
  border: 2px solid transparent;
  border-radius: 0.75rem;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  background: var(--bg-page);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Floating Label Logic - Hide on Input */
.form-label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition:
    opacity 0.2s var(--ease-smooth),
    visibility 0.2s var(--ease-smooth);
  font-size: 1rem;
  background: transparent;
  padding: 0 0.25rem;
  opacity: 1;
  visibility: visible;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
select.form-input~.form-label {
  opacity: 0;
  visibility: hidden;
}

/* ========================================
   COMPONENTS - NAVBAR
   ======================================== */
/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-page);
}

.dashboard-content {
  flex: 1;
  margin-left: 260px !important;
  padding: 2rem;
  overflow-y: auto;
  transition: margin-left 0.3s var(--ease-smooth);
  width: calc(100% - 260px);
  min-height: 100vh;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .dashboard-content {
    margin-left: 0 !important;
    width: 100%;
    padding-top: 5rem;
    /* Space for mobile toggle/header */
  }
}

/* ========================================
   TOP NAVIGATION (Public & Admin Pages)
   ======================================== */
.navbar-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.5rem;
  background: rgba(30, 41, 59, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  z-index: 100;
  transition: all 0.3s var(--ease-smooth);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Enhanced shadow on scroll */
.navbar-top.scrolled {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom-color: rgba(148, 163, 184, 0.15);
}

.navbar-top .nav-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2.5rem;
  gap: 3rem;
}

.navbar-top .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.625rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s var(--ease-smooth);
  letter-spacing: -0.02em;
}

.textFont1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s var(--ease-smooth);
  letter-spacing: -0.02em;
}

.navbar-top .logo:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.navbar-top .nav-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-top .nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.625rem;
  color: rgba(248, 250, 252, 0.7);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.25s var(--ease-smooth);
  white-space: nowrap;
  position: relative;
}

.navbar-top .nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.625rem;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(168, 85, 247, 0.1)
  );
  opacity: 0;
  transition: opacity 0.25s var(--ease-smooth);
}

.navbar-top .nav-item:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.navbar-top .nav-item:hover::before {
  opacity: 1;
}

.navbar-top .nav-item.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.navbar-top .nav-item svg {
  position: relative;
  z-index: 1;
}

/* Mobile hamburger for top nav */
.navbar-top .hamburger {
  display: none;
}

@media (max-width: 768px) {
  .navbar-top .hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
  }

  .navbar-top .nav-links {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s var(--ease-smooth);
    pointer-events: none;
  }

  .navbar-top .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .navbar-top .nav-item {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ========================================
   SIDEBAR NAVIGATION (Dashboard Pages)
   ======================================== */
.navbar-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s var(--ease-elastic);
  overflow-y: auto;
}

.navbar-sidebar .nav-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  gap: 2rem;
}

.navbar-sidebar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  padding: 0 0.5rem;
}

.navbar-sidebar .nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  width: 100%;
}

.navbar-sidebar .nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--text-main);
  transform: translateX(4px);
}

.navbar-sidebar .nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Mobile Sidebar Styles */
@media (max-width: 768px) {
  .navbar-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .navbar-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }

  /* Hamburger Toggle Button */
  .hamburger {
    display: flex !important;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 32px;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
  }

  .hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }
}

.icon {
  font-size: 1.25rem;
  width: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========================================
   AUTH PAGES - SPLIT LAYOUT (Enhanced)
   ======================================== */
.split-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.split-brand {
  flex: 1;
  background-color: #0f172a;
  background-image:
    var(--gradient-glow),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  color: white;
  position: relative;
}

.split-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-page);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

/* Tablet Optimization (iPad Portrait) */
@media (max-width: 1024px) {
  .split-brand {
    display: none;
  }
}

/* ========================================
   HERO & LANDING
   ======================================== */
.hero {
  /* Reduced top padding since body now has padding-top */
  padding: 4rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.25) 0%,
    rgba(99, 102, 241, 0) 60%
  );
  pointer-events: none;
  z-index: -1;
  animation: pulse 8s ease-in-out infinite;
}

.badge-pill {
  display: inline-flex;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ========================================
   ANIMATIONS & EFFECTS
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.1);
  }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-smooth);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-delay-1 {
  transition-delay: 100ms;
}

.stagger-delay-2 {
  transition-delay: 200ms;
}

.stagger-delay-3 {
  transition-delay: 300ms;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: 1rem;
  border-radius: 0.75rem;
  border-left: 4px solid;
  margin-bottom: 1.5rem;
  background: var(--bg-surface-2);
}

.alert-error {
  border-color: var(--danger);
  color: var(--danger);
}

.alert-success {
  border-color: var(--success);
  color: var(--success);
}

/* ========================================
   COMPONENTS - TABLES (Data Grid)
   ======================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  /* Required for border-radius on rows */
  border-spacing: 0;
  font-size: 0.95rem;
}

/* Mobile Table Card View */
@media screen and (max-width: 768px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
  }

  .data-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .data-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-surface);
    overflow: hidden;
  }

  .data-table td {
    border: none;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 40%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    text-align: right;
  }

  .data-table td:before {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    width: 35%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
  }

  /* Add labels via nth-child as a fallback, 
     though explicit data-label attributes in HTML would be better */
  .data-table td:nth-of-type(1):before {
    content: "Column 1";
  }

  .data-table td:nth-of-type(2):before {
    content: "Column 2";
  }

  .data-table td:nth-of-type(3):before {
    content: "Column 3";
  }

  .data-table td:nth-of-type(4):before {
    content: "Column 4";
  }

  .data-table td:nth-of-type(5):before {
    content: "Column 5";
  }

  .data-table td:nth-of-type(6):before {
    content: "Actions";
  }
}

.data-table th {
  background: rgba(30, 41, 59, 0.5);
  /* Semi-transparent header */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  transition: background-color 0.2s;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: all 0.2s var(--ease-smooth);
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-2);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-active,
.badge-published {
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-warning,
.badge-draft {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-danger,
.badge-archived,
.badge-failed {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-ghost {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Editable Cells */
.editable-cell {
  position: relative;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s;
  padding-right: 1.5rem;
  /* Space for edit icon */
}

.editable-cell:hover {
  background: var(--bg-surface-2);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--border-color);
}

/* Edit Icon (using pseudo-element) */
.editable-cell:hover::after {
  content: "✎";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  opacity: 0.7;
}

.editable-cell.editing {
  background: var(--bg-page);
  padding: 0;
  /* Remove padding for input */
  box-shadow: 0 0 0 2px var(--primary);
}

.editable-cell.editing::after {
  display: none;
}

.edit-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 1rem 1.5rem;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

.theme-toggle {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  font-size: 1.375rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all 0.3s var(--ease-smooth);
  z-index: 100;
}

.theme-toggle:hover {
  color: var(--primary);
  transform: rotate(15deg) scale(1.05);
  box-shadow:
    0 10px 15px rgba(0, 0, 0, 0.2),
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.theme-toggle:active {
  transform: rotate(15deg) scale(0.95);
}

/* ========================================
   USER DROPDOWN MENU
   ======================================== */
.user-menu-container {
  margin-top: auto;
  position: relative;
  width: 100%;
}

.user-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex !important;
  /* Force flex */
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.2s;
}

.user-btn:hover,
.user-btn:focus {
  background-color: var(--bg-surface-2);
  color: var(--text-main);
}

.dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.user-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  z-index: 100;
  animation: slideUp 0.2s ease-out;
}

.user-dropdown.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background-color: var(--bg-surface-2);
  color: var(--text-main);
  transform: translateX(4px);
}

.dropdown-item.text-danger {
  color: var(--danger);
}

.dropdown-item.text-danger:hover {
  background-color: rgba(248, 113, 113, 0.1);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Theme Toggle Styling */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.5rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: rotate(15deg);
}

/* Sidebar footer toggle specific */
.navbar-sidebar .theme-toggle {
  margin-top: auto;
  width: 100%;
  border-radius: 8px;
  justify-content: flex-start;
  padding: 12px 16px;
  gap: 12px;
}

.navbar-sidebar .theme-toggle::after {
  content: "";
  font-size: 0.5rem;
  font-weight: 500;
}
