:root {
  --bg-color: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --panel-bg: rgba(30, 41, 59, 0.4);
  --panel-border: rgba(255, 255, 255, 0.1);
  --danger-color: #ef4444;
  --success-color: #10b981;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
  background-attachment: fixed;
  line-height: 1.6;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--panel-border);
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Glassmorphism Cards */
.card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--panel-border);
  cursor: pointer;
}

.card h2 {
  font-size: 1.5rem;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0.7;
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 1rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th {
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-main);
  font-size: 0.95rem;
  vertical-align: middle;
  transition: background-color 0.2s;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Buttons */
button {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(0);
}

button.danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  box-shadow: none;
}

button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #fff;
}

/* Inputs */
input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  color: white;
  width: 100%;
  font-family: var(--font-family);
  outline: none;
  transition: all 0.2s;
}

input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Login */
#login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-box {
  background: rgba(30, 41, 59, 0.8);
  padding: 3rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-box h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-box button {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
}

/* Active / Inactive status badges */
/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  /* Fully rounded pill shape */
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  backdrop-filter: blur(4px);
}

/* Status variants */
.status-active,
.badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.status-inactive,
.badge.status-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

/* Utility / Toggle */
.toggle-arrow {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.collapsible-content {
  /* Use display instead of max-height to avoid cutting off content */
  display: block;
  opacity: 1;
  transition: opacity 0.3s ease;
  margin-top: 1rem;
}

.collapsible-content.collapsed {
  display: none;
  opacity: 0;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}