/*
  Owner Dark Mode
  Applied when <html class="dark"> is set via js/theme.js
  Scoped to owner backend pages: dashboard.html, deals.html, dashboard/*.html, auth/*.html
*/

/* ── Base ──────────────────────────────────────────────────────────────── */
html.dark body {
  background-color: #111827;
  color: #f9fafb;
}

/* ── Backgrounds ─────────────────────────────────────────────────────── */
html.dark .bg-white     { background-color: #1f2937; }
html.dark .bg-gray-50   { background-color: #111827; }
html.dark .bg-gray-100  { background-color: #374151; }
html.dark .bg-gray-200  { background-color: #4b5563; }

html.dark .hover\:bg-gray-50:hover  { background-color: #374151; }
html.dark .hover\:bg-gray-100:hover { background-color: #374151; }
html.dark .hover\:bg-gray-200:hover { background-color: #4b5563; }
html.dark .hover\:bg-white:hover    { background-color: #374151; }

/* ── Text ────────────────────────────────────────────────────────────── */
html.dark .text-gray-900 { color: #f9fafb; }
html.dark .text-gray-800 { color: #f3f4f6; }
html.dark .text-gray-700 { color: #e5e7eb; }
html.dark .text-gray-600 { color: #d1d5db; }
html.dark .text-gray-500 { color: #9ca3af; }
html.dark .text-gray-400 { color: #6b7280; }

html.dark .hover\:text-gray-900:hover { color: #f9fafb; }
html.dark .hover\:text-gray-700:hover { color: #e5e7eb; }

/* ── Borders ─────────────────────────────────────────────────────────── */
html.dark .border-gray-100 { border-color: #374151; }
html.dark .border-gray-200 { border-color: #374151; }
html.dark .border-gray-300 { border-color: #4b5563; }
html.dark .divide-gray-200 > * + * { border-color: #374151; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
html.dark nav { background-color: #1f2937 !important; border-color: #374151 !important; }

/* Logo: make dark text light while preserving gold/warm brand colors */
html.dark .logo-wordmark { filter: invert(1) hue-rotate(180deg); }

/* Module/page label (e.g. "RentFlow", "Account Settings") — match Sign Out brightness */
html.dark .nav-section-label { color: #e5e7eb !important; }

/* ── Custom components ───────────────────────────────────────────────── */
html.dark .stat-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
html.dark .border-b.border-gray-200  { border-color: #374151; }
html.dark .dashboard-tab             { color: #9ca3af; }
html.dark .dashboard-tab:hover       { color: #e5e7eb; border-color: #4b5563; }
html.dark .dashboard-tab.active      { color: #2dd4bf; border-color: #2dd4bf; }

/* ── Shadows ─────────────────────────────────────────────────────────── */
html.dark .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
html.dark .shadow    { box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
html.dark .shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
html.dark .shadow-xl { box-shadow: 0 20px 40px rgba(0,0,0,0.5); }

/* ── Form elements ───────────────────────────────────────────────────── */
html.dark input,
html.dark textarea,
html.dark select {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #6b7280 !important; }
html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  background-color: #374151 !important;
  border-color: #14b8a6 !important;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
html.dark table { border-color: #374151; }
html.dark thead th,
html.dark thead tr { background-color: #374151 !important; color: #f3f4f6 !important; border-color: #4b5563 !important; }
html.dark tbody td { border-color: #374151 !important; }
html.dark tbody tr { background-color: #1f2937; }
html.dark tbody tr:hover { background-color: #374151; }

html.dark #fin-summary-table th.sortable:hover { background-color: #4b5563; }
html.dark #fin-summary-table th.sort-active .sort-icon { color: #2dd4bf; }

/* ── FullCalendar ─────────────────────────────────────────────────────── */
html.dark .fc { color: #f9fafb; background: #1f2937; }
html.dark .fc-toolbar-title { color: #f9fafb !important; }
html.dark .fc table { background: #1f2937; border-color: #374151 !important; }
html.dark .fc th { background: #374151 !important; color: #d1d5db !important; border-color: #4b5563 !important; }
html.dark .fc td { border-color: #374151 !important; }
html.dark .fc .fc-daygrid-day { background: #1f2937; }
html.dark .fc .fc-daygrid-day:hover { background: #374151; }
html.dark .fc .fc-day-today { background: #134e4a !important; }
html.dark .fc-scrollgrid { border-color: #374151 !important; }
html.dark .fc-col-header-cell { background: #374151 !important; }

/* ── Login/auth page hero gradient ───────────────────────────────────── */
html.dark .hero-bg { background: linear-gradient(135deg, #0f172a 0%, #111827 50%, #0f1f1f 100%) !important; }
html.dark .bg-gradient-primary { /* teal gradient stays */ }
