/* Connected Home Outfitters brand — colors/fonts pulled from the WordPress site's
   Elementor global kit (see CLAUDE.md "Common Gotchas" #9). Applies sitewide (staff
   admin + customer portal) so both share one identity; views/portal/*.ejs layer
   portal.css on top for the customer-facing header/logo treatment specifically. */

:root {
  --cho-accent: #0799D6;   /* Elementor "Accent" — primary buttons/links */
  --cho-primary: #6EC1E4;  /* Elementor "Primary" — lighter accent */
  --cho-dark: #54595F;     /* Elementor "Secondary" — headings */
  --cho-text: #7A7A7A;     /* Elementor "Text" — body copy */

  --bs-primary: var(--cho-accent);
  --bs-primary-rgb: 7, 153, 214;
  --bs-link-color: var(--cho-accent);
  --bs-link-color-rgb: 7, 153, 214;
  --bs-link-hover-color: #067bb0;
  --bs-link-hover-color-rgb: 6, 123, 176;
}

body {
  background-color: #f8f9fa;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* !important because these override a precompiled, unmodified vendor bootstrap.min.css
   (see gotcha #7 — self-hosted but not recompiled from our own SCSS), so CSS variable
   inheritance alone doesn't reach every component that hardcodes the default blue. */
.btn-primary {
  background-color: var(--cho-accent) !important;
  border-color: var(--cho-accent) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--bs-link-hover-color) !important;
  border-color: var(--bs-link-hover-color) !important;
}
.btn-outline-primary {
  color: var(--cho-accent) !important;
  border-color: var(--cho-accent) !important;
}
.btn-outline-primary:hover {
  background-color: var(--cho-accent) !important;
  border-color: var(--cho-accent) !important;
}
.text-primary { color: var(--cho-accent) !important; }
.bg-primary { background-color: var(--cho-accent) !important; }
.border-primary { border-color: var(--cho-accent) !important; }

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--cho-accent) !important;
}

/* --- Admin nav: fixed left sidebar on desktop, offcanvas (hamburger) on mobile ---
   The sidebar element is always in the DOM (display:none below lg via Bootstrap's
   d-none/d-lg-flex), so body:has(.cho-sidebar) reliably detects "this is an admin page"
   and offsets the content — but only inside the lg+ media query, so mobile keeps the
   full-width top bar + offcanvas instead. Portal/login pages don't include nav.ejs, so
   they never get the offset. */
.cho-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  z-index: 1030;
}
.cho-brand {
  display: block;
  padding: 0.25rem 0.5rem 1rem;
}
.cho-brand img {
  max-width: 100%;
  height: 34px;
}
.cho-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cho-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--cho-dark);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}
.cho-nav-link i {
  font-size: 1.05rem;
  opacity: 0.85;
}
.cho-nav-link:hover,
.cho-nav-link:focus {
  background: rgba(7, 153, 214, 0.08);
  color: var(--cho-accent);
}
.cho-nav-link.active {
  background: var(--cho-accent);
  color: #fff;
}
.cho-nav-link.active i {
  opacity: 1;
}
/* Cross-product link back to Connected Home Ledger. Deliberately quieter than the real
   nav items — it leaves this app, so it shouldn't compete with the sections inside it. */
.cho-nav-sep {
  border-top: 1px solid #eee;
  margin: 0.5rem 0.25rem;
}
.cho-nav-ext {
  color: var(--cho-muted, #7A7A7A);
  font-size: 0.9rem;
}
.cho-nav-ext i {
  font-size: 0.9rem;
}
.cho-logout {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid #eee;
}
.cho-offcanvas {
  max-width: 78vw;
}

@media (min-width: 992px) {
  body:has(.cho-sidebar) {
    padding-left: 220px;
    padding-top: 1.5rem;
  }
}

/* --- Scheduling calendar (views/admin/calendar.ejs) --- */
.cho-cal {
  width: 100%;
  min-width: 780px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}
.cho-cal th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cho-dark);
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  background: #f8f9fa;
}
.cho-cal td {
  vertical-align: top;
  height: 96px;
  width: 14.28%;
  border: 1px solid #e5e7eb;
  padding: 4px;
}
.cho-cal-out { background: #fafbfc; }
.cho-cal-out .cho-cal-daynum { color: #c0c4c9; }
.cho-cal-today { background: rgba(7, 153, 214, 0.06); }
.cho-cal-today .cho-cal-daynum {
  background: var(--cho-accent);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
}
.cho-cal-daynum {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cho-dark);
  margin-bottom: 3px;
}
.cho-cal-ev {
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 2px 5px;
  margin-bottom: 2px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cho-cal-ev .cho-cal-time { font-weight: 600; opacity: 0.85; }
.cho-ev-consultation { background: #cfe8f7; color: #084c74; }
.cho-ev-install      { background: var(--cho-accent); color: #fff; }
.cho-ev-followup     { background: #fff3cd; color: #664d03; }
.cho-ev-other        { background: #e2e3e5; color: #41464b; }
.cho-ev-due          { background: #fff; color: #6c757d; border: 1px dashed #adb5bd; }
