:root {
  --primary: oklch(0.6 0.18 260);
  --primary-foreground: oklch(0.98 0.01 260);
  --background: oklch(0.98 0.01 260);
  --foreground: oklch(0.2 0.02 260);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.2 0.02 260);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.2 0.02 260);
  --border: oklch(0.92 0.01 260);
  --input: oklch(1 0 0);
  --ring: oklch(0.6 0.18 260);
  --muted: oklch(0.96 0.01 260);
  --muted-foreground: oklch(0.45 0.02 260);
  --accent: oklch(0.96 0.01 260);
  --accent-foreground: oklch(0.2 0.02 260);
  --success: oklch(0.65 0.16 155);
  --warning: oklch(0.65 0.2 45);
  --destructive: oklch(0.6 0.18 25);
  --radius: 1rem;
  --gradient-primary: linear-gradient(135deg, oklch(0.6 0.18 260), oklch(0.5 0.18 280));
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background-color: var(--background);
}

.sidebar {
  width: 280px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 0;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary);
  background: var(--accent);
  padding: 0.5rem;
  border-radius: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

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

.sidebar-nav a i {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--primary);
  background: var(--accent);
}

.sidebar-nav a.active {
  font-weight: 600;
  background: var(--primary);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.logout-btn {
  color: var(--muted-foreground);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: var(--destructive);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 101;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.user-badge {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.content {
  padding: 2rem;
  flex: 1;
}

.alerts-container {
  padding: 1rem 2rem 0;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: 20px 0 25px -5px rgba(0,0,0,0.1);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .top-bar {
    padding: 0 1rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-error { background: var(--destructive); color: white; }
.badge-info { background: var(--primary); color: white; }

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(104, 117, 245, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.login-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, oklch(0.9 0.05 260), var(--background));
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--muted-foreground);
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(104, 117, 245, 0.2);
}

.alert {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: var(--destructive);
  color: white;
}
