/**
 * Backend Global CSS Variables
 * Change here to update theme everywhere
 */
:root {
  /* Brand palette - modern navy + teal */
  --primary: #2563eb;              /* primary action / highlights */
  --primary-soft: #1d4ed8;
  --primary-text: #ffffff;

  --accent-teal: #22c1c3;

  /* Layout backgrounds (slightly lighter, more premium) */
  --shell-bg: #0b1220;             /* page background */
  --sidebar-bg: #0b1324;           /* sidebar background */
  --navbar-bg: #0b1324cc;          /* blurred style over shell */
  --main-bg: #0b1220;              /* main area base */
  --main-surface: #0b1324;         /* top-level cards background */
  --card-bg: #0b1324;              /* cards share same tone for simplicity */
  --card-elevated-bg: #0f1a33;     /* reserved if you want elevation */

  /* Sidebar */
  --sidebar-width: 15rem;
  --sidebar-text: #93a4bd;
  --sidebar-text-muted: #6b7c96;
  --sidebar-text-active: #eef6ff;
  --sidebar-icon: #8a9ab2;
  --sidebar-icon-active: #eef6ff;
  --sidebar-active-bg: #0f1a33;
  --sidebar-active-border: #2563eb;
  --sidebar-logo-text: #eef6ff;
  --sidebar-nav-gap: 0.25rem;

  /* Navbar */
  --navbar-height: 4.25rem;
  --navbar-text: #eef6ff;
  --navbar-subtitle: #93a4bd;
  --navbar-icon: #b6c2d4;
  --navbar-chip-bg: #0b1220;

  /* Status */
  --status-success: #22c55e;
  --status-success-bg: rgba(34, 197, 94, 0.18);
  --status-warning: #fbbf24;
  --status-warning-bg: rgba(251, 191, 36, 0.2);
  --status-neutral: #64748b;

  /* Typography */
  --text-primary: #eef6ff;
  --text-secondary: #b6c2d4;
  --text-muted: #93a4bd;
  --text-on-strong: #0b1220;

  /* Radius & spacing */
  --radius-sm: 0.4rem;
  --radius-md: 0.7rem;
  --radius-lg: 0.9rem;
  --radius-xl: 1.25rem;
  --sidebar-padding-x: 1.4rem;
  --sidebar-padding-y: 1.2rem;
  --content-padding: 1.75rem;

  /* Shadows */
  --shadow-soft: 0 22px 60px rgba(2, 6, 23, 0.55);
}

/* Variable-based utility classes for layout */
.shell-bg { background-color: var(--shell-bg); }
.sidebar-bg {
  background-color: var(--sidebar-bg);
  background-image: radial-gradient(900px 600px at 30% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
                    radial-gradient(800px 500px at 80% 30%, rgba(34, 193, 195, 0.10), transparent 60%);
}
.sidebar-w { width: var(--sidebar-width); min-width: var(--sidebar-width); }
.sidebar-text { color: var(--sidebar-text); }
.sidebar-text-muted { color: var(--sidebar-text-muted); }
.sidebar-text-active { color: var(--sidebar-text-active); }
.sidebar-icon { color: var(--sidebar-icon); }
.sidebar-icon-active { color: var(--sidebar-icon-active); }
.sidebar-active-bg { background-color: var(--sidebar-active-bg); }
.sidebar-active-border { border-left: 3px solid var(--sidebar-active-border); }
.sidebar-logo-text { color: var(--sidebar-logo-text); }

.navbar-bg {
  background-color: var(--navbar-bg);
  background-image: radial-gradient(800px 300px at 20% 0%, rgba(37, 99, 235, 0.16), transparent 55%);
  backdrop-filter: blur(16px);
}
.navbar-text { color: var(--navbar-text); }
.navbar-subtitle { color: var(--navbar-subtitle); }
.navbar-icon { color: var(--navbar-icon); }
.navbar-chip-bg { background-color: var(--navbar-chip-bg); }

.main-bg { background-color: var(--main-bg); }
.surface-main { background-color: var(--main-surface); box-shadow: var(--shadow-soft); }
.card-bg { background-color: var(--card-bg); }
.card-elevated { background-color: var(--card-elevated-bg); box-shadow: var(--shadow-soft); }

.primary-bg { background-color: var(--primary); }
.primary-soft-bg { background-color: var(--primary-soft); }
.primary-text { color: var(--primary-text); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.status-success { color: var(--status-success); background-color: var(--status-success-bg); }
.status-warning { color: var(--status-warning); background-color: var(--status-warning-bg); }
.status-neutral { color: var(--status-neutral); }

.radius-sm { border-radius: var(--radius-sm); }
.radius-md { border-radius: var(--radius-md); }
.radius-lg { border-radius: var(--radius-lg); }
.radius-xl { border-radius: var(--radius-xl); }

/* Sidebar toggle behavior */
/* Responsive sidebar layout:
   - Mobile: off-canvas, opens with .sidebar-open
   - Desktop: visible by default, collapses with .sidebar-collapsed */
.app-sidebar {
  transform: translateX(-100%);
}
.app-shell {
  margin-left: 0;
}

body.sidebar-open .app-sidebar {
  transform: translateX(0);
}
body.sidebar-open .app-overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .app-sidebar {
    transform: translateX(0);
  }
  .app-shell {
    margin-left: var(--sidebar-width);
  }
  body.sidebar-open .app-overlay {
    opacity: 0;
    pointer-events: none;
  }
  body.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .app-shell {
    margin-left: 0;
  }
}

.app-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
  z-index: 25;
}


/* Global Form Styles */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  background-color: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  background-color: rgba(2, 6, 23, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.form-select {
  width: 100%;
  background-color: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  color: var(--text-primary);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2393a4bd'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
}

.form-select:focus {
  border-color: var(--primary);
  background-color: rgba(2, 6, 23, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-select option {
  background-color: var(--sidebar-bg);
  color: var(--text-primary);
  padding: 10px;
}

.auth-card {
  background-color: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-xl);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--primary-soft);
  transform: translateY(-1.5px);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
  transform: translateY(0);
}
