/* ── Zylo AI Receptionist — portal theme ─────────────────────────────────────
   Matched to zyloai.com.au: #050505 ground, emerald #00bb7f signal, rose
   #ff2357 alerts, Playfair Display headlines, Inter body, JetBrains Mono data.
──────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #050505;
  --bg-raise: #0c0c0f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.66);
  --ink-3: rgba(255, 255, 255, 0.42);
  --em: #00bb7f;
  --em-bright: #34d399;
  --em-dim: rgba(0, 187, 127, 0.14);
  --em-line: rgba(0, 187, 127, 0.35);
  --rose: #ff2357;
  --rose-dim: rgba(255, 35, 87, 0.12);
  --blue: #60a5fa;          /* categorical series 2 (OpenAI) */
  --gray-series: #a1a1aa;   /* categorical series 3 (telco/base) */
  --amber: #fbbf24;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 14px;
  --r-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* atmosphere: emerald aurora + faint engineering grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(0, 187, 127, 0.13), transparent 62%),
    radial-gradient(700px 420px at -8% 12%, rgba(0, 187, 127, 0.05), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

::selection { background: rgba(0, 187, 127, 0.35); }

a { color: var(--em-bright); text-decoration: none; }

/* ── shell ── */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.side {
  width: 232px;
  flex-shrink: 0;
  border-right: 1px solid var(--line-soft);
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(10px);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { margin-bottom: 26px; padding: 0 8px; }
.brand .word {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand .word em { color: var(--em-bright); font-style: italic; }
.brand .sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 3px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.on { background: var(--em-dim); color: var(--em-bright); }
.nav a .ico { width: 17px; height: 17px; opacity: 0.9; flex-shrink: 0; }

.side .foot {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 0 8px;
  line-height: 1.8;
}
.side .foot .dot-live { color: var(--em-bright); }

.main { flex: 1; padding: 34px 40px 64px; max-width: 1240px; }

/* ── typography ── */
.page-head { margin-bottom: 26px; animation: rise 0.5s ease both; }
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--em);
  margin-bottom: 6px;
}
h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
h1 em { color: var(--em-bright); font-style: italic; }
.lede { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }

h2.section {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin: 34px 0 14px;
}
h2.section small {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 10px;
}

/* ── cards & grids ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}
.card.pad-lg { padding: 24px 26px; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: 1fr; } .grid.c2 { grid-template-columns: 1fr; } }

/* KPI stat tiles */
.kpi { position: relative; overflow: hidden; }
.kpi .label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.kpi .num {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi .num .unit { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.kpi .delta { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.kpi .delta.up { color: var(--em-bright); }
.kpi::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--em), transparent 70%);
  opacity: 0.6;
}

/* status pills / dots */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.up { background: var(--em-bright); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.dot.down { background: var(--rose); box-shadow: 0 0 8px rgba(255, 35, 87, 0.7); }
.dot.degraded, .dot.offline { background: var(--amber); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  color: var(--ink-2);
}
.pill.ok { border-color: var(--em-line); color: var(--em-bright); background: var(--em-dim); }
.pill.bad { border-color: rgba(255, 35, 87, 0.4); color: var(--rose); background: var(--rose-dim); }
.pill.warn { border-color: rgba(251, 191, 36, 0.4); color: var(--amber); background: rgba(251, 191, 36, 0.08); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid var(--em-line);
  background: linear-gradient(180deg, rgba(0, 187, 127, 0.22), rgba(0, 187, 127, 0.1));
  color: var(--em-bright);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { box-shadow: 0 0 22px rgba(0, 187, 127, 0.25); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); box-shadow: none; border-color: var(--ink-3); }
.btn.danger { border-color: rgba(255, 35, 87, 0.45); background: var(--rose-dim); color: var(--rose); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

/* inputs */
input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; resize: vertical; }
input[type="password"] { font-family: var(--mono); letter-spacing: 0.08em; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--em-line);
  box-shadow: 0 0 0 3px rgba(0, 187, 127, 0.12);
}
label.fld {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 14px 0 6px;
}

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-align: left;
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
table.data td:first-child { color: var(--ink); }
table.data tr:hover td { background: var(--surface); }
.mono { font-family: var(--mono); font-size: 12px; }
.num-cell { font-variant-numeric: tabular-nums; text-align: right; }

/* service health card */
.svc { display: flex; gap: 12px; align-items: flex-start; animation: rise 0.5s ease both; }
.svc .dot { margin-top: 6px; }
.svc .name { font-weight: 600; font-size: 14px; }
.svc .tech { font-family: var(--mono); font-size: 10.5px; color: var(--em); letter-spacing: 0.06em; }
.svc .role { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.svc .lat { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* chat console */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 380px; max-height: 520px; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; animation: rise 0.25s ease both; }
.msg.assistant { background: var(--surface-2); border: 1px solid var(--line-soft); border-top-left-radius: 4px; align-self: flex-start; }
.msg.caller { background: var(--em-dim); border: 1px solid var(--em-line); border-top-right-radius: 4px; align-self: flex-end; }
.msg .who { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 3px; }

.tool-line {
  display: flex; gap: 9px; align-items: baseline;
  font-family: var(--mono); font-size: 11.5px;
  padding: 7px 0; border-bottom: 1px dashed var(--line-soft);
}
.tool-line .t-name { color: var(--em-bright); }
.tool-line .t-detail { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-line .t-ms { margin-left: auto; color: var(--ink-3); flex-shrink: 0; }
.tool-line.rejected .t-name, .tool-line.error .t-name { color: var(--rose); }

/* diagrams */
.diagram-wrap { overflow-x: auto; }
.diagram-wrap svg { display: block; min-width: 860px; width: 100%; height: auto; }
.d-box { fill: rgba(255, 255, 255, 0.035); stroke: rgba(255, 255, 255, 0.14); rx: 10; }
.d-box.em { fill: rgba(0, 187, 127, 0.09); stroke: rgba(0, 187, 127, 0.5); }
.d-box.data { fill: rgba(96, 165, 250, 0.07); stroke: rgba(96, 165, 250, 0.4); }
.d-label { font-family: var(--sans); font-size: 12.5px; font-weight: 600; fill: #fff; }
.d-sub { font-family: var(--mono); font-size: 9px; fill: rgba(255, 255, 255, 0.45); letter-spacing: 0.06em; }
.d-edge { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.4; fill: none; }
.d-edge.em { stroke: rgba(0, 187, 127, 0.65); }
.d-flow { fill: var(--em-bright); }
.d-note { font-family: var(--mono); font-size: 9.5px; fill: rgba(255, 255, 255, 0.4); }

/* chart */
.chart-tip {
  position: fixed;
  pointer-events: none;
  background: #101014;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--ink-2);
  z-index: 50;
  display: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.chart-tip b { color: var(--ink); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 2px 2px; }
.legend .key { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend .swatch { width: 11px; height: 11px; border-radius: 3.5px; }

/* misc */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.tag { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--ink-3); letter-spacing: 0.06em; }
.tag.em { color: var(--em-bright); border-color: var(--em-line); }
.tag.rose { color: var(--rose); border-color: rgba(255, 35, 87, 0.4); }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.locked { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }

.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); right: 24px; z-index: 60;
  background: #101014; border: 1px solid var(--em-line);
  color: var(--ink); border-radius: 12px; padding: 13px 18px; font-size: 13.5px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: rise 0.3s ease both;
}
.toast.err { border-color: rgba(255, 35, 87, 0.5); }
/* phones: pin toasts to the TOP — Safari's bottom toolbar covers bottom-fixed elements */
@media (max-width: 900px) {
  .toast { top: 14px; bottom: auto; left: 14px; right: 14px; text-align: center; }
}
.form-msg { margin-top: 12px; font-size: 13.5px; min-height: 20px; }
.form-msg.ok { color: var(--em-bright); }
.form-msg.bad { color: var(--rose); }

/* ── customer portal shell ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 980px; margin: 0 auto; padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topbar .word { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.topbar .word em { color: var(--em-bright); font-style: italic; }
.topbar .biz { font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.13em; margin-top: 2px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  padding: 8px 13px; border-radius: 10px; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: var(--surface); color: var(--ink); }
.topnav a.on { background: var(--em-dim); color: var(--em-bright); }
.topnav a.out { color: var(--ink-3); }
.cust-main { max-width: 980px; margin: 0 auto; padding: 34px 22px 70px; position: relative; z-index: 1; }

/* ── opening-hours editor ── */
.hours-grid { display: flex; flex-direction: column; gap: 7px; }
.hours-row { display: flex; align-items: center; gap: 12px; }
.hours-row .hd { font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-2); width: 86px; flex-shrink: 0; }
.hours-row .hopen { display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); width: 64px; flex-shrink: 0; }
.hours-row input[type="time"] { width: 108px; padding: 7px 9px; font-family: var(--mono); font-size: 12.5px; }
.hours-row input[type="time"]:disabled { opacity: 0.3; }
.hours-row input[type="checkbox"] { accent-color: var(--em); width: 15px; height: 15px; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.stagger > * { animation: rise 0.5s ease both; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.24s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.36s; }
.stagger > *:nth-child(8) { animation-delay: 0.42s; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { margin: 0 16px 0 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side .foot { display: none; }
  .main { padding: 22px 18px 48px; }
}
