/* Google Fonts loaded via <link> tag in layout.html for non-blocking load */

:root {
  /* Surface & Background */
  --bg:           #f8fafc;
  --sidebar-bg:   #ffffff;
  --card-bg:      #ffffff;
  --header-bg:    #ffffff;
  
  /* Borders */
  --border:       #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #6366f1;

  /* Typography */
  --text-main:    #0f172a;
  --text-muted:   #475569;
  --text-light:   #94a3b8;
  --text-inverse: #ffffff;

  /* Accent Colors */
  --primary:      #4f46e5;
  --primary-hover:#4338ca;
  --primary-subtle:#eef2ff;
  --primary-border:#c7d2fe;

  --success:      #10b981;
  --success-subtle:#ecfdf5;
  --success-border:#a7f3d0;
  --success-text: #047857;

  --warning:      #f59e0b;
  --warning-subtle:#fffbeb;
  --warning-border:#fde68a;
  --warning-text: #b45309;

  --danger:       #ef4444;
  --danger-subtle:#fef2f2;
  --danger-border:#fecaca;
  --danger-text:  #b91c1c;

  --purple:       #8b5cf6;
  --purple-subtle:#f5f3ff;
  --purple-border:#ddd6fe;
  --purple-text:  #6d28d9;

  /* Dimensions & Elevation */
  --sidebar-w:    240px;
  --header-h:     60px;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --shadow-xs:    0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm:    0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

body {
  background-color: var(--bg) !important;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main) !important;
  font-weight: 700;
  letter-spacing: -0.015em;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* Force Light Theme on Legacy Tailwind classes */
.text-white { color: var(--text-main) !important; }
.text-gray-400, .text-gray-500 { color: var(--text-light) !important; }
.text-gray-300, .text-gray-200 { color: var(--text-muted) !important; }
.bg-gray-900, .bg-gray-900\/60, .bg-gray-900\/40, .bg-gray-950, .bg-black, .bg-black\/50, .bg-black\/40 {
  background-color: #f8fafc !important;
  border-color: var(--border) !important;
}
.border-white\/5, .border-white\/10, .border-white\/20 {
  border-color: var(--border) !important;
}

/* Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Nav Sections */
.nav-section {
  padding: 14px 12px 6px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary-border);
}

.nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sidebar Footer / Profile */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.admin-card-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg);
}

.top-header {
  height: var(--header-h);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-xs);
}

.content-body {
  padding: 24px 28px;
  flex: 1;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* Modern Cards */
.card, .glass-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover) !important;
}

.card-p {
  padding: 20px;
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-blue, .badge-primary {
  background-color: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.badge-green, .badge-success {
  background-color: var(--success-subtle);
  color: var(--success-text);
  border-color: var(--success-border);
}

.badge-yellow, .badge-warning {
  background-color: var(--warning-subtle);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.badge-red, .badge-danger {
  background-color: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.badge-purple {
  background-color: var(--purple-subtle);
  color: var(--purple-text);
  border-color: var(--purple-border);
}

.badge-gray {
  background-color: #f1f5f9;
  color: var(--text-muted);
  border-color: var(--border);
}

.badge-urgent {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: urgentGlow 1.5s infinite;
}

@keyframes urgentGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.97); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main) !important;
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-success {
  background-color: var(--success-subtle);
  color: var(--success-text) !important;
  border-color: var(--success-border);
}

.btn-success:hover {
  background-color: #d1fae5;
}

.btn-danger {
  background-color: var(--danger-subtle);
  color: var(--danger-text) !important;
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background-color: #fee2e2;
}

.btn-warning {
  background-color: var(--warning-subtle);
  color: var(--warning-text) !important;
  border-color: var(--warning-border);
}

.btn-warning:hover {
  background-color: #fef3c7;
}

.btn-purple {
  background-color: var(--purple-subtle);
  color: var(--purple-text) !important;
  border-color: var(--purple-border);
}

.btn-purple:hover {
  background-color: #ede9fe;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 5px;
}

.btn-lg {
  padding: 10px 22px;
  font-size: 14.5px;
  font-weight: 600;
}

/* Forms & Inputs */
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: #ffffff !important;
  border: 1px solid var(--border-hover) !important;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main) !important;
  font-size: 13.5px;
  outline: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table.t, table.custom-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13px;
}

table.t th, table.custom-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background-color: #f8fafc;
  white-space: nowrap;
}

table.t td, table.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

table.t tr:last-child td,
table.custom-table tr:last-child td {
  border-bottom: none;
}

table.t tbody tr:hover,
table.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

tr.urgent td {
  background-color: #fff1f2 !important;
}

/* Modals */
.modal-backdrop, [id$="-modal"] {
  background-color: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px);
}

[id$="-modal"] .card, [id$="-modal"] .glass-card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Switches & Toggles */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 22px;
  transition: 0.2s ease;
}

.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider::before {
  transform: translateX(16px);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Urgent Alert Box */
.urgent-border {
  border: 1px solid #fca5a5 !important;
  background: #fff1f2 !important;
}

/* Animations */
.animate-fade {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Modal System */
.hidden {
  display: none !important;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop:not(.hidden) {
  display: flex !important;
}

.modal-box {
  background: #ffffff;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  padding: 24px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ================================================================
   TAILWIND UTILITY REPLACEMENTS
   These replace the cdn.tailwindcss.com runtime compiler.
   Organized by category matching Tailwind's class naming.
   ================================================================ */

/* --- Display & Position --- */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-2 { top: 0.5rem; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.left-2 { left: 0.5rem; }
.left-2\.5 { left: 0.625rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* --- Flexbox --- */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.self-start { align-self: flex-start; }

/* --- Grid --- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }

/* --- Gap & Space --- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.space-y-0 > :not([hidden]) ~ :not([hidden]) { margin-top: 0; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.25rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; border-top-style: solid; }
.divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: #f1f5f9; }

/* --- Padding --- */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pl-4 { padding-left: 1rem; }
.pr-3 { padding-right: 0.75rem; }

/* --- Margin --- */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

/* --- Width & Height --- */
.w-1\.5 { width: 0.375rem; }
.w-1\/3 { width: 33.333333%; }
.w-5 { width: 1.25rem; }
.w-10 { width: 2.5rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-2\.5 { width: 0.625rem; }
.w-28 { width: 7rem; }
.w-36 { width: 9rem; }
.w-auto { width: auto; }
.w-full { width: 100%; }
.h-1\.5 { height: 0.375rem; }
.h-2\.5 { height: 0.625rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }
.h-44 { height: 11rem; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.min-h-\[160px\] { min-height: 160px; }
.min-h-\[300px\] { min-height: 300px; }
.min-w-\[180px\] { min-width: 180px; }
.min-w-\[200px\] { min-width: 200px; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-\[280px\] { max-width: 280px; }
.max-h-56 { max-height: 14rem; }
.max-h-\[480px\] { max-height: 480px; }
.max-h-\[90vh\] { max-height: 90vh; }

/* --- Typography --- */
.text-\[10px\] { font-size: 10px; }
.text-\[10\.5px\] { font-size: 10.5px; }
.text-\[11px\] { font-size: 11px; }
.text-\[11\.5px\] { font-size: 11.5px; }
.text-\[12px\] { font-size: 12px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-normal { white-space: normal; }
.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.line-through { text-decoration-line: line-through; }
.underline { text-decoration-line: underline; }

/* --- Text Colors --- */
.text-white { color: #ffffff !important; }
.text-primary { color: var(--primary); }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-900 { color: #111827; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-rose-500 { color: #f43f5e; }
.text-rose-600 { color: #e11d48; }
.text-rose-800 { color: #9f1239; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-amber-900 { color: #78350f; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-800 { color: #065f46; }
.text-teal-800 { color: #115e59; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-indigo-900 { color: #312e81; }
.text-blue-400 { color: #60a5fa; }
.text-blue-600 { color: #2563eb; }
.text-purple-600 { color: #9333ea; }
.text-purple-700 { color: #7e22ce; }
.text-green-400 { color: #4ade80; }
.text-yellow-500 { color: #eab308; }

/* --- Background Colors --- */
.bg-white { background-color: #ffffff; }
.bg-white\/80 { background-color: rgba(255,255,255,0.8); }
.bg-black\/40 { background-color: rgba(0,0,0,0.4); }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-50\/50 { background-color: rgba(248,250,252,0.5); }
.bg-slate-50\/60 { background-color: rgba(248,250,252,0.6); }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-400 { background-color: #94a3b8; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-900\/60 { background-color: rgba(15,23,42,0.6); }
.bg-red-50 { background-color: #fef2f2; }
.bg-rose-50 { background-color: #fff1f2; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-50\/60 { background-color: rgba(255,251,235,0.6); }
.bg-amber-100 { background-color: #fef3c7; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-50\/50 { background-color: rgba(236,253,245,0.5); }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-50\/40 { background-color: rgba(240,253,250,0.4); }
.bg-teal-600 { background-color: #0d9488; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-50\/50 { background-color: rgba(238,242,255,0.5); }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-tr { background-image: linear-gradient(to top right, var(--tw-gradient-stops)); }

/* --- Border --- */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }
.border-transparent { border-color: transparent; }
.border-primary { border-color: var(--primary); }
.border-slate-50 { border-color: #f8fafc; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-slate-700 { border-color: #334155; }
.border-gray-100 { border-color: #f3f4f6; }
.border-red-200 { border-color: #fecaca; }
.border-rose-200 { border-color: #fecdd3; }
.border-amber-200 { border-color: #fde68a; }
.border-amber-300 { border-color: #fcd34d; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-emerald-300 { border-color: #6ee7b7; }
.border-teal-200 { border-color: #99f6e4; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-blue-200 { border-color: #bfdbfe; }
.border-purple-200 { border-color: #e9d5ff; }
.border-l-rose-500 { border-left-color: #f43f5e; }
.border-l-amber-500 { border-left-color: #f59e0b; }
.border-l-emerald-500 { border-left-color: #10b981; }
.border-l-indigo-500 { border-left-color: #6366f1; }
.border-collapse { border-collapse: collapse; }

/* --- Border Radius --- */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* --- Shadow --- */
.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.shadow-indigo-500\/20 { --tw-shadow-color: rgba(99,102,241,0.2); box-shadow: 0 10px 15px -3px var(--tw-shadow-color); }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* --- Opacity, Cursor, Transition --- */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.resize-none { resize: none; }

/* --- Z-index --- */
.z-50 { z-index: 50; }

/* --- Object Fit --- */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* --- Animations --- */
.animate-pulse { animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes tw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Peer / Group variants (Tailwind toggle pattern) --- */
.peer:checked ~ .peer-checked\:after\:translate-x-full::after { transform: translateX(100%); }
.peer:checked ~ .peer-checked\:after\:border-white::after { border-color: #fff; }
.peer:checked ~ .peer-checked\:bg-blue-600 { background-color: #2563eb; }
.peer:focus ~ .peer-focus\:outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:scale-110 { transform: scale(1.1); }

/* after: pseudo variants for toggle switches */
.after\:content-\[\'\'\]::after { content: ''; }
.after\:absolute::after { position: absolute; }
.after\:top-\[2px\]::after { top: 2px; }
.after\:left-\[2px\]::after { left: 2px; }
.after\:bg-white::after { background-color: #fff; }
.after\:border::after { border-width: 1px; border-style: solid; }
.after\:border-slate-300::after { border-color: #cbd5e1; }
.after\:rounded-full::after { border-radius: 9999px; }
.after\:h-5::after { height: 1.25rem; }
.after\:w-5::after { width: 1.25rem; }
.after\:transition-all::after { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* --- Hover variants --- */
.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.hover\:bg-slate-50\/80:hover { background-color: rgba(248,250,252,0.8); }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-slate-800:hover { background-color: #1e293b; }
.hover\:bg-white:hover { background-color: #ffffff; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:bg-rose-50:hover { background-color: #fff1f2; }
.hover\:bg-rose-100:hover { background-color: #ffe4e6; }
.hover\:bg-amber-50:hover { background-color: #fffbeb; }
.hover\:bg-amber-100:hover { background-color: #fef3c7; }
.hover\:bg-amber-100\/70:hover { background-color: rgba(254,243,199,0.7); }
.hover\:bg-emerald-100:hover { background-color: #d1fae5; }
.hover\:bg-teal-100:hover { background-color: #ccfbf1; }
.hover\:bg-teal-700:hover { background-color: #0f766e; }
.hover\:bg-indigo-50:hover { background-color: #eef2ff; }
.hover\:bg-indigo-100:hover { background-color: #e0e7ff; }
.hover\:bg-indigo-700:hover { background-color: #4338ca; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-purple-100:hover { background-color: #f3e8ff; }
.hover\:border-slate-200:hover { border-color: #e2e8f0; }
.hover\:border-amber-400:hover { border-color: #fbbf24; }
.hover\:border-emerald-400:hover { border-color: #34d399; }
.hover\:border-indigo-400:hover { border-color: #818cf8; }
.hover\:border-blue-400:hover { border-color: #60a5fa; }
.hover\:border-rose-400:hover { border-color: #fb7185; }
.hover\:text-slate-600:hover { color: #475569; }
.hover\:text-slate-800:hover { color: #1e293b; }
.hover\:text-indigo-600:hover { color: #4f46e5; }
.hover\:text-rose-700:hover { color: #be123c; }
.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:scale-\[1\.01\]:hover { transform: scale(1.01); }

/* --- Focus variants --- */
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--primary); }

/* --- Responsive: sm (640px+) --- */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:items-center { align-items: center; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:w-auto { width: auto; }
  .sm\:w-1\/3 { width: 33.333333%; }
  .sm\:w-2\/3 { width: 66.666667%; }
}

/* --- Responsive: md (768px+) --- */
@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .md\:col-span-4 { grid-column: span 4 / span 4; }
  .md\:col-span-8 { grid-column: span 8 / span 8; }
  .md\:items-center { align-items: center; }
}

/* --- Responsive: lg (1024px+) --- */
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
}
