/* Shared colors for the admin and login pages. Load it after the page's own styles.
   Resident pages don't use this file; they use resident.css. */

:root {
  --ref-blue:      #006E7F !important;   /* deep action blue (was #007F94) */
  --ref-blue-dark: #005563 !important;
  --ref-navy-text: #022127 !important;
  --ref-bg:        #ECF1F3 !important;
  --ref-border:    #D3E0E3 !important;
  --ref-tint:      #DEEBEF !important;
  --ref-tint-border:#B8D3DB !important;

  --color-primary:        #006E7F !important;
  --color-primary-dark:   #005563 !important;
  --color-primary-light:  #DEEBEF !important;

  --brand-blue:       #006E7F !important;
  --brand-blue-light: #005563 !important;
  --brand-blue-dark:  #003038 !important;

  --navy:        #041519 !important;   /* resident sidebar */
  --navy-active: #006E7F !important;
}

/* ===== Admin sidebar: darker navy ===== */
.admin-sidebar {
  background: #041A1F !important;      /* was #13292F */
}
.admin-sidebar .sidebar-label { color: #2E7484 !important; }
.admin-sidebar .sidebar-link { color: #A4BDC4 !important; }
.admin-sidebar .sidebar-link:hover { background: #002A32 !important; color: #fff !important; }
.admin-sidebar .sidebar-link.active {
  background: #006E7F !important;
  box-shadow: 0 6px 16px rgba(0,110,127,.35);
}

/* sidebar SVG logo tiles that used the old blue gradient */
.admin-sidebar .brand-logo-lg rect,
.admin-sidebar .brand-logo-lg { background: #006E7F !important; }

/* ===== Admin topbar avatar ===== */
.admin-avatar { background: #006E7F !important; }

/* ===== Buttons that hardcode the old blue inline ===== */
.btn-new-announcement, .btn-new-official { background: #006E7F !important; }
.btn-new-announcement:hover, .btn-new-official:hover { background: #005563 !important; }
/* ===== Keyboard focus: one visible ring everywhere (mouse clicks don't show it) ===== */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #006E7F;
  outline-offset: 2px;
}
.admin-sidebar :where(a, button):focus-visible,
.sidebar :where(a, button):focus-visible { outline-color: #00B8DC; }

/* =====================================================================
   Type scale and contrast (admin)
   One scale for every admin page. Loaded after each page's own <style>,
   so these win over the per-page sizes without editing every page.
     Page title   26px / 800    Card / section title 16px / 700
     Body         14px / 400    Strong row text      14.5px / 600-700
     Meta, hints  13px / 400    Pills, small labels  12px / 600-700
   Nothing readable goes under 12px. Secondary text is #485B5F
   (7.2:1 on white, 6.4:1 on the page background).
   ===================================================================== */
:root {
  --ref-gray-text: #485B5F !important;   /* was #6A7476: 4.3:1 on the page bg */
  --ref-border:    #CFDBDE !important;   /* cards separate from the page */
  --ref-red:       #B42F2F !important;   /* readable on its pink badge (5.3:1) */
  --ref-navy-text: #022127 !important;
  --bs-secondary-color: #485B5F;
  --bs-body-color: #022127;
}
.admin-layout .text-muted, .modal .text-muted, .offcanvas .text-muted { color: #485B5F !important; }

/* ---------- Sidebar ---------- */
.admin-sidebar .brand-name { font-size: 16px !important; font-weight: 800 !important; letter-spacing: -0.01em; }
.admin-sidebar .sidebar-label { color: #7E9EA7 !important; font-size: 11.5px !important; font-weight: 700; letter-spacing: .07em; }
.admin-sidebar .sidebar-link { color: #BBCFD5 !important; font-size: 14px; font-weight: 500; }
.admin-sidebar .sidebar-link.active { font-weight: 700; color: #fff !important; }
.admin-sidebar .sidebar-link .count { font-size: 12px; font-weight: 800; }
.sidebar-me .me-name { font-size: 14px; }
.sidebar-me .me-pos { color: #8FABB3 !important; font-size: 12.5px; }

/* ---------- Page title ---------- */
.admin-topbar h4 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }

/* ---------- Cards and section titles ---------- */
.admin-layout :is(.card-title, .team-bar .team-title, .d-heading) { font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
.admin-layout .card-link { font-size: 13px; font-weight: 700; }
.admin-layout :is(.team-bar .team-sub, .cal-month) { font-size: 13px; }

/* Numbers are the point of a stat card: big and heavy. Their labels stay quiet. */
.admin-layout .stat-number { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.admin-layout .stat-mini .stat-number { font-size: 24px; }
.admin-layout .card-count .count-num { font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.admin-layout :is(.stat-label, .stat-mini .stat-label, .card-count .count-label) { font-size: 13px; font-weight: 500; color: var(--ref-gray-text); }

/* ---------- Lists and rows ---------- */
.admin-layout .concern-title { font-size: 15px; font-weight: 700; }
.admin-layout :is(.concern-meta, .cell-sub, .drawer-sub, .doc-res, .queue-ref, .side-item .side-ref, .cal-next-row .when, .table-foot) { font-size: 12.5px; font-weight: 400; color: var(--ref-gray-text); }
.admin-layout .queue-row { font-size: 14px; }
.admin-layout :is(.queue-empty, .empty) { font-size: 14px; }
.admin-layout .empty strong { font-size: 16px; font-weight: 700; }
.admin-layout .empty i { color: #899BA0 !important; }

/* Tables: header labels small and bold, cell text at body size */
.admin-layout :is(.req-table, .log-table) th { font-size: 12px; font-weight: 700; color: var(--ref-gray-text); letter-spacing: .02em; }
.admin-layout :is(.req-table, .log-table) td { font-size: 14px; }
.admin-layout .ref { color: var(--ref-gray-text); }
.admin-layout .cell-main { font-weight: 700; }

/* ---------- Pills, badges, tags: one readable size ---------- */
.admin-layout :is(.status-pill, .pill, .badge-pill, .cat-badge, .category-tag, .popup-status, .group-count),
.modal :is(.status-pill, .pill, .badge-pill, .cat-badge, .category-tag, .popup-status),
.offcanvas :is(.status-pill, .pill),
.leaflet-popup .popup-badge, .popup-badge { font-size: 12px !important; font-weight: 700; letter-spacing: 0; }
.admin-layout .tab { font-size: 14px; }
.admin-layout .tab-count { font-size: 12px; }
.admin-layout .pinned-badge { font-size: 12px; }
.status-pending-pill, .badge-photo { color: #7F5608 !important; }
.badge-unverified { color: #B42F2F !important; }

/* ---------- Small uppercase labels ---------- */
.modal-section-label, .source-box .src-label, .party-box .party-role, .rid-box .rid-label, .pv-eyebrow {
  font-size: 12px !important; font-weight: 700; letter-spacing: .05em;
}
.party-vs { font-size: 12px !important; }
.photo-check .sev { font-size: 11px !important; }
.photo-check .src, .guide-refs .tag, .preview-caption, .pv-btn { font-size: 12px !important; }
.timeline-date { font-size: 12.5px !important; color: var(--ref-gray-text); }
.timeline-label, .tl-label { font-size: 14px !important; }
.rule-note, .guide-box { font-size: 13px !important; }
.convert-form .form-label { font-size: 13px !important; }
.kv { font-size: 14px !important; }
.kv dt { font-weight: 400 !important; }
.kv dd { font-weight: 600; }
.drawer-title { font-size: 18px !important; font-weight: 800 !important; letter-spacing: -0.01em; }
.timeline li { color: #66767B; }   /* steps not reached yet: dim but readable */

/* ---------- Dashboard calendar and map ---------- */
.cal-grid { font-size: 13px !important; }
.cal-grid .dow { font-size: 12px !important; }
.cal-grid .day.muted { color: #87969A !important; }   /* other-month days stay quiet on purpose */
.map-legend, .map-help, .side-item .side-ref { font-size: 12px !important; }
.card-map :is(.map-label, .map-open) { font-size: 13px !important; }
.basemap-switch button { font-size: 13px !important; }

/* ---------- Admin FullCalendar ---------- */
.admin-layout .fc .fc-col-header-cell-cushion,
.admin-layout .fc .fc-daygrid-more-link,
.admin-layout .fc :is(.fc-timegrid-slot-label-cushion, .fc-timegrid-axis-cushion) { font-size: 12px !important; }
.admin-layout .fc .fc-toolbar-title { font-weight: 800; letter-spacing: -0.01em; }

/* ---------- Inputs and modals ---------- */
.admin-layout :is(.filter-bar select, .filter-bar input, .filter-bar .form-control, .filter-bar .form-select) { font-size: 14px; }
.admin-layout .form-control, .admin-layout .form-select,
.modal .form-control, .modal .form-select { border-color: #C4D2D6; }
.modal .modal-title, .offcanvas .offcanvas-title { font-weight: 800; letter-spacing: -0.01em; }
.modal .form-label, .offcanvas .form-label { font-weight: 600; color: #022127; }

/* =====================================================================
   Calmer admin screens
   Fewer boxes, stripes, tints and badges. Color is kept for things that
   need attention (pending, unverified, flagged, urgent); normal states
   are plain text.
   ===================================================================== */

/* ---------- Stat strips: one panel split by hairlines, not six boxes ---------- */
.admin-layout .stat-strip {
  gap: 1px !important; background: var(--ref-border); border: 1px solid var(--ref-border);
  border-radius: 12px; overflow: hidden;
}
.admin-layout .stat-strip .stat-mini { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: #fff; }

/* ---------- Filter bars: a plain row of controls, no card around them ---------- */
.admin-layout .filter-bar { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }

/* ---------- Concern and blotter lists: one panel with row dividers ---------- */
#concernList, #caseList {
  background: #fff; border: 1px solid var(--ref-border); border-radius: 12px; overflow: hidden;
}
#concernList:not(:has(> .concern-card:not(.d-none))),
#caseList:not(:has(> .blotter-card:not(.d-none))) { display: none; }
.admin-layout :is(.concern-card, .blotter-card) {
  margin: 0 0 -1px !important;               /* the last row's divider hides under the panel edge */
  border: 0 !important; border-bottom: 1px solid var(--ref-border) !important; border-radius: 0 !important;
  box-shadow: none !important; position: relative;
}
.admin-layout :is(.concern-card, .blotter-card):hover { background: #F7F8FC; box-shadow: none !important; }
/* Only urgent rows keep a marker: a thin red bar inside the row */
.admin-layout :is(.concern-card.urgent-border, .blotter-card.border-escalated)::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ref-red);
}
/* Category icons: plain glyphs, no tile behind them */
.admin-layout :is(.concern-icon, .blotter-icon) { background: transparent !important; width: 28px !important; height: 28px !important; font-size: 20px; }
.admin-layout .blotter-icon { color: var(--ref-gray-text) !important; }

/* Normal states read as plain text; only states that need action keep a colored badge */
.badge-anon, .badge-verified {
  background: transparent !important; color: var(--ref-gray-text) !important; font-weight: 500 !important; padding-left: 4px !important; padding-right: 4px !important;
}
.badge-verified::before { content: '\2713\00a0'; color: #1E7A34; font-weight: 700; }

/* ---------- Audit log: category as quiet text, not a colored pill on every row ---------- */
.admin-layout .cat-badge { background: transparent !important; color: var(--ref-gray-text) !important; font-weight: 500 !important; padding: 0 !important; font-size: 13px !important; }
.admin-layout .cat-badge.cat-concerns { color: var(--ref-navy-text) !important; }

/* ---------- Row actions: quiet text buttons instead of three outlined colors ---------- */
.admin-layout .btn-sm:is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger, .btn-outline-success) {
  border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; font-weight: 600;
}
.admin-layout .btn-sm.btn-outline-secondary { color: var(--ref-navy-text); }
.admin-layout .btn-sm.btn-outline-primary { color: #006E7F; }
.admin-layout .btn-sm.btn-outline-success { color: #1E7A34; }
.admin-layout .btn-sm.btn-outline-danger { color: #B42F2F; }
.admin-layout .btn-sm:is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger, .btn-outline-success):hover {
  background: #ECF1F3; border-color: transparent;
}
.admin-layout .btn-sm.btn-outline-danger:hover { background: #FDECEC; color: #B42F2F; }

/* ---------- Dashboard ---------- */
/* Stat cards: the number carries the meaning, so the tinted icon tiles go */
.admin-layout .card-stat .stat-icon { display: none !important; }
.admin-layout .card-stat { min-height: 92px; }
/* Count cards: white like every other card; only the number keeps its color */
.admin-layout :is(.card-accounts, .card-docpending, .card-photos, .card-photos.has-items) { background: #fff !important; border-color: var(--ref-border) !important; }
.admin-layout .card-title i, .card-calendar .card-title i { display: none; }

/* ---------- Less shadow ---------- */
.admin-sidebar .sidebar-link.active { box-shadow: none !important; }
.admin-layout :is(.box, .bento-card, .official-card) { box-shadow: none !important; }
.admin-layout .concern-icon i { color: var(--ref-gray-text) !important; }
.admin-layout .concern-card.urgent-border .concern-icon i { color: var(--ref-red) !important; }

/* ===== Admin sidebar stays put while the page scrolls (desktop) =====
   Phones and tablets already use the fixed slide-in menu from partials/admin-sidebar. */
@media (min-width: 992px) {
  .admin-layout { align-items: flex-start; }
  .admin-sidebar {
    position: sticky; top: 0; align-self: flex-start;
    height: 100vh; height: 100dvh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #00404C transparent;
  }
}

/* Admin page entrance: content fades up when switching sections; instant with reduced motion. */
@keyframes admin-page-in { from { opacity: 0; transform: translateY(8px); } }
.admin-main { animation: admin-page-in 300ms cubic-bezier(.2,.8,.2,1) backwards; }
@media (prefers-reduced-motion: reduce) { .admin-main { animation: none; } }
