/* ============================================================
   PLH Dashboard — Main Stylesheet
============================================================ */

/* ── TOKENS ── */
:root {
  --navy:   #1B3A5C;
  --navy-s: #254E7A;
  --gold:   #E8A020;
  --gold-h: #fdb830;
  --gold-l: #FEF3DC;
  --sky:    #4BAAC8;
  --sky-l:  #D6EEF6;
  --red:    #C0392B;
  --olive:  #917B20;
  --bg:     #F4F6F9;
  --border: #DDE4ED;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif; background: var(--bg); color: var(--navy);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}
h1,h2,h3 { font-family: 'Montserrat', sans-serif; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
  background: #fff; border-bottom: 3px solid var(--gold);
  height: 64px; display: flex; align-items: center; padding: 0 40px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-pipe { width: 1px; height: 22px; background: var(--border); }
.brand-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  color: var(--navy-s); text-transform: uppercase; letter-spacing: .09em;
}
.nav-spacer { flex: 1; }
.nav-link {
  font-family: 'Montserrat', sans-serif; font-size: 0.76rem; font-weight: 600;
  color: var(--navy-s); text-decoration: none; padding: 6px 14px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--sky-l); color: var(--sky); }
.nav-cta {
  font-family: 'Montserrat', sans-serif; font-size: 0.76rem; font-weight: 700;
  background: var(--gold); color: var(--navy);
  padding: 8px 20px; border-radius: 6px; text-decoration: none;
  transition: background .15s;
}
.nav-cta:hover { background: var(--gold-h); }

/* ── HERO ── */
.hero {
  background: var(--navy); position: relative; overflow: hidden;
  padding: 28px 40px 32px; flex-shrink: 0;
}
.g-gold-bar {
  position: absolute; top: -50px; right: 28%; width: 64px; height: 320px;
  background: var(--gold); transform: rotate(-28deg); border-radius: 32px; opacity: .88;
}
.g-sky-bar {
  position: absolute; top: -60px; right: 23%; width: 36px; height: 300px;
  background: var(--sky); transform: rotate(-28deg); border-radius: 18px; opacity: .6;
}
.g-sky-patch {
  position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 320px solid var(--sky); border-left: 220px solid transparent; opacity: .18;
}
.g-tri-r {
  position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 140px solid var(--red); border-left: 140px solid transparent; opacity: .9;
}
.g-circle-lg {
  position: absolute; bottom: -32px; right: 38%; width: 88px; height: 88px;
  border-radius: 50%; background: var(--red); opacity: .75;
}
.g-circle-sm {
  position: absolute; bottom: 12px; right: 44%; width: 44px; height: 44px;
  border-radius: 50%; background: var(--olive); opacity: .8;
}
.g-stripes {
  position: absolute; bottom: 0; right: 8%; width: 100px; height: 70px;
  background: repeating-linear-gradient(45deg, var(--gold) 0, var(--gold) 4px, transparent 4px, transparent 13px);
  opacity: .45;
}
.hero-inner { position: relative; z-index: 2; max-width: 700px; }
.hero h1 {
  font-size: 1.5rem; font-weight: 900; color: #fff;
  line-height: 1.1; letter-spacing: -.02em; text-transform: uppercase;
}
.hero h1 em { font-style: normal; color: var(--gold); }

/* ── TOOLBAR ── */
.toolbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 56px;
}
.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 7px 14px;
  transition: border-color .15s;
}
.tb-search:focus-within { border-color: var(--sky); }
.tb-search svg { color: #bbb; width: 15px; height: 15px; flex-shrink: 0; }
.tb-search input {
  border: none; outline: none; background: transparent;
  font-family: 'Inter', sans-serif; font-size: 0.825rem; color: var(--navy); width: 100%;
}
.tb-search input::placeholder { color: #bbb; }
.tb-filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tb-filters-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; margin: 0 2px; }
.tb-tab {
  font-family: 'Montserrat', sans-serif; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 12px; border-radius: 4px; cursor: pointer; border: none;
  background: var(--border); color: var(--navy-s);
  transition: background .13s, color .13s;
}
.tb-tab:hover { background: var(--navy); color: #fff; }
.tb-tab.active { background: var(--gold); color: var(--navy); }
.tb-filters-apps .tb-tab { background: var(--sky-l); color: var(--sky); }
.tb-filters-apps .tb-tab:hover { background: var(--sky); color: #fff; }
.tb-filters-apps .tb-tab.active { background: var(--sky); color: #fff; }

/* ── VIEW TOGGLE ── */
.view-toggle { display: flex; gap: 3px; }
.view-btn {
  width: 34px; height: 34px; border-radius: 6px; border: 1.5px solid var(--border);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .13s, border-color .13s, color .13s;
  color: #bbb;
}
.view-btn svg { width: 15px; height: 15px; }
.view-btn:hover { background: var(--bg); border-color: var(--navy-s); color: var(--navy-s); }
.view-btn.active { background: var(--navy); border-color: var(--navy); color: var(--gold); }

/* ── EMBED SECTION ── */
.embed-section { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.embed-inner { max-width: 1200px; margin: 0 auto; padding: 28px 40px; }
.embed-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.embed-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem; font-weight: 900;
  color: var(--navy); text-transform: uppercase; letter-spacing: -.01em;
}
.embed-heading-bar { width: 40px; height: 4px; background: var(--sky); border-radius: 2px; margin-top: 6px; }
.embed-open-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--sky); text-decoration: none;
  padding: 7px 16px; border-radius: 5px;
  border: 1.5px solid rgba(75,170,200,.3);
  transition: background .14s, border-color .14s;
}
.embed-open-link svg { width: 13px; height: 13px; }
.embed-open-link:hover { background: var(--sky-l); border-color: var(--sky); }
.embed-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #bbb; font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  pointer-events: none; background: #fff;
}
.embed-loading svg { width: 32px; height: 32px; color: var(--border); }
.embed-col-stat {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(27,58,92,.08);
}
.stat-card-label { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.stat-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--navy-s);
}
.embed-frame-square { height: 130px; position: relative; }
.embed-frame-square iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.embed-frame-square iframe.loaded + .embed-loading { display: none; }

/* ════════════════════════════════════════
   VIEW 2: COMPACT TILES
════════════════════════════════════════ */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; padding: 16px;
}
.compact-tile {
  background: #fff; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: var(--navy);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative; overflow: hidden;
}
.compact-tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.ct-gold::before { background: var(--gold); }
.ct-sky::before  { background: var(--sky);  }
.ct-red::before  { background: var(--red);  }
.compact-tile:hover { box-shadow: 0 6px 24px rgba(27,58,92,.12); transform: translateY(-2px); }
.ct-gold:hover { border-color: var(--gold); }
.ct-sky:hover  { border-color: var(--sky);  }
.ct-red:hover  { border-color: var(--red);  }
.ct-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ct-icon svg { width: 18px; height: 18px; }
.bg-gold { background: rgba(232,160,32,.12); } .bg-gold svg { color: var(--gold); }
.bg-sky  { background: rgba(75,170,200,.12); } .bg-sky  svg { color: var(--sky);  }
.bg-red  { background: rgba(192,57,43,.12);  } .bg-red  svg { color: var(--red);  }
.ct-tag {
  font-family: 'Montserrat', sans-serif; font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: #bbb;
}
.ct-name {
  font-family: 'Montserrat', sans-serif; font-size: 0.82rem; font-weight: 800;
  text-transform: uppercase; line-height: 1.25; flex: 1;
}
.ct-open {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Montserrat', sans-serif; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding-top: 8px; border-top: 1px solid var(--border);
  color: #bbb; transition: color .12s;
}
.ct-open svg { width: 12px; height: 12px; }
.compact-tile:hover .ct-open { color: var(--gold); }
.ct-sky:hover  .ct-open { color: var(--sky); }
.ct-red:hover  .ct-open { color: var(--red); }

/* ════════════════════════════════════════
   VIEW 3: GROUPED BY CATEGORY
════════════════════════════════════════ */
.group-section { margin-bottom: 24px; }
.group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.group-icon {
  width: 26px; height: 26px; border-radius: 6px; background: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.group-icon svg { color: var(--gold); width: 13px; height: 13px; }
.group-title {
  flex: 1;
  font-family: 'Montserrat', sans-serif; font-size: 0.65rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .1em; color: var(--navy);
}
.group-count {
  font-family: 'Montserrat', sans-serif; font-size: 0.6rem; font-weight: 700;
  background: var(--border); color: var(--navy-s);
  padding: 1px 8px; border-radius: 999px;
}
.group-line { flex: 1; height: 1px; background: var(--border); }
.group-items { display: block; }
.group-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--navy);
  transition: background .12s;
}
.group-item:hover { background: var(--gold-l); }
.gi-icon {
  width: 32px; height: 32px; border-radius: 7px; background: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gi-icon svg { width: 14px; height: 14px; }
.icon-gold svg { color: var(--gold); }
.icon-sky  svg { color: var(--sky);  }
.icon-red  svg { color: #FF8070;    }
.gi-body { flex: 1; min-width: 0; }
.gi-name {
  font-family: 'Montserrat', sans-serif; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gi-desc { font-size: 0.6rem; color: #bbb; font-family: 'Montserrat', sans-serif; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.gi-arrow { color: #ccc; flex-shrink: 0; transition: color .12s, transform .12s; }
.gi-arrow svg { width: 14px; height: 14px; }
.group-item:hover .gi-arrow { color: var(--gold); transform: translateX(3px); }

/* ── EMPTY STATE ── */
.empty-state { padding: 24px; text-align: center; color: #aaa; font-size: 0.82rem; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.fu { animation: fadeUp .4s ease both; }
.d0{animation-delay:.00s} .d1{animation-delay:.04s} .d2{animation-delay:.08s}
.d3{animation-delay:.12s} .d4{animation-delay:.16s} .d5{animation-delay:.20s}
.d6{animation-delay:.24s} .d7{animation-delay:.28s} .d8{animation-delay:.32s}
.d9{animation-delay:.36s} .d10{animation-delay:.40s} .d11{animation-delay:.44s}
.d12{animation-delay:.48s} .d13{animation-delay:.52s}

/* ════════════════════════════════════════
   SPLIT PANEL LAYOUT
════════════════════════════════════════ */
.split-layout {
  display: grid; grid-template-columns: 1fr 2fr;
  flex: 1; min-height: 0; overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff; overflow: hidden;
}
.sidebar-heading {
  padding: 16px 16px 12px;
  flex-shrink: 0;
}
.sidebar-toolbar {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; background: #fff;
}
.sidebar-toolbar .tb-search { width: auto; }
.sidebar-toolbar-row {
  display: flex; align-items: center; gap: 6px;
}
.sidebar-toolbar-row .tb-filters { flex: 1; min-width: 0; }
.sidebar-view-toggle { display: flex; gap: 2px; flex-shrink: 0; }
.sidebar-view-toggle .view-btn {
  width: 28px; height: 28px; border-radius: 5px; border-width: 1px;
}
.sidebar-view-toggle .view-btn svg { width: 13px; height: 13px; }
.sidebar-list { flex: 1; overflow-y: auto; }
.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-track { background: transparent; }
.sidebar-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-list .compact-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 10px; gap: 8px;
}
.sidebar-list .compact-tile { padding: 12px 8px; }
.sidebar-list .group-section { margin-bottom: 0; }
.sidebar-count {
  padding: 8px 16px; font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem; font-weight: 700; color: #bbb;
  text-transform: uppercase; letter-spacing: .05em;
  border-top: 1px solid var(--border); flex-shrink: 0; background: #fff;
}
.sidebar-count span { color: var(--navy); }

/* ── GLOBAL REACH PANEL ── */
.reach-panel {
  display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden;
}
.reach-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 18px 28px 14px; background: #fff;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.reach-content {
  flex: 1; display: flex; flex-direction: column;
  gap: 16px; padding: 20px 28px; min-height: 0; overflow: hidden;
}
.reach-stat { flex-shrink: 0; }
.reach-map { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.embed-frame-fill {
  flex: 1; position: relative; min-height: 0;
  border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 24px rgba(27,58,92,.08);
  background: var(--bg);
}
.embed-frame-fill iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.embed-frame-fill iframe.loaded + .embed-loading { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .nav { padding: 0 16px; flex-shrink: 0; }
  .hero { padding: 20px 16px 24px; }
  .split-layout { grid-template-columns: 1fr; flex: none; height: auto; }
  .reach-panel { order: -1; height: 70vh; }
  .sidebar { height: 55vh; }
  .reach-content { overflow-y: auto; }
  .reach-map { min-height: 300px; }
}
