/* Always-dark theme, matching cwaJPODdash's black-background look - not conditional on OS
   preference like the light/dark toggle this used to have, just permanently on. Keeps GRCIT's own
   red brand accent (the dark-mode-tuned shades, lighter/brighter than the light-theme reds so they
   still read clearly against black) rather than JPODdash's blue. */
:root {
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --gridline: #2c2c2a;
  --brand: #ef8a7a;
  --brand-dark: #d9483a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.5;
}

header.site {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #5a2622;
  color: #fff;
  padding: 14px 20px;
  min-height: 36px;
}

header.site .brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
header.site .brand-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 4px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
header.site .brand-logo { height: 36px; width: 36px; object-fit: contain; }
header.site h1 { margin: 0; font-size: 1.5rem; }
header.site p { margin: 4px 0 0; color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; }

/* ── Standard title-bar icon buttons (Home / Back / Settings / Profile) ──────
   Matches dashboard.fity.ca, cwaMITEL, cwaJPODdash, and cwaG4LNdash — reuse this exact icon
   set/markup everywhere instead of inventing new button styles per app. */
.title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

.title-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 2px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover { background: rgba(0, 0, 0, 0.35); }
.icon-btn svg { width: 18px; height: 18px; fill: #ffffff; }

/* Profile icon turns green once signed in - a visible confirmation the PIN was accepted, distinct
   from the neutral dark circle every other icon uses. Same convention as cwaJPODdash/cwaJPODzoom. */
/* White + brand-red instead of the green every sibling app uses - green-on-red clashes (and is
   rough for colorblind users too); this ties into the white logo-box treatment already in the
   header instead of introducing an unrelated third color. */
.icon-btn.signed-in { background: #ffffff; }
.icon-btn.signed-in svg { fill: var(--brand-dark); }
.icon-btn.signed-in:hover { background: #f0f0f0; }

.dropdown-menu-custom {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  padding: 0.4rem;
  z-index: 30;
}

.dropdown-menu-custom.show { display: block; }

.dropdown-menu-custom .label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.7rem 0.2rem;
}

.dropdown-menu-custom .item {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.87rem;
  cursor: pointer;
}

.dropdown-menu-custom .item:hover { background: var(--page); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ── Home cards — support/contacts side by side, customer info below once signed in. ────── */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.session-card {
  flex: 1 1 340px;
  max-width: 420px;
  padding: 1.75rem 1.5rem;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
}

/* Wide, single jump-off card - Home page's "Dashboard" button only. Row layout (icon beside
   label), max-width matches two .session-cards + their .cards-row gap (420px * 2 + 20px) so it
   lines up with the panel rows above it, shrinking on narrower viewports same as they do. Distinct
   on purpose from .app-card below: that one is for the small standardized tiles on the Dashboard
   page itself (Manager Library/M365 Tenant/RingCentral/Billing), this one is not used there. */
.action-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 860px;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.action-card:hover { transform: translateY(-2px); background: var(--page); }
.action-card svg { width: 30px; height: 30px; color: var(--brand-dark); flex-shrink: 0; }
.action-card span { font-size: 1.1rem; font-weight: 800; }

/* ── Launcher grid — jump-off action cards on the Dashboard page. Matches cwaJPODdash's own
   .app-grid/.app-card exactly (same tile size, icon-above-label layout, 44px Material Icons). */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.app-card:hover { transform: translateY(-3px); background: var(--page); }

.app-card__icon-wrap { display: flex; align-items: center; justify-content: center; height: 44px; }
.app-card__icon { width: 44px; height: 44px; color: #d4a94a; }
.app-card__label { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }

.support-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.support-card__title { margin: 0 0 4px; font-size: 1.1rem; }
.support-card__header .support-card__title { margin: 0; }

/* Full-width Guide CTA - deliberately not a small icon button, per feedback that the original
   tiny circle icon read as too easy to miss. Subtle/muted styling (light fill, brand-colored text
   and border) rather than a solid red block, per feedback that a strong red was too loud. */
.guide-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--page);
  color: #c9877c;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}
.guide-cta:hover { background: var(--border); }
.guide-cta svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }

/* Support/Contacts cards reuse .verify-info's label/value row layout - here the value is a
   mailto:/tel: link rather than plain text, so it needs its own color instead of inheriting
   default link blue. */
.session-card .verify-info a { color: #c9877c; text-decoration: none; }
.session-card .verify-info a:hover { text-decoration: underline; }

/* Guide modal body - short bulleted items, each flagged with a big red checkmark rather than a
   plain bullet, per feedback that the original prose paragraphs were too long/wordy. */
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li {
  position: relative;
  padding: 9px 0 9px 34px;
  font-size: 0.87rem;
  line-height: 1.45;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.guide-list li:last-child { border-bottom: none; }
.guide-list li::before {
  content: "\2713";
  position: absolute;
  left: 2px;
  top: 7px;
  font-size: 1.3rem;
  font-weight: 900;
  color: #c9877c;
}
.guide-list a { color: #c9877c; }

/* ── Sign-in / verification modals ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.modal-header {
  background: var(--brand-dark);
  color: #fff;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { opacity: 0.7; }
.modal-body { padding: 18px 20px 20px; }

.form-field { margin-bottom: 14px; }
.form-field:last-of-type { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.text-input {
  width: 100%;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.text-input:focus { outline: none; border-color: var(--brand); }

.btn {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--brand-dark);
  color: #fff;
  margin-top: 16px;
}

.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.6; cursor: default; }

.form-error { margin-top: 10px; font-size: 0.78rem; color: #e5484d; }
.form-error:empty { display: none; }

/* New-Sign-In verification modal's info block (Date/Time, IP, User ID, Last Login). */
.verify-info { margin-bottom: 14px; font-size: 0.82rem; }
.verify-info__row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.verify-info__row:last-child { border-bottom: none; }
.verify-info__row span { color: var(--text-muted); }
.verify-info__row b { text-align: right; font-weight: 700; }

/* ── Document table (Manager Library) — plain data table with an inline "View PDF" button per
   row, same shape as cwaNCMEadmin's DataTables-driven document lists, but hand-rolled to match
   this app's own dark theme instead of pulling in jQuery/Bootstrap/DataTables for what's a
   handful of rows with no real need for search/sort/pagination. */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.data-table th, .data-table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--gridline); white-space: nowrap; }
.data-table th { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 800; background: var(--page); }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-primary); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--page); }
.data-table .btn-view {
  font-size: 0.78rem; font-weight: 700; padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--page); color: var(--brand-dark);
  text-decoration: none; display: inline-block;
}
.data-table .btn-view:hover { background: var(--border); }
.data-table-count { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 14px; }
