/* Zero3 Communications — Brand CSS v1.6 */
/* Wallboard-matched theme: brand gradient bg, yellow accents, white panels */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;900&display=swap');

:root {
  /* Zero3 Brand */
  --z3-blue:       #007DAA;
  --z3-navy:       #19134D;
  --z3-yellow:     #FFED00;
  --z3-yellow-dk:  #D4C400;

  /* Page background -- brand gradient */
  --bg-start:      #005a7a;
  --bg-end:        #19134D;

  /* Surfaces -- white/translucent panels over gradient */
  --surface:       rgba(255,255,255,0.12);
  --surface-solid: rgba(255,255,255,0.18);
  --surface-hover: rgba(255,255,255,0.20);
  --border:        rgba(255,255,255,0.18);
  --border-bright: rgba(255,255,255,0.30);

  /* Text */
  --fg:            #ffffff;
  --fg-dim:        rgba(255,255,255,0.80);
  --header:        #ffffff;

  /* Status */
  --green:  #4ade80;
  --red:    #f87171;
  --amber:  #fbbf24;
  --blue:   #60a5fa;
  --purple: #c084fc;

  /* Primary = Yellow */
  --primary:      var(--z3-yellow);
  --primary-text: #19134D;

  /* Table */
  --table-bg:   rgba(255,255,255,0.10);
  --thead-bg:   rgba(255,255,255,0.15);
  --row-alt:    rgba(255,255,255,0.04);
  --row-hover:  rgba(255,255,255,0.10);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
  color: var(--fg);
  margin: 0;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Typography ── */
h1 { font-size: 22px; font-weight: 700; color: var(--header); margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 700; margin: 20px 0 10px;
     color: #fff; border-left: 3px solid var(--z3-yellow); padding-left: 10px; }

/* ── Header bar ── */
.header-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid rgba(255,255,255,0.2); padding-bottom: 10px;
  margin-bottom: 22px; flex-wrap: wrap; gap: 10px;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.z3-logo { height: 36px; }
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.nav-links a { color: var(--z3-yellow); text-decoration: none; font-size: 13px;
               font-weight: 600; opacity: 0.9; }
.nav-links a:hover { opacity: 1; text-decoration: underline; }

#clock { font-size: 20px; font-family: monospace; color: var(--z3-yellow); font-weight: 700; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; background: var(--table-bg);
        border: 1px solid var(--border); margin-bottom: 20px;
        backdrop-filter: blur(4px); }
th { background: var(--thead-bg); padding: 9px 11px; text-align: left;
     font-size: 11px; font-weight: 700; text-transform: uppercase;
     letter-spacing: 0.06em; color: rgba(255,255,255,0.8); }
td { padding: 8px 11px; border-bottom: 1px solid var(--border);
     font-size: 13px; vertical-align: middle; color: #fff; font-weight: 500; }
tr:nth-child(even) td { background: var(--row-alt); }
tr:hover td { background: var(--row-hover); }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--z3-yellow); }
th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 10px; }
th.sort-asc::after  { content: ' ↑'; opacity: 1; color: var(--z3-yellow); }
th.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--z3-yellow); }
.detail-table-wrap { overflow-x: auto; margin-bottom: 20px; }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
              gap: 10px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface-solid); border: 1px solid var(--border);
  padding: 14px 12px; text-align: center; position: relative; overflow: hidden;
  backdrop-filter: blur(8px);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--z3-yellow);
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--z3-yellow); letter-spacing: -0.02em; }
.stat-value.red    { color: var(--red); }
.stat-value.amber  { color: var(--amber); }
.stat-value.blue   { color: var(--blue); }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.85); margin-top: 3px;
              font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Tabs ── */
.section-tabs { display: flex; flex-wrap: wrap; border-bottom: 2px solid rgba(255,255,255,0.2);
                margin-bottom: 0; gap: 2px; }
.tab-btn {
  background: transparent; color: rgba(255,255,255,0.75); border: none;
  border-bottom: 2px solid transparent; padding: 8px 13px; font-size: 12px;
  cursor: pointer; font-family: 'Poppins', sans-serif; font-weight: 600;
  margin-bottom: -2px; transition: color 0.15s;
}
.tab-btn.active { color: var(--z3-yellow); border-bottom-color: var(--z3-yellow); }
.tab-btn:hover:not(.active) { color: var(--fg); }
.tab-panel { display: none; padding-top: 18px; }
.tab-panel.active { display: block; }

/* ── Period selector ── */
.period-selector { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.period-btn {
  background: var(--surface); color: rgba(255,255,255,0.85); border: 1px solid var(--border);
  padding: 5px 14px; font-size: 12px; cursor: pointer; text-decoration: none;
  font-family: 'Poppins', sans-serif; font-weight: 600; transition: all 0.15s;
}
.period-btn:hover { background: var(--surface-hover); color: var(--fg); }
.period-btn.active { background: var(--z3-yellow); color: var(--primary-text);
                     border-color: var(--z3-yellow); }

/* ── Status flags ── */
.flag-green { color: var(--green); }
.flag-red   { color: var(--red); font-weight: 600; }
.flag-amber { color: var(--amber); font-weight: 600; }

/* ── Chart wrap ── */
.chart-wrap { background: var(--surface); border: 1px solid var(--border);
              padding: 14px; margin-bottom: 18px; backdrop-filter: blur(4px); }
.chart-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
               letter-spacing: 0.07em; color: rgba(255,255,255,0.85); margin-bottom: 10px; }

/* ── Form elements ── */
input[type="text"], input[type="password"], input[type="number"],
input[type="search"], textarea, select {
  background: rgba(255,255,255,0.15); color: var(--fg);
  border: 1px solid var(--border); padding: 8px 12px; font-size: 13px;
  font-family: 'Poppins', sans-serif; outline: none;
}
input::placeholder { color: rgba(255,255,255,0.4); }
input:focus, select:focus, textarea:focus {
  border-color: var(--z3-yellow); box-shadow: 0 0 0 2px rgba(255,237,0,0.15);
  background: rgba(255,255,255,0.20);
}
select option { background: var(--z3-navy); color: #fff; }

/* ── Buttons ── */
.btn { padding: 8px 18px; font-size: 13px; font-family: 'Poppins', sans-serif;
       cursor: pointer; border: none; font-weight: 700; transition: opacity 0.15s; }
.btn-primary   { background: var(--z3-yellow); color: var(--primary-text); }
.btn-primary:hover { opacity: 0.88; }
.btn-danger    { background: rgba(248,113,113,0.2); color: var(--red);
                 border: 1px solid rgba(248,113,113,0.4); }
.btn-danger:hover { background: rgba(248,113,113,0.35); }
.btn-secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-warning   { background: rgba(251,191,36,0.2); color: var(--amber);
                 border: 1px solid rgba(251,191,36,0.4); }
.btn-warning:hover { background: rgba(251,191,36,0.35); }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--z3-yellow);
  color: var(--primary-text); padding: 10px 20px; font-size: 13px; font-weight: 700;
  z-index: 999; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
#toast.show { opacity: 1; }

/* ── Heatmap ── */
.heatmap-grid { display: grid; grid-template-columns: 36px repeat(24,1fr); gap: 2px; align-items: center; }
.heatmap-hour-label { font-size: 9px; text-align: center; opacity: 0.5; }
.heatmap-bar-wrap { position: relative; height: 55px; display: flex; flex-direction: column; justify-content: flex-end; }
.heatmap-bar { width: 100%; background: var(--z3-yellow); opacity: 0.7; min-height: 2px; }
.heatmap-bar:hover { opacity: 1; }
.heatmap-bar-wrap:hover .heatmap-tooltip { display: block; }
.heatmap-tooltip { display: none; position: absolute; bottom: 60px; left: 50%;
                   transform: translateX(-50%); background: var(--z3-navy); color: #fff;
                   font-size: 11px; padding: 4px 8px; white-space: nowrap; z-index: 10;
                   border: 1px solid var(--border); }
.heatmap-count { font-size: 9px; text-align: center; margin-top: 2px; opacity: 0.5; }

/* ── Misc ── */
.no-data-msg { padding: 40px; text-align: center; opacity: 0.55; font-size: 18px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
                 letter-spacing: 0.08em; color: rgba(255,255,255,0.85); margin: 18px 0 8px; }
.bar-inline { display: inline-block; height: 8px; background: var(--z3-yellow);
              opacity: 0.65; vertical-align: middle; margin-left: 6px; min-width: 2px; }
.toggle-container { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-dim); }
code { background: rgba(0,0,0,0.3); padding: 1px 5px; font-family: monospace; font-size: 12px; }

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
