@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:#0e1116;
  --card:rgba(255,255,255,0.035);
  --card-hover:rgba(255,255,255,0.06);
  --border:rgba(255,255,255,0.08);
  --text:#e5e7eb;
  --text-dim:#9ca3af;
  --text-faint:#6b7280;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: 'tnum' on;
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(34,211,238,0.1), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(245,158,11,0.07), transparent 45%);
}

.label { font-size:0.62rem; letter-spacing:0.14em; text-transform:uppercase; color:var(--text-faint); font-weight:500; }
.num { font-variant-numeric: tabular-nums; font-weight:600; letter-spacing:-0.02em; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
a { color:#67e8f9; text-decoration:none; }
a:hover { color:#a5f3fc; }

.card { background: var(--card); border:1px solid var(--border); border-radius:1rem; backdrop-filter: blur(12px); }

.chip { display:inline-flex; align-items:center; gap:4px; border-radius:9999px; border:1px solid transparent; padding:0.2rem 0.55rem; font-size:0.7rem; white-space:nowrap; line-height:1.3; font-family:inherit; }
.chip-emerald { border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.1); color:#6ee7b7; }
.chip-amber { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.1); color:#fcd34d; }
.chip-rose { border-color: rgba(251,113,133,0.3); background: rgba(251,113,133,0.1); color:#fda4af; }
.chip-cyan { border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.1); color:#67e8f9; }
.chip-blue { border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.1); color:#93c5fd; }
.chip-violet { border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.1); color:#c4b5fd; }
.chip-neutral { color:var(--text-dim); border-color: var(--border); background: rgba(255,255,255,0.03); }

.pulse-dot { animation: pulseOpacity 2s ease-in-out infinite; display:inline-block; }
@keyframes pulseOpacity { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

select.partyselect {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,0.03) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 8px center;
  background-size: 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.25rem 22px 0.25rem 0.6rem;
  cursor: pointer;
}

button { font-family: inherit; }

/* App shell */
.app { flex:1; display:flex; min-height:0; position:relative; z-index:1; }
.content { flex:1; min-width:0; overflow-y:auto; padding:14px 16px 88px; }

header.topbar {
  display:flex; justify-content:space-between; align-items:flex-start;
  margin-bottom:16px; gap:8px; flex-wrap:wrap;
}
header.topbar .chips { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }

button.iconbtn {
  width:28px; height:28px; border-radius:0.5rem; border:1px solid var(--border);
  background: rgba(255,255,255,0.03); display:flex; align-items:center; justify-content:center;
  color: var(--text-dim); cursor:pointer;
}
button.iconbtn.detail-active {
  width:auto; padding:0.25rem 0.6rem; gap:4px;
  background: rgba(245,158,11,0.15); border-color: rgba(251,191,36,0.3); color:#fcd34d;
}

/* Nav */
nav.tabbar {
  position: fixed; left:0; right:0; bottom:0; height:72px;
  background: rgba(14,17,22,0.85); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display:flex; justify-content:space-around; align-items:center; padding-bottom:8px; z-index:3;
}
nav.tabbar button.navitem {
  background:none; border:none; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color:#6b7280; padding:2px 10px;
}
nav.tabbar button.navitem span.lbl { font-size:0.68rem; }
nav.tabbar button.navitem .pill { width:22px; height:3px; border-radius:2px; background:transparent; }
nav.tabbar button.navitem.active { color:#22D3EE; }
nav.tabbar button.navitem.active .pill { background:#22D3EE; box-shadow:0 0 8px #22D3EE; }

@media (min-width:900px) {
  nav.tabbar {
    left:0; top:0; bottom:0; right:auto; width:96px; height:auto;
    flex-direction:column; justify-content:flex-start; padding-top:26px; padding-bottom:0; gap:26px;
    border-top:none; border-right:1px solid var(--border);
  }
  nav.tabbar .brand { font-size:0.62rem; letter-spacing:0.16em; color:#6b7280; font-weight:700; margin-bottom:6px; }
  .content { padding:28px 32px 28px 128px; }
  header.topbar .num.clock { font-size:1.9rem; }
}

/* Grid */
.grid { display:grid; grid-template-columns: 1fr; gap:10px; }
@media (min-width:900px) {
  .grid { grid-template-columns: repeat(12, minmax(0,1fr)); }
  .s4 { grid-column: span 4; }
  .s6 { grid-column: span 6; }
  .s8 { grid-column: span 8; }
  .s12 { grid-column: span 12; }
}

section.tab { display:none; }
section.tab.active { display:block; }

[data-detail-only] { display: none; }
body.detail [data-detail-only] { display: block; }
body.detail [data-detail-only].inline { display: inline-flex; }

/* Fields */
.field-label { font-size:0.7rem; color:var(--text-dim); margin-bottom:6px; display:block; }
.field {
  background: rgba(255,255,255,0.04); border:1px solid var(--border); border-radius:0.6rem;
  padding:10px 12px; display:flex; align-items:center; justify-content:space-between;
  color: var(--text); font-size:0.85rem; width:100%; font-family:inherit;
}
.field:focus { outline: 1px solid rgba(34,211,238,0.4); }

button.primary {
  background: rgba(34,211,238,0.18); border:1px solid rgba(34,211,238,0.35); color:#67e8f9;
  padding:11px 14px; border-radius:0.6rem; font-size:0.85rem; font-weight:600; cursor:pointer;
}
button.primary:hover { background: rgba(34,211,238,0.26); }
button.ghost {
  background: rgba(34,211,238,0.15); border:1px solid rgba(34,211,238,0.3); color:#67e8f9;
  padding:8px 14px; border-radius:0.5rem; font-size:0.8rem; cursor:pointer;
}

table.datatable { width:100%; border-collapse: collapse; }
table.datatable th, table.datatable td { text-align:left; padding:9px 14px; font-size:0.78rem; }
table.datatable th { color:var(--text-faint); font-weight:500; font-size:0.65rem; letter-spacing:0.08em; text-transform:uppercase; }
table.datatable tr { border-top:1px solid rgba(255,255,255,0.05); }

.iconbtn-sm {
  width:26px; height:26px; border-radius:0.4rem; border:1px solid var(--border);
  background: rgba(255,255,255,0.03); display:inline-flex; align-items:center; justify-content:center;
  color:var(--text-dim); cursor:pointer;
}

.toast {
  font-size:0.75rem; color:#6ee7b7; opacity:0; transition:opacity .3s ease;
}
.toast.show { opacity:1; }

::-webkit-scrollbar { width:0; height:0; }
