:root {
  --ink: #12304a;
  --muted: #4d6b86;
  --line: rgba(255, 255, 255, 0.72);
  --blue: #2f6fed;
  --blue-deep: #1d4e89;
  --glass: rgba(255, 255, 255, 0.46);
  --glass-strong: rgba(255, 255, 255, 0.68);
  --shadow: 0 18px 40px rgba(47, 111, 237, 0.12);
  --font: "Segoe UI", "Manrope", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(255, 255, 255, 0.85), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(125, 180, 255, 0.55), transparent 50%),
    linear-gradient(165deg, #d7ebff 0%, #eef6ff 42%, #c9e0fb 100%);
}

h1, h2 { font-weight: 650; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chrome, .filters, .panel, .banner, #error-line, .settings {
  width: min(1120px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.chrome {
  position: sticky;
  top: 0.75rem;
  z-index: 5;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 24px;
  padding: 0.85rem 1rem 0.65rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0 0 0.7rem;
}

.top-actions, .row-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.top-actions { justify-content: flex-end; }
.sync-line { margin: 0; color: var(--muted); font-size: 0.92rem; }

a.ghost, button, select, input {
  font: inherit;
  color: inherit;
}

a.ghost {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.35);
}

a.ghost.is-current {
  background: rgba(47, 111, 237, 0.16);
  border-color: rgba(47, 111, 237, 0.35);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  padding-top: 0.6rem;
}

.tabs a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--blue-deep);
  font-weight: 650;
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
}

.tabs a.active {
  background: linear-gradient(180deg, #5b93f5, var(--blue));
  color: white;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.22);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: linear-gradient(180deg, #5b93f5, var(--blue));
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.25);
}

button:disabled { opacity: 0.55; cursor: wait; }

button.ghost, button.chip {
  background: rgba(255, 255, 255, 0.4);
  color: var(--blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

button.chip[aria-pressed="true"] {
  background: rgba(47, 111, 237, 0.18);
  border-color: rgba(47, 111, 237, 0.45);
  color: var(--blue);
}

.banner, .form-error { border-radius: 16px; padding: 0.9rem 1rem; }
.banner {
  background: rgba(255, 248, 230, 0.72);
  color: #7a4b12;
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  margin-bottom: 1rem;
}
.form-error { color: #8d2b1f; margin: 0.4rem 0; }
#error-line { background: rgba(253, 236, 234, 0.8); margin-bottom: 1rem; }

.filters {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  border-radius: 22px;
  padding: 1rem 1.1rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

label, legend { font-size: 0.82rem; color: var(--muted); }
label { display: grid; gap: 0.35rem; }

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.8rem;
  align-items: end;
}

.inline { display: flex; gap: 0.4rem; align-items: center; }

select, input[type="date"], input[type="password"], input[type="text"], input[type="search"] {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  min-width: 11rem;
}

.panel {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 24px;
  padding: 1.25rem 1.3rem 1.4rem;
}

.panel-head p { margin: 0.4rem 0 0; color: var(--muted); max-width: 46rem; }

.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }

.kpi {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 0.9rem 1rem 1rem;
}

.kpi span {
  display: block;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.kpi small { color: var(--muted); }

.chart-box { height: 260px; margin-top: 1rem; }
.chart-box-tall { height: 300px; }

.table-wrap { overflow-x: auto; margin-top: 0.6rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.7rem 0.4rem; border-bottom: 1px solid rgba(47, 111, 237, 0.12); }
th { color: var(--muted); font-size: 0.78rem; font-weight: 650; }
td.num, th.num { text-align: right; }
tfoot td { font-weight: 700; border-bottom: 0; }
.empty { color: var(--muted); padding: 0.8rem 0; }

.login-body { display: grid; place-items: center; padding: 2rem 1rem; }
.login-card {
  width: min(440px, 100%);
  border-radius: 28px;
  padding: 2rem 1.6rem 1.6rem;
}
.login-card .lead { color: var(--muted); }
.login-card form { display: grid; gap: 0.45rem; }
.login-card button { margin-top: 0.6rem; }
.login-card input { width: 100%; }

.settings { padding-bottom: 2rem; }
.settings h1 { margin: 1.2rem 0 0.4rem; }
.person-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.35rem; }
.person-list li {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}
.person-list .muted { color: var(--muted); font-size: 0.85rem; }
.group-label { margin: 1rem 0 0.3rem; color: var(--muted); }

.schedule { display: grid; gap: 0.55rem; margin: 1rem 0 1.1rem; }
.schedule-row { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; }
.day-toggle { display: flex; gap: 0.55rem; align-items: center; width: 11rem; color: var(--ink); font-size: 1rem; }
.schedule-row input[type="time"] { min-width: 0; width: 8rem; }

.subhead { margin: 1.3rem 0 0; font-size: 1.05rem; }
.hint { margin: 0.3rem 0 0.7rem; color: var(--muted); }

.heatmap { overflow: auto; max-height: 440px; margin-top: 0.4rem; }
.heat-toggle { margin: 0 0 0.6rem; }
.heat-grid {
  display: grid;
  grid-template-columns: 4.2rem repeat(var(--hours, 14), minmax(1.7rem, 1fr));
  gap: 3px;
  min-width: 640px;
}
.heat-label, .heat-cell {
  height: 1.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}
.heat-label { color: var(--muted); }
.heat-cell { color: #12304a; font-variant-numeric: tabular-nums; }
.heat-cell.hot { color: white; }

.month-line, .cards {
  width: min(1120px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}
.month-line { color: var(--muted); margin-top: 0; margin-bottom: 0.8rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.manager-card { border-radius: 22px; padding: 1rem 1.1rem 1.15rem; }
.manager-card.place-1 {
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.92), rgba(255, 255, 255, 0.62));
  border-color: rgba(212, 160, 23, 0.85);
}
.manager-card.place-2 {
  background: linear-gradient(180deg, rgba(236, 242, 248, 0.92), rgba(255, 255, 255, 0.62));
  border-color: rgba(142, 160, 181, 0.9);
}
.manager-card.place-3 {
  background: linear-gradient(180deg, rgba(255, 232, 214, 0.9), rgba(255, 255, 255, 0.62));
  border-color: rgba(184, 116, 62, 0.8);
}
.person { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; }
.person h2 { font-size: 1.15rem; }
.face { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.avatar, .avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.medal {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid white;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.medal-1 { background: linear-gradient(180deg, #ffe08a, #d4a017); color: #5a3d04; }
.medal-2 { background: linear-gradient(180deg, #f4f7fb, #9aafc4); color: #24384d; }
.medal-3 { background: linear-gradient(180deg, #f0c09a, #b8743e); color: #4a2710; }
.avatar { object-fit: cover; background: rgba(255, 255, 255, 0.7); }
.avatar-fallback {
  display: grid;
  place-items: center;
  background: rgba(47, 111, 237, 0.16);
  color: var(--blue-deep);
  font-weight: 700;
}
.deal-note {
  width: min(1120px, calc(100% - 2rem));
  margin: 0.2rem auto 0.8rem;
}
.deal-blocks { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 2rem; display: grid; gap: 0.8rem; }
.deal-manager h2 { margin-bottom: 0.25rem; }
.plan-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.plan-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 0.35rem 0.8rem;
  align-items: baseline;
}
.plan-list small { grid-column: 1 / -1; color: var(--muted); }
.stub { border-radius: 22px; padding: 1.3rem 1.4rem 1.5rem; }
.stub h1 { margin-bottom: 0.6rem; }
.stub p { margin: 0; color: var(--muted); max-width: 40rem; }
.metric { display: flex; justify-content: space-between; gap: 0.8rem; margin: 0.4rem 0; }
.metric span { color: var(--muted); }
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(47, 111, 237, 0.12);
  overflow: hidden;
  margin-top: 0.45rem;
}
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7db4ff, #2f6fed);
}
.percent { margin: 0.4rem 0 0; color: var(--blue-deep); font-weight: 650; }
.plan-grid { display: grid; gap: 0.45rem; margin: 1rem 0; }
.plan-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; color: var(--ink); font-size: 1rem; }
.plan-row input { width: 9rem; min-width: 0; }

@media (max-width: 800px) {
  .top { flex-direction: column; align-items: flex-start; }
  .tabs { flex-direction: column; }
  .kpi-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
