/* Buckeye Portal — Milestone 1
   Brand tokens from buckeyearm.com. Mobile-first, no decorative animation. */

:root {
  --navy: #263D4E;
  --text: #1F2933;
  --muted: #5F6F7A;
  --accent: #2B9DEE;
  --accent-light: #48A7F0;
  --bg: #EEF2F6;
  --card: #FFFFFF;
  --warm: #FFBC7D;
  --danger: #C0392B;
  --success: #1E7E34;
  --border: #D8E0E8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(38, 61, 78, 0.10);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Theme-aware surfaces (light defaults; overridden for dark below) */
  --heading: #263D4E;
  --side-bg: #FFFFFF;
  --side-text: #1F2933;
  --side-muted: #8A97A3;
  --side-hover: #F0F4F8;
  --input-bg: #FFFFFF;
  --table-head: #F5F8FB;
  --code-bg: #E9EEF3;
  --pill-bg: #E4EDF5;
  --tag-bg: #CAE2F5;
  --topbar-bg: #FFFFFF;
}

/* ---------- Dark mode: every surface above re-maps; brand colors stay ---------- */
:root[data-theme="dark"] {
  --bg: #0F151C;
  --card: #18222D;
  --text: #E6EDF3;
  --muted: #93A1AE;
  --border: #2A3744;
  --line: #2A3744;
  --bg-soft: #18222D;
  --ink: #E6EDF3;
  --blue-dark: #5EB5F5;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --heading: #EDF3F8;
  --side-bg: #131C26;
  --side-text: #E6EDF3;
  --side-muted: #7E8C99;
  --side-hover: #1D2937;
  --input-bg: #1B2632;
  --table-head: #1B2632;
  --code-bg: #22303D;
  --pill-bg: #22303D;
  --tag-bg: #1E3A52;
  --topbar-bg: #131C26;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}

h1 { font-size: 1.5rem; margin: 0 0 .25rem; color: var(--heading); }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; color: var(--heading); }
h3 { font-size: 1rem; margin: 0 0 .5rem; color: var(--heading); }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: var(--code-bg); padding: .1rem .4rem; border-radius: 4px; font-size: .85em; word-break: break-all; }

/* ---------- Auth shell ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--navy);
}
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
}
.auth-logo { display: block; max-width: 220px; height: auto; margin: 0 auto 1.25rem; }
.auth-title { text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin-top: 0; }
.auth-links { text-align: center; margin-top: 1rem; }

/* ---------- App frame ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 1rem 1rem 5.5rem; max-width: 1200px; width: 100%; margin: 0 auto; }
/* Extra bottom clearance when the third-party support-chat launcher is present,
   so its fixed bubble can never cover the last action buttons on a page. */
body.has-chat .content { padding-bottom: 9rem; }

/* ---------- Mobile slide-out nav drawer (BoostCab-CRM style) ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  transform: translateX(-105%);
  transition: transform .25s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}
html.nav-open .sidebar { transform: none; }
html.nav-open { overflow: hidden; }
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 26, .55);
  z-index: 99;
}
.nav-backdrop[hidden] { display: none; }
.nav-open-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 0; background: transparent; color: var(--text);
  border-radius: 10px; cursor: pointer;
}
.nav-open-btn svg { width: 24px; height: 24px; display: block; }
.nav-close-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 0; background: transparent; color: var(--side-muted);
  border-radius: 10px; cursor: pointer; flex-shrink: 0;
}
.nav-close-btn svg { width: 20px; height: 20px; display: block; }
.nav-collapse { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .55rem;
  background: var(--topbar-bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Logo: no background box; dark artwork in light mode, white in dark mode */
.topbar-brand { display: inline-flex; align-items: center; }
.topbar-brand img { height: 34px; width: auto; display: block; }
:root[data-theme="dark"] .topbar-brand img { filter: brightness(0) invert(1); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.topbar-user { font-size: .9rem; display: none; }
.icon-btn {
  position: relative;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
  background: var(--side-hover);
  border-radius: 50%;
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 1.3rem; height: 1.3rem; display: block; }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; display: block; }
.badge {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--warm);
  color: var(--navy);
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .05rem .35rem;
  min-width: 1.1rem;
  text-align: center;
}

/* ---------- Components ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.page-sub { color: var(--muted); margin: 0; width: 100%; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem;
  border-left: 4px solid var(--border);
}
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--heading); }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat-alert { border-left-color: var(--warm); }
.stat-danger { border-left-color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }

.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

.empty { color: var(--muted); font-style: italic; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { background: var(--table-head); color: var(--heading); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: 0; }
.row-actions { text-align: right; }

.pill {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  background: var(--pill-bg);
  color: var(--heading);
  border-radius: 999px;
  padding: .1rem .5rem;
  margin-left: .35rem;
  vertical-align: middle;
}
.pill-owner { background: var(--navy); color: #fff; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .9rem; }
.form-narrow { max-width: 560px; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-weight: 600; font-size: .9rem; color: var(--heading); }
.input, .field input, .field select, .field textarea, .filters input, .filters select {
  font: inherit;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  width: 100%;
}
.field input:focus, .field select:focus, .input:focus {
  outline: 2px solid var(--accent-light);
  border-color: var(--accent);
}
.static-value { padding: .65rem 0; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

.check { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem 0; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--accent); flex-shrink: 0; }
.check-grid { display: grid; grid-template-columns: 1fr; gap: .1rem; }
.perm-group h3 { text-transform: capitalize; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: .65rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--pill-bg);
  color: var(--heading);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger); }
.inline-form { display: inline; margin: 0; }
.topbar .btn-ghost { color: var(--muted); border-color: var(--border); }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #FDECEA; color: #8E2A20; border: 1px solid #F5C6C0; }
.alert-success { background: #E7F4EA; color: var(--success); border: 1px solid #BFE3C8; }

.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters .input { flex: 1; min-width: 140px; width: auto; }
.filters select.input { flex: 0 1 auto; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 0 0 .5rem; }
.dl dt { font-weight: 600; color: var(--heading); }
.dl dd { margin: 0; }

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.notif {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.notif-unread { border-left: 4px solid var(--accent); }
.notif-body p { margin: .25rem 0; }
.notif-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin: 1rem 0 2rem; }

/* ---------- Desktop ---------- */
/* ---------- Sidebar components (drawer + desktop share these) ---------- */
.side-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 1rem 1rem .6rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--side-text);
  min-width: 0;
}
.brand img { height: 38px; width: auto; display: block; flex-shrink: 0; }
  :root[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
.brand-name { font-weight: 700; font-size: .92rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-collapse {
  flex-shrink: 0;
  width: 2rem; height: 2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--side-muted);
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
}
.nav-collapse:hover { background: var(--side-hover); color: var(--side-text); }
.nav-collapse svg { width: 1rem; height: 1rem; display: block; }
.nav-search-icon { display: flex; flex-shrink: 0; }
.nav-search-icon svg { width: 1.05rem; height: 1.05rem; display: block; }
.nav-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 1rem .4rem;
  padding: .55rem .8rem;
  background: var(--side-hover);
  border-radius: 12px;
  color: var(--side-muted);
  font-size: .9rem;
}
.nav-search input {
  border: 0; background: transparent; outline: none; padding: 0;
  font: inherit; font-size: .88rem; color: var(--side-text);
  width: 100%;
}
.nav-search input::placeholder { color: var(--side-muted); }
.side-nav { display: flex; flex-direction: column; padding: .25rem .75rem; gap: .15rem; flex: 1; overflow-y: auto; }
.side-nav a {
  color: var(--side-text);
  text-decoration: none;
  padding: .62rem .8rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 500;
  font-size: .93rem;
  min-height: 44px;
}
.side-nav a:hover { background: var(--side-hover); }
.side-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-icon { width: 1.5rem; height: 1.5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 1.35rem; height: 1.35rem; display: block; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Collapsible menu categories */
  .nav-group { margin-top: .9rem; }
  .nav-group-head {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    padding: .45rem .8rem; margin: 0 0 .15rem;
    background: transparent; border: 0; cursor: pointer;
    color: var(--side-muted); font: inherit;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  }
  .nav-group-head .nav-icon svg { width: 1.1rem; height: 1.1rem; }
  .nav-group-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-group-chev { display: flex; }
  .nav-group-chev svg { width: .9rem; height: .9rem; display: block; transition: transform .18s; }
  .nav-group-items { display: flex; flex-direction: column; gap: .15rem; }
  .nav-group.closed .nav-group-items { display: none; }
  .nav-group.closed .nav-group-chev svg { transform: rotate(-90deg); }
  /* While searching, force every group open so matches are visible */
  .side-nav.nav-searching .nav-group-items { display: flex !important; }
.side-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .75rem;
  padding: .7rem .8rem;
  background: var(--side-hover);
  border-radius: 14px;
}
.profile-link {
  display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1;
  color: inherit; text-decoration: none; border-radius: 10px;
}
.profile-link:hover { text-decoration: none; }
.profile-hero { display: flex; align-items: center; gap: 1rem; }
/* Dashboard quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.quick-action {
  display: flex; align-items: center; gap: .65rem;
  padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text); background: var(--card);
  font-weight: 500; font-size: .9rem; min-height: 52px;
}
.quick-action:hover { background: var(--side-hover); text-decoration: none; }
.quick-action-icon { display: flex; flex-shrink: 0; color: var(--side-muted); }
.quick-action-icon svg { width: 1.3rem; height: 1.3rem; display: block; }
/* Dashboard hero banner (from the dashboard mockup) — dark in both themes */
.dash-banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: url('/images/banner-community.jpg') center / cover no-repeat, var(--navy);
  color: #fff;
  display: grid; grid-template-columns: 1fr; gap: 1.1rem;
  padding: 1.5rem; margin-bottom: 1rem;
}
.dash-banner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(19,28,38,.95) 25%, rgba(19,28,38,.6) 65%, rgba(19,28,38,.35));
}
.dash-banner > * { position: relative; }
.dash-banner-icon svg { width: 2rem; height: 2rem; display: block; }
.dash-banner-content h2 { color: #fff; font-size: 1.35rem; margin: .6rem 0 .4rem; line-height: 1.3; }
.dash-banner-content p { color: rgba(255,255,255,.8); margin: 0; max-width: 34rem; }
.dash-banner-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; align-content: center; }
.dash-banner-points li { display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: .92rem; }
.dash-banner-points svg { width: 1.15rem; height: 1.15rem; color: #48A7F0; flex-shrink: 0; }
.dash-banner-logo { position: absolute; right: 1rem; bottom: 1rem; height: 52px; width: auto; filter: brightness(0) invert(1); opacity: .95; }
@media (min-width: 720px) {
  .dash-banner { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 2rem 2.25rem; }
}
.profile-avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.3rem; }
/* Profile page tabs (CRM-style pills) */
.profile-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.profile-tab {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: .5rem 1.15rem; font: inherit; font-weight: 500; cursor: pointer;
}
.profile-tab:hover { background: var(--side-hover); }
.profile-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.profile-tab.active:hover { background: var(--accent); }
/* Profile photos */
.profile-avatar-img { object-fit: cover; border-radius: 50%; background: var(--border); }
.avatar-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.field .hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.check-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.check-row:last-of-type { border-bottom: 0; }
.check-row input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); flex-shrink: 0; }
.profile-avatar {
  width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
}
.profile-meta { min-width: 0; flex: 1; }
.profile-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-email { font-size: .75rem; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-expand {
  flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
  color: var(--side-muted); font-size: 1rem; padding: .3rem; border-radius: 8px; line-height: 1;
}
.profile-expand:hover { color: var(--side-text); }
.profile-expand svg { width: 1rem; height: 1rem; display: block; }
.profile-menu {
  position: absolute;
  bottom: calc(100% + .5rem); left: 0; right: 0;
  background: var(--side-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: .9rem;
  z-index: 5;
}
.profile-menu .profile-role { font-size: .78rem; color: var(--side-muted); margin-bottom: .7rem; }

@media (min-width: 1024px) {
  .app { flex-direction: row; }
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 272px;
    flex-shrink: 0;
    margin: 1rem 0 1rem 1rem;
    height: calc(100vh - 2rem);
    position: sticky;
    transform: none;
    top: 1rem;
    background: var(--side-bg);
    color: var(--side-text);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  /* Collapsed icon rail */
  html.nav-collapsed .sidebar { width: 88px; }
  html.nav-collapsed .brand-name,
  html.nav-collapsed .nav-search,
  html.nav-collapsed .nav-label,
  html.nav-collapsed .profile-meta,
  html.nav-collapsed .profile-expand { display: none; }
  html.nav-collapsed .side-brand { justify-content: center; padding: 1rem .5rem .6rem; }
  html.nav-collapsed .side-nav { padding: .25rem .5rem; align-items: center; }
  html.nav-collapsed .nav-group { margin-top: .4rem; }
  html.nav-collapsed .nav-group-head { display: none; }
  html.nav-collapsed .nav-group-items { display: flex !important; }
  html.nav-collapsed .side-nav a { justify-content: center; padding: .62rem; width: 3rem; }
  html.nav-collapsed .side-nav a.active { border-radius: 12px; }
  html.nav-collapsed .side-profile { justify-content: center; margin: .75rem .5rem; padding: .6rem .4rem; }

  .nav-open-btn { display: none; }
  .nav-close-btn { display: none; }
  .nav-collapse { display: flex; }
  .nav-backdrop { display: none; }
  .topbar-brand { display: none; }
  .topbar { background: var(--topbar-bg); color: var(--text); border-bottom: 1px solid var(--border); }
  .topbar .btn-ghost { color: var(--muted); border-color: var(--border); }
  .topbar-user { display: inline; }
  .theme-toggle { border-color: var(--border); background: transparent; color: var(--text); }
  .theme-toggle:hover { background: var(--side-hover); }
  .content { padding: 1.5rem 2rem 3rem; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .check-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Schedule / calendar (Milestone 4) ---------- */
.cal-nav {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-bottom: 1rem;
}
.cal-nav .spacer { flex: 1; }
.cal-views { display: flex; gap: .25rem; }
.cal-title { font-size: 1.25rem; font-weight: 700; color: var(--heading); margin: 0; }
.cal-month {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.cal-dow {
  padding: .5rem .25rem; text-align: center; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--table-head); border-bottom: 1px solid var(--border);
}
.cal-day {
  min-height: 4.2rem; padding: .3rem; border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); font-size: .78rem;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day-num { font-weight: 700; color: var(--heading); }
.cal-day.other { background: var(--bg-soft); color: var(--muted); }
.cal-day.today .cal-day-num {
  background: var(--accent); color: #fff; border-radius: 50%;
  display: inline-block; width: 1.5rem; height: 1.5rem; line-height: 1.5rem; text-align: center;
}
.cal-day a.day-link { color: inherit; text-decoration: none; display: block; }
.cal-ev {
  display: block; margin-top: .2rem; padding: .1rem .3rem; border-radius: 4px;
  font-size: .72rem; line-height: 1.3; color: #fff; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-visit { background: var(--accent); }
.ev-inspection { background: #B7791F; }
.ev-turnover { background: var(--navy); }
.ev-arrival { background: var(--success); }
.ev-departure { background: #6B7A90; }
.cal-more { font-size: .72rem; color: var(--muted); margin-top: .15rem; display: block; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
.cal-week-col {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem; min-height: 8rem; box-shadow: var(--shadow);
}
.cal-week-col h3 { font-size: .85rem; margin: 0 0 .4rem; }
.cal-week-col.today { border-color: var(--accent); }
.day-event {
  display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.day-event:last-child { border-bottom: 0; }
.day-time { font-weight: 700; color: var(--heading); min-width: 4.5rem; font-size: .85rem; }
.day-kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.day-kind.k-visit { color: var(--accent); }
.day-kind.k-inspection { color: #B7791F; }
.day-kind.k-turnover { color: var(--heading); }
.day-kind.k-arrival { color: var(--success); }
.day-kind.k-departure { color: #6B7A90; }

/* ---------- Checklists (Milestone 4) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .95rem;
}
.checklist li:last-child { border-bottom: 0; }
.checklist input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex-shrink: 0; }
.checklist .done { text-decoration: line-through; color: var(--muted); }
.check-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }

/* ---------- Print-friendly inspection report ---------- */
.report { max-width: 800px; margin: 0 auto; background: #fff; color: #111; padding: 2rem; font-size: 14px; }
.report h1 { color: #111; }
.report table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.report th, .report td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #ddd; vertical-align: top; }
.report th { width: 11rem; color: #555; font-weight: 600; }
.report .check { color: #1E7E34; font-weight: 700; }
.report .uncheck { color: #999; }
@media print {
  .report { padding: 0; max-width: none; }
  .no-print { display: none !important; }
}

/* ---------- STR/LTR (Milestone 6) ---------- */
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.input-group { display: flex; gap: .5rem; }
.input-group .input { flex: 1; min-width: 0; }
.truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-err { color: var(--danger); }
.num { text-align: right; }
.str-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 1rem; }
.str-card { display: block; color: inherit; text-decoration: none; }
.str-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.str-card-top strong { font-size: 1.05rem; color: var(--heading); }
.str-stats { display: flex; gap: 1.25rem; margin-top: .6rem; }
.str-stat { display: flex; flex-direction: column; }
.str-stat .stat-value { font-size: 1.25rem; }
.str-note { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.str-card.status-booked { border-left-color: var(--success); }
.str-card.status-blocked { border-left-color: var(--warm); }
.str-card.status-vacant { border-left-color: var(--accent); }
/* Property galleries on STR/LTR lists */
.str-cover { margin: -.9rem -.9rem .75rem; }
.str-cover img { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: var(--radius) var(--radius) 0 0; }
.prop-cell { display: flex; align-items: center; gap: .6rem; }
.prop-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
/* Gallery strips on STR/LTR pages */
.gallery-strip { display: flex; gap: .6rem; overflow-x: auto; padding: .25rem 0 .75rem; margin-bottom: .5rem; scrollbar-width: thin; }
.gallery-item { flex: 0 0 auto; width: 180px; text-decoration: none; color: inherit; }
.gallery-item img { width: 180px; height: 120px; object-fit: cover; border-radius: 10px; display: block; background: var(--bg-soft); }
.gallery-item span { font-size: .75rem; color: var(--muted); display: block; margin-top: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Property photo gallery (detail page) + lightbox — applies at all widths */
.prop-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.prop-gallery-item { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--side-hover); border: 1px solid var(--border); }
.prop-gallery-item > a { display: block; aspect-ratio: 4 / 3; }
.prop-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-badge { position: absolute; top: .4rem; left: .4rem; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.prop-gallery-item figcaption { display: flex; gap: .4rem; padding: .45rem; flex-wrap: wrap; background: var(--card); }
.files-sub { margin: 1.2rem 0 .6rem; font-size: 1rem; }
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 15, 20, .92); }
.lightbox-img { position: relative; max-width: 92vw; max-height: 80vh; border-radius: 8px; object-fit: contain; }
.lightbox-close { position: absolute; top: .75rem; right: .75rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox-prev { left: .6rem; }
.lightbox-next { right: .6rem; }
.lightbox-meta { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; }
.pill-booked { background: #DFF0E2; color: var(--success); }
.pill-blocked { background: #FFF1DE; color: #9A5B00; }
.pill-vacant { background: #DDEBFA; color: var(--heading); }
.pill-emergency { background: #FDECEA; color: var(--danger); }
/* STR availability calendar */
.str-cal { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: .85rem; }
.str-cal th { background: var(--table-head); color: var(--heading); font-size: .72rem; text-transform: uppercase; padding: .5rem .25rem; }
.str-cal td { border: 1px solid var(--border); padding: .3rem; vertical-align: top; height: 4.2rem; width: 14.28%; }
.str-cal td.pad { background: var(--bg-soft); }
.str-cal .day-num { font-weight: 700; color: var(--heading); }
.str-cal td.today .day-num { background: var(--navy); color: #fff; border-radius: 50%; display: inline-block; width: 1.5rem; height: 1.5rem; line-height: 1.5rem; text-align: center; }
.str-cal .ev { display: block; font-size: .72rem; line-height: 1.25; border-radius: 4px; padding: .1rem .3rem; margin-top: .15rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-cal .ev-booked { background: #DFF0E2; color: #155C25; }
.str-cal .ev-blocked { background: #FFF1DE; color: #9A5B00; }
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .str-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Phase 4 — shared design system (website program)
   Canonical brand tokens from the buckeyearm.com WordPress theme
   (buckeye-arm/assets/css/main.css). Visual refresh only: no markup
   structure, permission, or behavior changes. Existing token names are
   kept as aliases so nothing already referencing them breaks.
   ========================================================================== */
:root {
  --navy-deep: #1B2E3B;
  --ink: #1F2933;
  --blue-dark: #1E7CC4;
  --blue-soft: #CAE2F5;
  --bg-soft: #EEF2F6;
  --line: #DCE4EC;
  --shadow-sm: 0 1px 2px rgba(38, 61, 78, 0.06), 0 2px 8px rgba(38, 61, 78, 0.06);
  --shadow-md: 0 4px 16px rgba(38, 61, 78, 0.10);
}

/* Links: deepen for contrast, matching the WP theme's link treatment. */
a { color: var(--blue-dark); }

/* Visible keyboard focus everywhere (a11y). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Section eyebrow label, shared with the public site. */
.eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: .35rem;
}
.page-head > .eyebrow { flex: 0 0 100%; margin-bottom: -.35rem; }
.page-head h1 { letter-spacing: -0.01em; }

/* ---------- Buttons: primary = navy (shared with public site) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--blue-dark); }
.btn-sm { min-height: 0; box-shadow: none; }

/* ---------- Cards & panels ---------- */
.card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}
.panel > h2:first-child { margin-bottom: .5rem; }

/* Modern stat tiles: label on top, big tabular value below. Same data. */
.card.stat {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem;
}
.stat-label {
  order: -1;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-sub { font-variant-numeric: tabular-nums; }

/* Inline status tag (the notification-count .badge stays absolute). */
.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  background: var(--tag-bg);
  color: var(--heading);
  border-radius: 999px;
  padding: .15rem .6rem;
  vertical-align: middle;
  white-space: nowrap;
}
.tag-warm { background: #FFF1DE; color: #9A5B00; }
.tag-green { background: #DFF0E2; color: #155C25; }
.tag-red { background: #FDECEA; color: #8E2A20; }

/* Previously-used-but-undefined classes. */
.price-big { font-size: 1.75rem; font-weight: 800; color: var(--heading); margin: .25rem 0; font-variant-numeric: tabular-nums; }
.form-card { max-width: 640px; padding: 1.25rem; }
.form-card > label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; color: var(--heading); margin-bottom: .9rem; }
.form-card input, .form-card select, .form-card textarea {
  font: inherit; font-weight: 400; color: var(--text);
  padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text); width: 100%;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: 2px solid var(--accent-light); border-color: var(--accent);
}
.download-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

/* ---------- Tables ---------- */
.table th { background: var(--table-head); }

/* ---------- Auth (login) ---------- */
.auth-wrap {
  background: radial-gradient(120% 100% at 50% 0%, var(--navy) 0%, var(--navy-deep) 100%);
}
.auth-card {
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  padding: 2.25rem 2rem;
}
.auth-logo {
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
/* Dark mode: the dark navy logo turns white (no white box). */
:root[data-theme="dark"] .auth-logo { filter: brightness(0) invert(1); }

/* ---------- App frame: sidebar / topbar / bottom nav ---------- */
.topbar { box-shadow: var(--shadow-sm); }


/* Empty states */
.empty-card {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- Desktop refinements ---------- */
@media (min-width: 1024px) {
  .cards { gap: 1rem; }
  .card.stat { padding: 1.25rem; }
  .topbar {
    background: var(--card);
    color: var(--text);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
}

/* ==========================================================================
   Phase 6 — dashboard redesign + dark/light mode
   ========================================================================== */

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--side-hover);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.auth-theme-toggle { position: fixed; top: 1rem; right: 1rem; z-index: 60; }

/* ---------- Dark-mode contrast fixes for pastel status surfaces ---------- */
:root[data-theme="dark"] .alert-error { background: #3A2320; color: #F2B8B0; border-color: #6E3B34; }
:root[data-theme="dark"] .alert-success { background: #1C3325; color: #A9DDB4; border-color: #2E5B3C; }
:root[data-theme="dark"] .tag-warm { background: #4A3418; color: #FFD9A0; }
:root[data-theme="dark"] .tag-green { background: #1E3D28; color: #A9DDB4; }
:root[data-theme="dark"] .tag-red { background: #3A2320; color: #F2B8B0; }
:root[data-theme="dark"] .pill-booked { background: #1E3D28; color: #A9DDB4; }
:root[data-theme="dark"] .pill-blocked { background: #4A3418; color: #FFD9A0; }
:root[data-theme="dark"] .pill-vacant { background: #1E3A52; color: #9FD0F5; }
:root[data-theme="dark"] .pill-emergency { background: #3A2320; color: #F2B8B0; }

/* ---------- AnyChat launcher bubble: match the site's brand blue ----------
   The widget injects its own background (red #D32F2F) via an ID selector in an
   injected <style> block, so this needs !important to win. --accent is the same
   brand blue in light and dark mode (sidebar active pill, primary buttons), and
   the white headset icon stays untouched on top of it. */
body.has-chat [id^="anw2-launcher-"] {
  background-color: var(--accent) !important;
}


