:root {
  --background: 36 33% 97%;
  --foreground: 24 30% 14%;
  --card: 0 0% 100%;
  --card-foreground: 24 30% 14%;
  --popover: 0 0% 100%;
  --popover-foreground: 24 30% 14%;
  --primary: 20 52% 50%;
  --primary-foreground: 0 0% 100%;
  --secondary: 30 20% 94%;
  --secondary-foreground: 24 30% 14%;
  --muted: 30 18% 94%;
  --muted-foreground: 30 18% 45%;
  --accent: 30 20% 94%;
  --accent-foreground: 24 30% 14%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 28 20% 88%;
  --input: 30 18% 94%;
  --ring: 20 52% 50%;
  --radius: 0.75rem;
}

*,::before,::after { box-sizing: border-box; }

.text-foreground { color: hsl(var(--foreground)); }
.text-foreground\/80 { color: hsl(var(--foreground) / 0.8); }
.text-background { color: hsl(var(--background)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }

.bg-background { background-color: hsl(var(--background)); }
.bg-background\/50 { background-color: hsl(var(--background) / 0.5); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-foreground\/70 { background-color: hsl(var(--foreground) / 0.7); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-primary\/20 { background-color: hsl(var(--primary) / 0.2); }
.bg-primary\/90 { background-color: hsl(var(--primary) / 0.9); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-secondary\/30 { background-color: hsl(var(--secondary) / 0.3); }
.bg-secondary\/50 { background-color: hsl(var(--secondary) / 0.5); }
.bg-secondary\/80 { background-color: hsl(var(--secondary) / 0.8); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-muted\/30 { background-color: hsl(var(--muted) / 0.3); }
.bg-muted\/50 { background-color: hsl(var(--muted) / 0.5); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-destructive\/10 { background-color: hsl(var(--destructive) / 0.1); }

.border-border { border-color: hsl(var(--border)); }
.border-border\/50 { border-color: hsl(var(--border) / 0.5); }
.border-input { border-color: hsl(var(--input)); }
.border-primary { border-color: hsl(var(--primary)); }
.border-destructive\/50 { border-color: hsl(var(--destructive) / 0.5); }

.divide-border\/50 > :not([hidden]) ~ :not([hidden]) { border-color: hsl(var(--border) / 0.5); }

.ring-primary\/50 { --tw-ring-color: hsl(var(--primary) / 0.5); }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--tw-ring-color, hsl(var(--ring))); }
.focus\:ring-primary\/50:focus { --tw-ring-color: hsl(var(--primary) / 0.5); }
.focus\:border-primary:focus { border-color: hsl(var(--primary)); }
.focus\:outline-none:focus { outline: none; }

.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.shadow-primary\/20 { --tw-shadow-color: hsl(var(--primary) / 0.2); box-shadow: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); }

.hover\:bg-primary\/90:hover { background-color: hsl(var(--primary) / 0.9); }
.hover\:bg-accent:hover { background-color: hsl(var(--accent)); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-red-400:hover { color: #f87171; }
.hover\:bg-red-500\/10:hover { background-color: rgba(239,68,68,0.1); }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-all { transition: all 0.15s ease; }
.transition-opacity { transition: opacity 0.15s ease; }
.accent-primary { accent-color: hsl(var(--primary)); }

.peer:checked ~ .peer-checked\:bg-primary { background-color: hsl(var(--primary)); }
.peer:checked ~ .peer-checked\:after\:translate-x-full::after { transform: translateX(100%); }
.peer:checked ~ .peer-checked\:after\:border-white::after { border-color: white; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.after\:content-\[\'\ \'\]::after,
.after\:content-\[\'\'\]::after { content: ''; }
.after\:absolute::after { position: absolute; }
.after\:top-\[2px\]::after { top: 2px; }
.after\:left-\[2px\]::after { left: 2px; }
.after\:bg-foreground\/70::after { background-color: hsl(var(--foreground) / 0.7); }
.after\:rounded-full::after { border-radius: 9999px; }
.after\:h-4::after { height: 1rem; }
.after\:w-4::after { width: 1rem; }
.after\:transition-all::after { transition: all 0.15s ease; }

.bg-blue-500\/10 { background-color: rgba(59,130,246,0.1); }
.bg-blue-500\/20 { background-color: rgba(59,130,246,0.2); }
.bg-blue-600\/20 { background-color: rgba(37,99,235,0.2); }
.bg-blue-600\/30 { background-color: rgba(37,99,235,0.3); }
.hover\:bg-blue-600\/30:hover { background-color: rgba(37,99,235,0.3); }
.text-blue-400 { color: #60a5fa; }
.text-blue-300 { color: #93c5fd; }
.border-blue-500\/20 { border-color: rgba(59,130,246,0.2); }
.border-blue-500\/30 { border-color: rgba(59,130,246,0.3); }
.bg-emerald-500\/20 { background-color: rgba(16,185,129,0.2); }
.bg-emerald-600\/20 { background-color: rgba(5,150,105,0.2); }
.bg-emerald-600\/30 { background-color: rgba(5,150,105,0.3); }
.hover\:bg-emerald-600\/30:hover { background-color: rgba(5,150,105,0.3); }
.text-emerald-400 { color: #34d399; }
.border-emerald-500\/30 { border-color: rgba(16,185,129,0.3); }
.bg-red-500\/20 { background-color: rgba(239,68,68,0.2); }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.bg-amber-500\/20 { background-color: rgba(245,158,11,0.2); }
.text-amber-400 { color: #fbbf24; }
.bg-violet-500\/20 { background-color: rgba(139,92,246,0.2); }
.text-violet-400 { color: #a78bfa; }
.bg-green-500\/20 { background-color: rgba(34,197,94,0.2); }
.text-green-400 { color: #4ade80; }

.bg-black\/60 { background-color: rgba(0,0,0,0.6); }
.bg-black\/80 { background-color: rgba(0,0,0,0.8); }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(194, 112, 62, 0.05); }
  50% { box-shadow: 0 0 35px rgba(194, 112, 62, 0.1); }
}
@keyframes border-glow {
  0%, 100% { border-color: rgba(194, 112, 62, 0.08); }
  50% { border-color: rgba(194, 112, 62, 0.2); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes orb-drift {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-10px, -35px) scale(0.95); }
  75% { transform: translate(-30px, -10px) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
.animate-slide-up { animation: slide-up 0.3s ease-out; }
.animate-fade-in { animation: fade-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-scale-in { animation: scale-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-spin { animation: spin 1s linear infinite; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
html, body {
  background: #faf8f5;
  font-family: "Inter", system-ui, sans-serif;
  color: hsl(var(--foreground));
}
code, pre, .font-mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4c8bc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b5a48e; }

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 20s ease-in-out infinite;
}

.admin-layout {
  display: flex;
  min-height: calc(100vh - 56px);
  position: relative;
  z-index: 1;
}
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  padding: 24px 16px;
  border-right: 1px solid #e8dfd8;
  background: rgba(250,248,245,0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.admin-sidebar .sidebar-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b5a48e;
  padding: 0 12px;
  margin-bottom: 8px;
}
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  max-width: 100%;
}
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e8dfd8;
    padding: 12px 16px;
  }
  .sidebar-nav { display: flex; gap: 4px; overflow-x: auto; }
  .admin-content { padding: 16px; }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-btn {
  position: relative;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #8b7355;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover {
  color: #5c4d3c;
  background: rgba(194, 112, 62, 0.04);
}
.tab-btn.active-tab {
  color: #c2703e !important;
  background: rgba(194, 112, 62, 0.08) !important;
  border-color: rgba(194, 112, 62, 0.15) !important;
  box-shadow: 0 0 15px rgba(194, 112, 62, 0.05);
  font-weight: 600;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
  border: 1px solid #e8dfd8;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 112, 62, 0.15), transparent);
}
.stat-card:hover {
  border-color: rgba(194, 112, 62, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(45, 32, 23, 0.08), 0 0 20px rgba(194, 112, 62, 0.04);
}

.config-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff !important;
  border: 1px solid #e8dfd8 !important;
}
.config-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 112, 62, 0.15), transparent);
}
.config-card:hover {
  border-color: rgba(194, 112, 62, 0.18) !important;
  box-shadow: 0 8px 30px rgba(45, 32, 23, 0.06);
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e8dfd8;
}
.glass-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194, 112, 62, 0.15), transparent);
}

select, input, textarea {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background: #faf8f5 !important;
  border-color: #e8dfd8 !important;
  color: #2d2017 !important;
}
select:focus, input:focus, textarea:focus {
  border-color: rgba(194, 112, 62, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(194, 112, 62, 0.06), 0 0 20px rgba(194, 112, 62, 0.04) !important;
  background: #ffffff !important;
}
button {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
button:active:not(:disabled) {
  transform: scale(0.97) !important;
}
table tbody tr {
  transition: background 0.15s ease;
}
table tbody tr:hover {
  background: rgba(194, 112, 62, 0.03);
}
table thead {
  background: rgba(194, 112, 62, 0.02);
}

.modal-glass {
  background: #ffffff !important;
  border: 1px solid #e8dfd8 !important;
  box-shadow: 0 25px 80px rgba(45, 32, 23, 0.15), 0 0 40px rgba(194, 112, 62, 0.05) !important;
}

.gen-btn-primary {
  background: linear-gradient(135deg, #c2703e, #d4764e);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(194, 112, 62, 0.25);
  position: relative;
  overflow: hidden;
}
.gen-btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
}
.gen-btn-primary:hover {
  box-shadow: 0 8px 30px rgba(194, 112, 62, 0.35);
  transform: translateY(-1px);
}
