/*! AutoSpa — Complete Theme (Mobile-First, Professional) */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Geist Sans', Inter, Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Reset & base ----- */
* { margin: 0; padding: 0; box-sizing: border-box; border-color: var(--border); }
html { -webkit-text-size-adjust: 100%; font-family: var(--font-sans); }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p { margin-bottom: 0.5rem; color: var(--muted-foreground); }
small { font-size: 0.85rem; color: var(--muted-foreground); }

/* ----- Container - FULL WIDTH by default ----- */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* Optional constrained container for forms/settings pages */
.container-constrained {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container-constrained { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container-constrained { padding: 0 2rem; } }

/* ----- Cards (clean, consistent) ----- */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.card-content {
  padding: 0.5rem 1.25rem 1.25rem 1.25rem;
  flex: 1;
}
.card-footer {
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card:last-child { margin-bottom: 0; }

/* ----- Buttons (mobile-friendly) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  height: 2.5rem;
  min-height: 2.5rem;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

/* variants */
.btn-primary {
  background: #2563eb;
  color: #fff !important;
  border-color: #2563eb;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-success {
  background: #16a34a;
  color: #fff !important;
  border-color: #16a34a;
}
.btn-success:hover { background: #15803d; border-color: #15803d; }

.btn-danger {
  background: #dc2626;
  color: #fff !important;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-outline {
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--secondary); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--secondary); }

.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  min-height: 2rem;
}
.btn-lg {
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 1rem;
  min-height: 3rem;
}
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  width: 2.5rem;
  padding: 0;
  justify-content: center;
}
.btn-icon.btn-sm { width: 2rem; }

/* ----- Inputs & selects ----- */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid var(--input);
  background: var(--background);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-height: 2.5rem;
}
.input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.input::placeholder { color: var(--muted-foreground); }
textarea.input { min-height: 5rem; padding: 0.5rem 0.75rem; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid transparent;
}
.badge-primary { background: #2563eb; color: #fff; }
.badge-success { background: #16a34a; color: #fff; }
.badge-warning { background: #f59e0b; color: #fff; }
.badge-danger { background: #dc2626; color: #fff; }
.badge-outline { background: transparent; border-color: var(--border); color: var(--foreground); }

/* ----- Grid & layout helpers ----- */
.grid { display: grid; gap: 1rem; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }

/* responsive grids */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ----- Tabs (clean) ----- */
.tabs-list {
  display: flex;
  gap: 0.25rem;
  background: var(--secondary);
  padding: 0.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tabs-trigger[data-state="active"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
.tabs-trigger:hover:not([data-state="active"]) { background: rgba(0,0,0,0.04); }

/* ----- Switch (toggle) ----- */
.switch {
  position: relative;
  display: inline-flex;
  height: 1.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: var(--input);
  transition: background 0.15s;
}
.switch[data-state="checked"] { background: #2563eb; }
.switch .thumb {
  display: block;
  height: 1rem;
  width: 1rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transform: translateX(0.15rem);
  transition: transform 0.15s;
}
.switch[data-state="checked"] .thumb { transform: translateX(1.1rem); }

/* ----- Progress bar ----- */
.progress {
  height: 0.5rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--secondary);
}
.progress-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ----- Alerts ----- */
.alert {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  background: var(--background);
}
.alert-icon { flex-shrink: 0; margin-top: 0.1rem; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ----- Stats cards (dashboard) ----- */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--foreground); }
.stat-label { font-size: 0.8rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.03em; }

/* ----- Quick action cards (home) ----- */
.quick-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
}
.quick-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.quick-card .icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-card h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.quick-card p { font-size: 0.85rem; color: var(--muted-foreground); margin: 0; }

/* ----- Header / Top bar ----- */
.top-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.92);
}
.top-bar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.top-bar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.top-bar .brand svg { color: #2563eb; }

/* ----- Footer ----- */
.footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* ----- Toast container ----- */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
  width: 100%;
}
.toast {
  background: var(--foreground);
  color: var(--background);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease-out;
}
.toast-success { background: #16a34a; color: #fff; }
.toast-error { background: #dc2626; color: #fff; }
.toast-info { background: #2563eb; color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Modal / Dialog ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ----- Scrollbar (nice) ----- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--secondary); border-radius: 9999px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ----- Utilities (spacing, visibility) ----- */
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* responsive visibility */
.hidden { display: none; }
@media (min-width: 640px) { .sm\:block { display: block; } .sm\:flex { display: flex; } }
@media (min-width: 768px) { .md\:block { display: block; } .md\:flex { display: flex; } }
@media (min-width: 1024px) { .lg\:block { display: block; } .lg\:flex { display: flex; } }

/* icon helper (lucide) */
[data-lucide] { display: inline-block; width: 1.1rem; height: 1.1rem; }

/* ----- Page-specific micro-adjustments (safe) ----- */
body { background: #f8fafc; }
.card { background: #ffffff; }