@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Apple Design Light Color Tokens */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-hairline: rgba(226, 232, 240, 0.8);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Paintrob Brand Corporate Accents */
  --pr-charcoal: #1e293b;
  --pr-yellow: #f59e0b;
  --pr-yellow-hover: #d97706;
  --pr-yellow-soft: #fef3c7;
  --pr-blue: #0284c7;
  --pr-blue-soft: #e0f2fe;
  --pr-emerald: #10b981;
  --pr-rose: #f43f5e;
  
  /* Apple Micro-elevation */
  --apple-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --apple-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --apple-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --apple-shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.06), 0 4px 8px -2px rgba(0, 0, 0, 0.02);
}

/* Base Document Reset */
html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Apple Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Apple Cards */
.apple-card {
  background-color: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 1rem;
  box-shadow: var(--apple-shadow-sm);
  transition: box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.apple-card:hover {
  box-shadow: var(--apple-shadow-md);
}

/* Translucent Glass Effect */
.apple-glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Sidebar Navigation Items */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-link:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}
.sidebar-link.active {
  color: #0f172a;
  background-color: #f1f5f9;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.sidebar-link.active i,
.sidebar-link.active svg {
  color: var(--pr-yellow-hover);
}

/* Apple Badges */
.apple-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}
.apple-badge-amber {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.apple-badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.apple-badge-emerald {
  background-color: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.apple-badge-rose {
  background-color: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.apple-badge-slate {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Apple Buttons */
.apple-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0f172a;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}
.apple-btn-primary:hover {
  background-color: #1e293b;
  transform: translateY(-0.5px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}
.apple-btn-primary:active {
  transform: scale(0.98);
}

.apple-btn-amber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #f59e0b;
  border: 1px solid #d97706;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}
.apple-btn-amber:hover {
  background-color: #d97706;
  transform: translateY(-0.5px);
}

.apple-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--apple-shadow-xs);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}
.apple-btn-secondary:hover {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Crisp Clean Table Styling */
.apple-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.apple-table th {
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.apple-table td {
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}
.apple-table tr:last-child td {
  border-bottom: none;
}
.apple-table tr:hover td {
  background-color: #f8fafc;
}

/* Form Inputs Apple Look */
.apple-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 0.8125rem;
  outline: none;
  transition: all 0.15s ease;
}
.apple-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* =========================================================
   Universal Apple Light Fallbacks (Bootstrap & Tailwind)
   ========================================================= */
h1.text-white, h2.text-white, h3.text-white, h4.text-white, h5.text-white, h6.text-white {
  color: #0f172a !important;
}

p.text-white, div.text-white:not(.badge):not(.btn):not(.apple-btn-primary):not([class*="bg-slate-900"]):not([class*="bg-orange"]):not([class*="bg-rose"]):not([class*="bg-sky"]):not([class*="bg-blue"]):not([class*="bg-emerald"]) {
  color: #0f172a !important;
}

.text-secondary, .text-muted {
  color: #64748b !important;
}

.pr-card, .card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(226, 232, 240, 0.85) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03) !important;
}

.bg-dark {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.form-control, .form-select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.75rem !important;
  font-size: 0.8125rem !important;
  padding: 0.55rem 0.85rem !important;
}

.form-control:focus, .form-select:focus {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08) !important;
}

.btn-paintrob {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  padding: 0.55rem 1rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.15s ease !important;
}
.btn-paintrob:hover {
  background-color: #1e293b !important;
  transform: translateY(-0.5px);
}

.btn-outline-secondary {
  background-color: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.75rem !important;
  font-weight: 500 !important;
  font-size: 0.8125rem !important;
  padding: 0.55rem 1rem !important;
}
.btn-outline-secondary:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

.btn-outline-warning {
  background-color: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
}
.btn-outline-warning:hover {
  background-color: #fef3c7 !important;
}

.table-dark {
  --bs-table-bg: transparent !important;
  --bs-table-color: #1e293b !important;
  color: #1e293b !important;
}
.table-dark th {
  background-color: #f8fafc !important;
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
.table-dark td {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.table-dark tr:hover td {
  background-color: #f8fafc !important;
}

/* Tailwind Dark Fallback Cleanser */
html:not(.dark) .dark\:text-white {
  color: #0f172a !important;
}
html:not(.dark) .dark\:bg-slate-900, 
html:not(.dark) .dark\:bg-slate-950, 
html:not(.dark) .dark\:bg-slate-800,
html:not(.dark) .dark\:bg-slate-800\/60,
html:not(.dark) .dark\:bg-slate-800\/50 {
  background-color: #ffffff !important;
}
html:not(.dark) .dark\:border-slate-800, 
html:not(.dark) .dark\:border-slate-700,
html:not(.dark) .dark\:border-slate-700\/80 {
  border-color: rgba(226, 232, 240, 0.85) !important;
}
html:not(.dark) .dark\:text-slate-400, 
html:not(.dark) .dark\:text-slate-300,
html:not(.dark) .dark\:text-slate-200 {
  color: #64748b !important;
}

/* Button styling overrides for Apple aesthetic */
.bg-orange-600 {
  background-color: #0f172a !important;
  color: #ffffff !important;
}
.bg-orange-600:hover, .hover\:bg-orange-700:hover {
  background-color: #1e293b !important;
}

