/* =====================================================================
   Sozo themes. The default (green) lives in sozo.css and is untouched.
   Every other theme is a block keyed on html[data-sz-theme="<id>"].
   To add a theme: add one block below + one entry in includes/TopNav.blade.php.
   ===================================================================== */

/* ---------- Theme: Black ("dark") ---------- */
html[data-sz-theme="dark"] {
  color-scheme: dark;
  --sz-pine: #08080a;            /* page */
  --sz-canopy: #111114;          /* cards, panels, inputs */
  --sz-moss: #19191d;            /* menus, raised surfaces */
  --sz-moss-2: #222227;
  --sz-rule: #2e2e35;            /* borders */
  --sz-rule-soft: rgba(255, 255, 255, .08);
  --sz-chalk: #ededf0;           /* body text */
  --sz-muted: #a3a3ad;           /* secondary text (7:1 on cards) */
  --sz-faint: #74747e;           /* placeholders */
  --sz-brass: #e0b24f;           /* accent, a touch brighter on black */
  --sz-brass-ink: #1a1304;
  --sz-lake: #4fc2a8;
  --sz-sky: #70aee6;
  --sz-brick: #ef6b62;
  --sz-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -24px rgba(0, 0, 0, .95);
}

/* Surfaces that carry a hard-coded green gradient in sozo.css */
html[data-sz-theme="dark"] .sidebar.sz-side { background: linear-gradient(180deg, #0e0e11 0%, #050506 100%) !important; }
html[data-sz-theme="dark"] .sz-hero {
  background: radial-gradient(900px 400px at 100% 0%, rgba(224, 178, 79, .13), transparent 60%), linear-gradient(135deg, #17171b, #0d0d10);
}
html[data-sz-theme="dark"] .sz-plan { background: rgba(0, 0, 0, .45); }
html[data-sz-theme="dark"] .main-panel {
  background-image:
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
}

/* Neutral (not green-tinted) overlays */
html[data-sz-theme="dark"] .sz-scrim,
html[data-sz-theme="dark"] .sz-palette,
html[data-sz-theme="dark"] .swal2-container.sz-swal-container { background: rgba(0, 0, 0, .78) !important; }
html[data-sz-theme="dark"] ::-webkit-scrollbar-thumb { border-color: var(--sz-pine); }
html[data-sz-theme="dark"] ::selection { background: var(--sz-brass); color: var(--sz-brass-ink); }

/* Tables: slightly stronger header and hover so rows stay readable on black */
html[data-sz-theme="dark"] .table thead th { background: rgba(255, 255, 255, .05); }
html[data-sz-theme="dark"] .table tbody tr:hover,
html[data-sz-theme="dark"] .table tr.table-light:hover,
html[data-sz-theme="dark"] .table tr.table-primary:hover { background: rgba(224, 178, 79, .08) !important; }
html[data-sz-theme="dark"] .table td { border-color: rgba(255, 255, 255, .07) !important; }

/* Forms and native controls */
html[data-sz-theme="dark"] .form-control,
html[data-sz-theme="dark"] .form-select,
html[data-sz-theme="dark"] select.form-control,
html[data-sz-theme="dark"] textarea.form-control { background-color: var(--sz-pine) !important; border-color: var(--sz-rule) !important; color: var(--sz-chalk) !important; }
html[data-sz-theme="dark"] .form-control:focus,
html[data-sz-theme="dark"] .form-select:focus,
html[data-sz-theme="dark"] select.form-control:focus { box-shadow: 0 0 0 3px rgba(224, 178, 79, .22) !important; }
html[data-sz-theme="dark"] .form-control:disabled,
html[data-sz-theme="dark"] .form-control[readonly] { background-color: rgba(255, 255, 255, .04) !important; }
html[data-sz-theme="dark"] option { background: var(--sz-canopy); color: var(--sz-chalk); }
html[data-sz-theme="dark"] input:-webkit-autofill { -webkit-text-fill-color: var(--sz-chalk); box-shadow: 0 0 0 1000px var(--sz-pine) inset; caret-color: var(--sz-chalk); }

/* Plain Bootstrap utility classes that still assume a light page */
html[data-sz-theme="dark"] .bg-light,
html[data-sz-theme="dark"] .bg-white { background-color: var(--sz-canopy) !important; color: var(--sz-chalk); }
html[data-sz-theme="dark"] .dropdown-menu,
html[data-sz-theme="dark"] .list-group-item,
html[data-sz-theme="dark"] .popover,
html[data-sz-theme="dark"] .pagination .page-link { background: var(--sz-moss); border-color: var(--sz-rule); color: var(--sz-chalk); }
html[data-sz-theme="dark"] .pagination .page-item.active .page-link { background: var(--sz-brass); border-color: var(--sz-brass); color: var(--sz-brass-ink); }

/* Dark: top bar and overlays that sozo.css tints green */
html[data-sz-theme="dark"] .navbar.sz-top { background: rgba(8, 8, 10, .88) !important; border-bottom-color: rgba(255, 255, 255, .08); }
html[data-sz-theme="dark"] .sz-loader.is-visible { background: rgba(0, 0, 0, .72); }
html[data-sz-theme="dark"] .sz-estate-cover::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .88) 100%); }
html[data-sz-theme="dark"] .sz-estate-loc,
html[data-sz-theme="dark"] .sz-estate-sketch,
html[data-sz-theme="dark"] .sz-doc-open,
html[data-sz-theme="dark"] .sz-house-img .sz-chip { background: rgba(0, 0, 0, .72); }

/* ---------- Theme: Soft white ("light"). Same approach as GitHub / Linear / Atlassian light modes:
   no pure #fff on large areas (grey-tinted page, off-white cards), near-black text instead of #000,
   soft borders and low-contrast shadows, so the screen is easy on the eyes for a full working day.   ---------- */
html[data-sz-theme="light"] {
  color-scheme: light;
  --sz-pine: #e8ebf0;            /* page: soft grey, the largest surface */
  --sz-canopy: #f5f6f9;          /* cards, panels: off-white, never pure white */
  --sz-moss: #f8f9fb;            /* menus, raised surfaces */
  --sz-moss-2: #e1e5eb;
  --sz-rule: #cfd5de;            /* borders */
  --sz-rule-soft: rgba(15, 23, 42, .09);
  --sz-chalk: #232936;           /* body text: soft near-black (about 12:1) */
  --sz-muted: #596377;           /* secondary text (about 5.6:1) */
  --sz-faint: #7b8598;           /* placeholders */
  --sz-brass: #a06908;           /* accent, dark enough for text and white-on-gold buttons */
  --sz-brass-ink: #fdfdfe;
  --sz-lake: #0e8a6c;
  --sz-sky: #1b6db4;
  --sz-brick: #c5372d;
  --sz-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 24px -16px rgba(15, 23, 42, .16);
}
html[data-sz-theme="light"] ::selection { background: rgba(160, 105, 8, .25); color: var(--sz-chalk); }

/* Shell */
html[data-sz-theme="light"] .sidebar.sz-side { background: linear-gradient(180deg, #f1f3f6 0%, #e6e9ee 100%) !important; border-right: 1px solid var(--sz-rule); }
html[data-sz-theme="light"] .navbar.sz-top { background: rgba(238, 241, 245, .9) !important; border-bottom: 1px solid var(--sz-rule); }
html[data-sz-theme="light"] img.sz-logo { content: url("/assets/sozo/logo-navy.png"); }
html[data-sz-theme="light"] .main-panel {
  background-image:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
}
html[data-sz-theme="light"] .sz-scrim,
html[data-sz-theme="light"] .sz-palette,
html[data-sz-theme="light"] .swal2-container.sz-swal-container { background: rgba(15, 23, 42, .5) !important; }
html[data-sz-theme="light"] .sz-loader.is-visible { background: rgba(232, 235, 240, .75); }
html[data-sz-theme="light"] .sz-loader-card { box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .35); }
html[data-sz-theme="light"] .sz-spin { border-color: rgba(15, 23, 42, .12); border-top-color: var(--sz-brass); }
html[data-sz-theme="light"] .sz-menu { box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .35); }
html[data-sz-theme="light"] .sz-palette-box { box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .45); }
html[data-sz-theme="light"] .swal2-popup.sz-swal { box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .5); }

/* Subtle fills that were "light on dark" become "dark on light" */
html[data-sz-theme="light"] .sz-link:hover,
html[data-sz-theme="light"] .sz-toggle:hover,
html[data-sz-theme="light"] .sz-menu a:hover,
html[data-sz-theme="light"] .dropdown-item:hover,
html[data-sz-theme="light"] .sz-theme-opt:hover { background: rgba(15, 23, 42, .06) !important; }
html[data-sz-theme="light"] .sz-account,
html[data-sz-theme="light"] .sz-shortcut,
html[data-sz-theme="light"] .card-header,
html[data-sz-theme="light"] .card-footer,
html[data-sz-theme="light"] table.sz-stack tr { background: rgba(15, 23, 42, .03) !important; }
html[data-sz-theme="light"] .sz-find kbd,
html[data-sz-theme="light"] .sz-date,
html[data-sz-theme="light"] .sz-chip,
html[data-sz-theme="light"] .sz-house-facts span,
html[data-sz-theme="light"] .progress { background: rgba(15, 23, 42, .07); }
html[data-sz-theme="light"] .sz-link.is-active,
html[data-sz-theme="light"] .sz-group.has-active > .sz-toggle { background: rgba(160, 105, 8, .1); color: var(--sz-chalk); }
html[data-sz-theme="light"] .sz-theme-opt[aria-checked="true"] { background: rgba(160, 105, 8, .1); }

/* Dashboard hero + plot plan */
html[data-sz-theme="light"] .sz-hero { background: radial-gradient(900px 400px at 100% 0%, rgba(160, 105, 8, .12), transparent 60%), linear-gradient(135deg, #f5f6f9, #e9ecf1); }
html[data-sz-theme="light"] .sz-plan { background: rgba(245, 246, 249, .8); }
html[data-sz-theme="light"] .sz-plan .cell[fill^="rgba(236"] { fill: rgba(15, 23, 42, .09); }

/* Tables */
html[data-sz-theme="light"] .table thead th,
html[data-sz-theme="light"] .table thead.table-primary th,
html[data-sz-theme="light"] .table tr.table-header-colored th,
html[data-sz-theme="light"] .table thead.table-light th,
html[data-sz-theme="light"] .table thead.table-dark th { background: #e2e6ec; }
html[data-sz-theme="light"] .table td { border-color: rgba(15, 23, 42, .08) !important; }
html[data-sz-theme="light"] .table tbody tr:hover { background: rgba(160, 105, 8, .06); }

/* Forms */
html[data-sz-theme="light"] .form-control,
html[data-sz-theme="light"] .form-select,
html[data-sz-theme="light"] select.form-control,
html[data-sz-theme="light"] textarea.form-control,
html[data-sz-theme="light"] .select2-container--default .select2-selection--single,
html[data-sz-theme="light"] .select2-container--default .select2-selection--multiple { background-color: #f9fafc !important; border-color: var(--sz-rule) !important; color: var(--sz-chalk) !important; }
html[data-sz-theme="light"] .form-control:focus,
html[data-sz-theme="light"] .form-select:focus,
html[data-sz-theme="light"] select.form-control:focus { background-color: #fbfcfd !important; box-shadow: 0 0 0 3px rgba(160, 105, 8, .18) !important; }
html[data-sz-theme="light"] .form-control:disabled,
html[data-sz-theme="light"] .form-control[readonly] { background-color: #e4e8ee !important; color: var(--sz-muted) !important; }
html[data-sz-theme="light"] .form-check-input { background-color: #f9fafc; }
html[data-sz-theme="light"] input:-webkit-autofill { -webkit-text-fill-color: var(--sz-chalk); box-shadow: 0 0 0 1000px #f9fafc inset; }
html[data-sz-theme="light"] .infoData { background-color: #f9fafc !important; color: var(--sz-chalk) !important; border: 1px solid var(--sz-rule) !important; }
html[data-sz-theme="light"] .select2-container--default .select2-selection--multiple .select2-selection__choice { background: rgba(160, 105, 8, .12); border-color: rgba(160, 105, 8, .35); color: var(--sz-chalk); }

/* Buttons: sozo.css fixes hover and ink colours for a dark page */
html[data-sz-theme="light"] .btn-primary:hover,
html[data-sz-theme="light"] .btn-success:hover,
html[data-sz-theme="light"] .create-new-button:hover { background: #865806 !important; border-color: #865806 !important; color: #fff !important; }
html[data-sz-theme="light"] .btn-info,
html[data-sz-theme="light"] .btn-outline-info:hover,
html[data-sz-theme="light"] .btn-outline-success:hover { color: #fff !important; }
html[data-sz-theme="light"] .btn-danger:hover { background: #a82c23 !important; }
html[data-sz-theme="light"] .btn-warning { background: #e3a92f !important; border-color: #e3a92f !important; color: #231803 !important; }
html[data-sz-theme="light"] .btn-outline-primary,
html[data-sz-theme="light"] .btn-outline-warning { border-color: rgba(160, 105, 8, .55) !important; }
html[data-sz-theme="light"] .btn-outline-success { border-color: rgba(14, 138, 108, .55) !important; }
html[data-sz-theme="light"] .btn-outline-info { border-color: rgba(27, 109, 180, .55) !important; }
html[data-sz-theme="light"] .btn-outline-danger { border-color: rgba(197, 55, 45, .55) !important; }
html[data-sz-theme="light"] .btn-close { filter: none; }

/* Alerts and badges: light text colours were chosen for a dark page */
html[data-sz-theme="light"] .alert-danger { background: rgba(197, 55, 45, .08) !important; color: #8a1f17 !important; }
html[data-sz-theme="light"] .alert-success { background: rgba(14, 138, 108, .09) !important; color: #0a5c48 !important; }
html[data-sz-theme="light"] .alert-warning { background: rgba(160, 105, 8, .1) !important; color: #6b4605 !important; }
html[data-sz-theme="light"] .alert-info { background: rgba(27, 109, 180, .08) !important; color: #124e82 !important; }
html[data-sz-theme="light"] .badge-success, html[data-sz-theme="light"] .badge.bg-success { background: rgba(14, 138, 108, .12) !important; }
html[data-sz-theme="light"] .badge-danger, html[data-sz-theme="light"] .badge.bg-danger { background: rgba(197, 55, 45, .12) !important; }
html[data-sz-theme="light"] .badge-warning, html[data-sz-theme="light"] .badge.bg-warning,
html[data-sz-theme="light"] .badge-primary, html[data-sz-theme="light"] .badge.bg-primary { background: rgba(160, 105, 8, .13) !important; }
html[data-sz-theme="light"] .badge-info, html[data-sz-theme="light"] .badge.bg-info { background: rgba(27, 109, 180, .12) !important; }

/* Pages that set "a { color: white }" or inline white links inside cards */
html[data-sz-theme="light"] .content-wrapper a:not(.btn):not([class*="btn-"]):not(.page-link):not(.dropdown-item):not(.nav-link):not([class*="sz-"]):not(.badge) { color: var(--sz-chalk); }
html[data-sz-theme="light"] .content-wrapper a:not(.btn):not([class*="btn-"]):not(.page-link):not(.dropdown-item):not(.nav-link):not([class*="sz-"]):not(.badge):hover { color: var(--sz-brass); }
html[data-sz-theme="light"] .card a[style*="color:white"],
html[data-sz-theme="light"] .card a[style*="color: white"] { color: var(--sz-chalk) !important; }

/* Text drawn over photos keeps the light-on-dark palette */
html[data-sz-theme="light"] .sz-estate-loc,
html[data-sz-theme="light"] .sz-estate-sketch,
html[data-sz-theme="light"] .sz-doc-open,
html[data-sz-theme="light"] .sz-house-img .sz-chip {
  --sz-chalk: #eceae0; --sz-muted: #b3c0b8; --sz-brass: #e0b862; --sz-brass-ink: #1d1605; --sz-lake: #54b6a0; --sz-brick: #ef7a72;
}

/* Back-to-top and theme menu */
html[data-sz-theme="light"] .sz-totop .sz-totop-track { stroke: rgba(15, 23, 42, .12); }
html[data-sz-theme="light"] .sz-totop { box-shadow: 0 12px 26px -10px rgba(15, 23, 42, .4), 0 0 0 1px var(--sz-rule); }
html[data-sz-theme="light"] .sz-theme-opt .sw::after { border-color: #f8f9fb; }
html[data-sz-theme="light"] .sz-theme-opt .sw { border-color: rgba(15, 23, 42, .25); }


/* ---------- Theme switcher (navbar) ---------- */
.sz-theme-menu { min-width: 224px; }
.sz-theme-menu .sz-menu-head { display: block; }
.sz-theme-opt {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 9px;
  background: transparent; color: var(--sz-chalk); font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
}
.sz-theme-opt:hover { background: rgba(236, 234, 224, .07); }
.sz-theme-opt:focus-visible { outline: 2px solid var(--sz-brass); outline-offset: -2px; }
.sz-theme-opt .sw {
  flex: none; position: relative; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(236, 234, 224, .25); background: var(--bg);
}
.sz-theme-opt .sw::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ac); border: 2px solid var(--sz-moss); }
.sz-theme-opt .nm { flex: 1; }
.sz-theme-opt .ck { font-size: 1.1rem; color: var(--sz-brass); opacity: 0; }
.sz-theme-opt[aria-checked="true"] { background: rgba(210, 164, 78, .1); }
.sz-theme-opt[aria-checked="true"] .ck { opacity: 1; }
html[data-sz-theme="dark"] .sz-theme-opt:hover { background: rgba(255, 255, 255, .07); }
html[data-sz-theme="dark"] .sz-theme-opt[aria-checked="true"] { background: rgba(224, 178, 79, .12); }
html[data-sz-theme="dark"] .sz-theme-opt .sw::after { border-color: var(--sz-moss); }

/* Smooth colour change when the theme is switched (not on page load) */
html.sz-theme-anim, html.sz-theme-anim body, html.sz-theme-anim .card, html.sz-theme-anim .sidebar,
html.sz-theme-anim .form-control, html.sz-theme-anim .table th, html.sz-theme-anim .table td { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
@media (prefers-reduced-motion: reduce) { html.sz-theme-anim, html.sz-theme-anim * { transition: none !important; } }
