/* =========================================================
   PHXXS — Unified Style
   - Blue hero header with circular back button (reference-matched)
   - Tiles grid (1-col mobile → 3-col desktop)
   - Operations Log (chips + latest lists)
   - Consistent buttons, typography & footer
   - Safe for all current & future landing pages
   ========================================================= */

/* ---------- Root tokens ---------- */
:root{
  --bg: #f3f6fa;
  --card: #ffffff;
  --ink: #0c2633;
  --ink-2:#294a5c;
  --muted:#7b94a6;
  --line:#e7eef5;
  --accent:#0ea5e9;          /* PHXXS blue */
  --shadow: 0 10px 30px rgba(2,28,47,.08);
  --gap: 16px;
  --radius: 16px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Department app navbar ---------- */
.phxxs-topnav{
  position: relative;
  z-index: 20;
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 2px 7px rgba(2,28,47,.18);
}
.phxxs-topnav__inner{
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.phxxs-topnav__brand{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.phxxs-topnav__brand:hover{ color: #fff; }
.phxxs-topnav__home{
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.28);
}
.phxxs-topnav__home svg{
  display: block;
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
}
.phxxs-topnav__divider{ color: rgba(255,255,255,.62); }
.phxxs-topnav .header-version-badge{ margin: 0; }
.phxxs-topnav__toggle{
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: auto;
  padding: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(255,255,255,.22);
}
.phxxs-topnav__toggle:hover,
.phxxs-topnav__toggle:focus-visible{ background: rgba(0,0,0,.16); }
.phxxs-topnav__toggle svg{
  display: block;
  width: 27px !important;
  height: 27px !important;
  max-width: 27px;
  max-height: 27px;
}
.phxxs-topnav__menu{
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  display: none;
  min-width: 190px;
  padding: 7px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(2,28,47,.2);
}
.phxxs-topnav__menu.is-open{ display: grid; }
.phxxs-topnav__menu a{
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-weight: 700;
}
.phxxs-topnav__menu a:hover,
.phxxs-topnav__menu a:focus-visible{ background: #eaf7fd; color: #0369a1; }
.phxxs-dept-heading{
  padding: 24px 16px 8px;
}
.phxxs-dept-heading h1{
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}
@media (max-width: 520px){
  .phxxs-topnav__inner{ min-height: 72px; }
  .phxxs-topnav__brand{ font-size: 1.12rem; }
  .phxxs-topnav__home{ width: 38px; height: 38px; flex-basis: 38px; }
  .phxxs-topnav .header-version-badge{ padding: .34rem .55rem; }
  .phxxs-topnav .header-version-badge__value{ font-size: .64rem; }
  .phxxs-dept-heading{ padding-top: 20px; }
  .phxxs-dept-heading h1{ font-size: 1.35rem; }
}

/* ---------- Containers ---------- */
.container{
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
}
.page{
  padding: 18px 16px 24px;
}

/* =========================================================
   BLUE HERO HEADER (Reference: original Bootstrap page)
   - Single source of truth for spacing & behavior
   ========================================================= */
.phxxs-hero{
  background: var(--accent);
  color: #fff;
  padding: 14px 0 18px;           /* top | sides | bottom */
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  position: relative;
  margin-bottom: 32px;            /* consistent gap above tiles */
  overflow: hidden;                /* prevents margin-collapse quirks */
}
.phxxs-hero .container{
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
  justify-content: center;

  /* Space for the back circle + breathing room under it */
  min-height: 100px;
  padding: 0 16px 26px 56px;      /* L=56 keeps title clear of circle */
}

/* Desktop alignment */
@media (min-width: 768px){
  .phxxs-hero .container{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
  }
}

/* Titles */
.hero-titles h1{
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
}
.hero-titles .subtitle{
  margin-top: .2rem;
  font-size: .9rem;
  opacity: .95;
}
.hero-titles{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Actions area (e.g., Contact / Templates) */
.phxxs-hero .actions{ display: flex; gap: .5rem; }
.phxxs-hero .btn{
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: .6rem;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.phxxs-hero .btn:hover{ background: rgba(255,255,255,.28); }

/* Build / version badge */
.header-version-badge{
  display: inline-flex;
  align-items: center;
  padding: .38rem .72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  color: rgba(255,255,255,.96);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
.header-version-badge__value{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: none;
}
.phxxs-hero .header-version-badge,
.phxxs-hero--grid .header-version-badge{
  position: static;
  margin-top: .55rem;
  width: fit-content;
}
.phxxs-hero .header-version-badge:empty,
.phxxs-hero--grid .header-version-badge:empty{
  display: none;
}

/* Circular back button */
.phxxs-back{
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  transition: background .2s, transform .2s;
}
.phxxs-back:hover{
  background: rgba(255,255,255,.28);
  transform: translateY(-50%) scale(1.04);
}



/* =========================================================
   HERO HEADER VARIANT — GRID-ALIGNED (Static landing pages)
   - Back button and header text align with the same left edge as tiles
   - Works in both full-screen and constrained viewports
   ========================================================= */
/* Constrain hero splash width to match tile container on wide screens */
.phxxs-hero.phxxs-hero--grid{
  max-width: none;
  margin: 0 0 32px;
  border-radius: 0;
}

.phxxs-hero--grid .container{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;

  /* Match normal container padding used by tiles */
  padding: 0 16px 18px 16px;
  min-height: 88px;
}
.phxxs-hero--grid .phxxs-back{
  position: static;
  left: auto;
  top: auto;
  transform: none;
  margin: 0;
  flex: 0 0 auto;
}
.phxxs-hero--grid .phxxs-back:hover{
  transform: scale(1.04);
}
.phxxs-hero--grid .hero-titles{
  text-align: left;
  min-width: 0;
}
.phxxs-hero--grid .actions{
  margin-left: auto;
  display: flex;
  gap: .5rem;
}

.phxxs-action-pending{
  opacity: .7;
  cursor: wait;
}
.phxxs-action-modal{
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: 1.25rem;
}
.phxxs-action-modal.is-visible{
  display: grid;
}
.phxxs-action-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(8, 25, 42, .42);
  backdrop-filter: blur(2px);
}
.phxxs-action-modal__panel{
  position: relative;
  width: min(100%, 320px);
  padding: 1.65rem 1.35rem 1.55rem;
  border-radius: 1.15rem;
  background: #fff;
  color: #102b3d;
  text-align: center;
  box-shadow: 0 24px 60px rgba(7, 31, 51, .28);
}
.phxxs-action-modal__hourglass{
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto .85rem;
  border: 3px solid #0b9fd1;
  border-top-color: transparent;
  border-radius: 50%;
  color: #0b9fd1;
  font-size: 1.55rem;
  animation: phxxs-action-modal-spin .9s linear infinite;
}
.phxxs-action-modal__title{
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}
.phxxs-action-modal__body{
  margin-top: .45rem;
  color: #587080;
  font-size: .92rem;
  line-height: 1.45;
}
.phxxs-action-modal-open{
  overflow: hidden;
}
@keyframes phxxs-action-modal-spin{
  to{ transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce){
  .phxxs-action-modal__hourglass{ animation: none; }
}

/* Root pages: keep the circle (visual consistency), hide the arrow, preserve spacing */
.no-back-icon .phxxs-back svg{ display: none; }
.no-back-icon .phxxs-back{ pointer-events: none; cursor: default; }

/* =========================================================
   TILES GRID
   ========================================================= */
.tiles{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 900px){
  .tiles{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Backwards-compatible alias: some older pages used 'grid' instead of 'tiles'. */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 900px){
  .grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tile */
.tile{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  border: 1px solid var(--line);
  color: inherit;

  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover{
  transform: translateY(-1px);
}

/* Tile icon & title */
.tile .icon{
  width: 56px; height: 56px;
  display: grid; place-items: center;
  color: #0694d1;
}
.tile .icon svg{ width: 40px; height: 40px; }
.tile .title{
  margin-top: 6px;
  font-weight: 800;
  font-size: 1.05rem;
}

/* Left-aligned title variant (for full-width tiles) */
.title-left{ width: 100%; text-align: left; }

/* Optional subtitle (smaller, not bold) */
.subtitle-sm{
  margin-top: .35rem;
  color: var(--muted);
  font-size: .88rem;
}
.subtitle-sm.left{ text-align: left; }

/* Make a tile span the full grid width (desktop) */
.tile--spanAll{ grid-column: 1 / -1; }

/* =========================================================
   OPERATIONS LOG (chips + latest lists)
   ========================================================= */

/* Chips row (New/Active/Complete) */
.ops-summary{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: .25rem;
  margin-bottom: 6px;
}
.ops-chip{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.ops-chip .dot{ width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-new    { background: #ef4444; } /* red */
.dot-active { background: #f59e0b; } /* amber */
.dot-done   { background: #22c55e; } /* green */
.ops-chip .label{ font-weight: 700; }
.ops-chip .count{ margin-left: auto; font-weight: 800; }

/* Status pills for inline lists (if needed) */
.status-pill{
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .55rem; border-radius: 999px;
  font-weight: 800; font-size: .8rem;
  background: #eef6ff; color: #0b3a53;
}
.status-dot{ width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
.status-new    { background: #ffe8e8; color: #7a0f0f; }
.status-active { background: #fff2da; color: #7a520f; }
.status-done   { background: #e6ffef; color: #0b5b2d; }
.status-new .status-dot    { background: #ef4444; }
.status-active .status-dot { background: #f59e0b; }
.status-done .status-dot   { background: #22c55e; }

/* Latest-by-department lists (General → House Keeping → Engineering) */
.ops-latest{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}
@media (min-width: 900px){
  .ops-latest{ grid-template-columns: repeat(3, 1fr); }
}
.ops-col-title{
  margin: 0 0 6px;
  text-align: left;
  font-weight: 800;
  color: var(--ink-2);
}
.ops-mini{
  list-style: none;
  margin: 0; padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ops-mini li{
  display: grid;
  grid-template-columns: 110px 1fr auto; /* room | issue | status */
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.ops-mini li:last-child{ border-bottom: 0; }
.ops-mini .room{
  font-weight: 700;
  color: var(--ink);
}
.ops-mini .issue{
  color: #0e1720;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ops-mini .right{ white-space: nowrap; }
.ops-mini .empty{ color: #9aaabc; text-align: center; padding: 10px; }

/* =========================================================
   PLACEHOLDER / UNDER-DEVELOPMENT PAGES
   ========================================================= */
.phxxs-placeholder{
  max-width: 800px;
  margin: 40px auto;
  text-align: center;
}
.phxxs-placeholder .box{
  padding: 40px 20px;
}
.phxxs-placeholder h2{
  margin-top: 20px;
  font-weight: 700;
}
.phxxs-placeholder p{
  color: var(--muted);
  max-width: 520px;
  margin: 10px auto 0;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  text-align: center;
  padding: 20px;
  color: #9aaabc;
  font-size: 12px;
}

/* =========================================================
   UTILITIES & MISC
   ========================================================= */

/* Small circular logo images (if/when used in tiles/lists) */
.logo-img{
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff;
  padding: 4px;
}
.logo-fallback{
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff; font-weight: 600;
}

/* Visually hide element but keep layout (for conditional icons) */
.hidden { visibility: hidden; }

/* Keep tiles nicely spaced on very large screens if needed */
@media (min-width: 1200px){
  .container{ max-width: 1600px; }
}
