/* Team page: the app's frosted glass look (src/styles.css), laid out for a computer screen
   and still usable on a phone. */
:root {
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #8e8e93;
  --accent: #ff5000;
  --accent-soft: rgba(255, 80, 0, 0.12);
  --green: #34c759;
  --red: #ff3b30;
  --inset: rgba(118, 118, 128, 0.1);
  --hair: rgba(0, 0, 0, 0.07);
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: #f2f2f7; }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum" 1;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

.backdrop {
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 45% at 10% 10%, rgba(255, 186, 150, 0.6), transparent 70%),
    radial-gradient(38% 42% at 90% 8%, rgba(160, 196, 255, 0.6), transparent 72%),
    radial-gradient(42% 46% at 80% 85%, rgba(196, 178, 255, 0.45), transparent 70%),
    radial-gradient(40% 44% at 15% 90%, rgba(170, 225, 240, 0.45), transparent 70%),
    linear-gradient(180deg, #f5f5f7 0%, #ececf1 100%);
  filter: blur(50px) saturate(120%);
}

.glass {
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius);
}
.glass-strong {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  backdrop-filter: blur(40px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.07), 0 20px 48px -20px rgba(0, 0, 0, 0.25);
}

/* ── Type & helpers ── */
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0 0; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-2); margin: 22px 2px 10px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-2); }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.block { display: block; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ── Layout ── */
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 32px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-icon { width: 52px; height: 52px; border-radius: 12px; flex: none; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35); }
.loading-view { padding: 30vh 0; text-align: center; color: var(--fg-2); }
.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; }

/* ── Sign in & notices ── */
.narrow { max-width: 420px; margin: 9vh auto 0; padding: 30px 28px; text-align: center; }
.narrow p { line-height: 1.45; }
.app-icon { width: 76px; height: 76px; border-radius: 17px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35); margin-bottom: 14px; }
.notice { font-size: 17px; font-weight: 600; margin: 4px 0 18px; }
.narrow .btn + .btn { margin-top: 10px; }
form { margin-top: 18px; }
form > * + * { margin-top: 10px; }
.field {
  width: 100%; height: 50px; padding: 0 14px;
  border-radius: 14px; border: 0; outline: none;
  background: var(--inset); font: inherit; font-size: 17px; color: var(--fg);
}
.field:focus { box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.35); }
.error { color: var(--red); font-size: 14px; font-weight: 500; }
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px; border-radius: 16px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 24px -10px rgba(255, 80, 0, 0.7);
  transition: transform 0.15s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: rgba(255, 255, 255, 0.7); color: var(--fg); box-shadow: 0 0 0 0.5px var(--hair); }

/* ── Controls ── */
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--inset); }
.seg button { height: 34px; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--fg-2); }
.seg button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--hair); }
.select {
  height: 40px; padding: 0 34px 0 14px; border-radius: 12px; border: 0;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--fg);
  background: rgba(255, 255, 255, 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  box-shadow: 0 0 0 0.5px var(--hair);
}
.pill-btn { height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 0.5px var(--hair); font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill-btn:hover, .select:hover { background-color: #fff; }

/* ── Tiles ── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.tile { padding: 16px 18px; }
.tile .label { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.tile .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.tile .sub { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ── Tables ── */
.card { padding: 18px 18px 6px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin: 0 2px 8px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px 10px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  text-align: right; vertical-align: bottom; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--fg-2);
  padding: 8px 10px; border-bottom: 1px solid var(--hair); user-select: none;
}
.table td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 4px; }
.table th[data-sort] { cursor: pointer; }
.table th[data-sort]:hover { color: var(--fg); }
.table th.on { color: var(--accent); }
.table tbody tr[data-open] { cursor: pointer; }
.table tbody tr[data-open]:hover td, .table tbody tr[data-open]:focus-visible td { background: rgba(255, 255, 255, 0.6); }
.table tbody tr:focus-visible { outline: none; }
.table tfoot td { font-weight: 700; border-bottom: 0; }
.table.compact td, .table.compact th { padding: 7px 8px; }
.zero { color: var(--fg-3); opacity: 0.55; }

.agent { display: flex; align-items: center; gap: 10px; min-width: 210px; max-width: 280px; }
.agent.compact { min-width: 150px; max-width: 190px; gap: 8px; }
.rank { width: 20px; flex: none; text-align: right; color: var(--fg-3); font-weight: 600; font-size: 13px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--inset); }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--fg-2); }
.tag { display: inline-block; vertical-align: 1px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }

.acts th { text-align: center; white-space: normal; min-width: 52px; max-width: 64px; padding: 8px 3px; font-size: 11px; line-height: 1.2; }
.acts td { padding: 9px 4px; }
.acts th .ico { display: block; font-size: 18px; margin-bottom: 4px; }
.acts th .pts { display: block; margin-top: 2px; color: var(--fg-3); font-weight: 500; }
.acts th.on .pts { color: inherit; }
.acts td { text-align: center; }
.acts td:last-child, .acts th:last-child { text-align: right; }
.sticky { position: sticky; left: 0; z-index: 1; background: rgba(248, 248, 250, 0.97); }
.acts th.sticky { text-align: left; }

/* ── Agent sheet ── */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.18); animation: fade 0.2s ease; }
.sheet {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 21;
  width: min(480px, calc(100vw - 24px)); overflow-y: auto;
  padding: 20px 20px 24px; border-radius: 26px;
  animation: slide 0.25s ease;
}
.sheet-head { display: flex; align-items: center; gap: 14px; }
.close { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--inset); color: var(--fg-2); font-size: 13px; font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--inset); font-size: 12px; font-weight: 600; color: var(--fg-2); }
.pill.flame { background: linear-gradient(135deg, #ff7a2f, #ff3d00); color: #fff; }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mini { background: var(--inset); border-radius: 14px; padding: 10px 12px; }
.mini .v { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.mini .l { font-size: 11px; font-weight: 600; color: var(--fg-2); margin-top: 1px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin-bottom: 11px; font-size: 14px; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ff7a2f, #ff3d00); }
.empty { padding: 14px; border-radius: 14px; background: var(--inset); color: var(--fg-2); font-size: 14px; text-align: center; }
.day { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.day:last-child { border-bottom: 0; }
.day-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.hit { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip { padding: 4px 9px; border-radius: 999px; background: var(--inset); color: var(--fg-2); font-size: 12px; }
.chip b { color: var(--fg); }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }

/* ── Phone ── */
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .wrap { padding: 16px 16px 40px; }
  h1 { font-size: 24px; }
  .brand-icon { width: 44px; height: 44px; border-radius: 10px; }
  .tile .value { font-size: 24px; }
  .tiles { gap: 10px; }
  .card { padding: 14px 14px 4px; }
  .scroll { margin: 0 -14px; padding: 0 14px 8px; }
  .agent { min-width: 170px; }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh; border-radius: 26px 26px 0 0; animation-name: rise; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
}
@media (prefers-reduced-motion: reduce) {
  .scrim, .sheet { animation: none; }
}
