/* CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

/* Shadcn-inspired CSS Variables */
:root {
  /* Colors */
  --background: 0 0% 100%;
  --foreground: 0 0% 100%;

  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;

  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;

  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;

  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;

  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;

  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;

  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;

  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;

  --radius: 25px;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;

  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;

  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;

  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;

  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;

  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;

  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;

  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;

  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 48%;
}

* {
  border-color: hsl(var(--border));
}

body {
  background: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 250px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.admin-main {
  flex: 1;
  margin-left: 250px;
  padding: 2rem;
}

.admin-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  padding: 1rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
}

/* Sidebar Navigation */
.sidebar-brand {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  margin: 0.25rem 1rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #666666;
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.2s;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
}

.sidebar-nav-icon {
  margin-right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
}

/* Cards */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.card-description {
  color: #666666;
  margin-top: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #427eea;
  color: #ffffff;
  border: 1px solid #427eea;
  box-shadow: 0 4px 16px 0 rgba(66, 126, 234, 0.2);
}

.btn-primary:hover {
  background: #3570d9;
  box-shadow: 0 6px 20px 0 rgba(66, 126, 234, 0.3);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.btn-outline {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: #1a1a1a;
}

.table thead {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 500;
  color: #666666;
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  text-align: left;
}

.table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-default {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(10px);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(251, 146, 60, 0.15);
  backdrop-filter: blur(10px);
  color: #ea580c;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-destructive {
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(10px);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #1a1a1a;
}

.form-control::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.form-control:focus {
  outline: none;
  border-color: #427eea;
  box-shadow: 0 0 0 3px rgba(66, 126, 234, 0.1);
  background: #ffffff;
}

.form-control.border-red-500 {
  border-color: #ef4444;
}

.form-control.border-red-500:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-text {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.875rem;
  color: #666666;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
}

.stat-change {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  color: #666666;
}

.stat-change.positive {
  color: rgba(16, 185, 129, 1);
}

.stat-change.negative {
  color: rgba(239, 68, 68, 1);
}

/* Utilities */
.text-muted {
  color: #666666;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

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

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

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

.flex {
  display: flex;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

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

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

.ml-4 {
  margin-left: 1rem;
}

.items-end {
  align-items: flex-end;
}

.flex-1 {
  flex: 1;
}

/* Alert */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid;
}

.alert-success {
  background-color: hsl(142.1 76.2% 36.3% / 0.1);
  border-color: hsl(142.1 76.2% 36.3%);
  color: hsl(142.1 76.2% 36.3%);
}

.alert-warning {
  background-color: hsl(38 92% 50% / 0.1);
  border-color: hsl(38 92% 50%);
  color: hsl(38 92% 50%);
}

.alert-destructive {
  background-color: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive));
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.pagination-link {
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  text-decoration: none;
  color: #000000;
  transition: all 0.2s;
}

.pagination-link:hover,
.pagination-link.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: hsl(0 0% 0% / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.modal-header {
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}