:root {
  --ink: #172033;
  --muted: #6b7280;
  --navy: #142238;
  --navy-2: #1f3350;
  --red: #c51f30;
  --red-soft: #fff0f1;
  --blue: #2563a8;
  --blue-soft: #edf4fc;
  --green: #16705f;
  --green-soft: #eaf8f4;
  --amber: #a2600b;
  --amber-soft: #fff5df;
  --danger: #ad1f2c;
  --danger-soft: #fdecec;
  --line: #e3e8ef;
  --line-strong: #cdd5df;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --shadow: 0 14px 38px rgba(20, 34, 56, 0.08);
  --shadow-small: 0 7px 20px rgba(20, 34, 56, 0.07);
  --radius: 18px;
  --radius-small: 11px;
  --font: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 3%, rgba(197, 31, 48, 0.06), transparent 24rem),
    linear-gradient(180deg, #f8fafb 0, var(--canvas) 32rem);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: #fff;
  background: var(--red);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 24px rgba(197, 31, 48, 0.24);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.auth-story {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(36px, 7vw, 88px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 34, 56, 0.97), rgba(31, 51, 80, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(255, 255, 255, 0.04) 90px 91px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-story::before,
.auth-story::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-story::before {
  width: 560px;
  height: 560px;
  right: -220px;
  top: -180px;
}

.auth-story::after {
  width: 320px;
  height: 320px;
  right: 5%;
  bottom: 10%;
  background: rgba(197, 31, 48, 0.16);
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: auto 0;
  padding: 60px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--red);
}

.auth-copy h1 {
  margin: 22px 0 18px;
  max-width: 11em;
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.85;
}

.auth-flow {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.auth-flow span {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.auth-flow strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 13px;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px clamp(22px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 29px;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
}

.auth-tabs,
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f8fa;
}

.auth-tabs button,
.segmented button {
  border: 0;
  border-radius: 8px;
  padding: 8px 15px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-tabs button.active,
.segmented button.active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 3px 12px rgba(20, 34, 56, 0.08);
}

.auth-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0, rgba(197, 31, 48, 0.18), transparent 14rem),
    var(--navy);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 11px;
  font-size: 12px;
}

.brand-copy strong {
  display: block;
  font-size: 14px;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.nav-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  text-align: left;
  font-weight: 600;
  transition: 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 3px 0 0 var(--red);
}

.nav-glyph {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-item.active .nav-glyph {
  color: #fff;
  background: var(--red);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  margin-bottom: 10px;
}

.sidebar-user strong {
  display: block;
  font-size: 13px;
}

.sidebar-user span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.logout-button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-bottom: 1px solid rgba(227, 232, 239, 0.86);
  background: rgba(248, 250, 251, 0.88);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.topbar-title p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--navy-2);
  font-size: 12px;
  font-weight: 800;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 42px) 54px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  transition: 140ms ease;
}

.btn:hover {
  border-color: #b8c2ce;
  transform: translateY(-1px);
  box-shadow: var(--shadow-small);
}

.btn.primary {
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.btn.danger {
  border-color: #efc9cc;
  color: var(--danger);
  background: #fff;
}

.btn.ghost {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.btn.small {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 34, 56, 0.02);
}

.card.pad {
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.card-header h3 {
  margin: 0;
  font-size: 16px;
}

.card-body {
  padding: 18px 20px 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(20, 34, 56, 0.035);
}

.metric.accent {
  color: #fff;
  border-color: var(--navy);
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
}

.metric.accent::after {
  background: rgba(197, 31, 48, 0.24);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric.accent .metric-label {
  color: rgba(255, 255, 255, 0.62);
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-hint {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.metric.accent .metric-hint {
  color: rgba(255, 255, 255, 0.58);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.8fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

.status-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 28px;
  color: #fff;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(20, 34, 56, 0.98), rgba(31, 51, 80, 0.94)),
    var(--navy);
  box-shadow: var(--shadow);
}

.status-hero::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -140px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  border: 46px solid rgba(197, 31, 48, 0.13);
}

.status-hero > * {
  position: relative;
  z-index: 1;
}

.status-hero h2 {
  margin: 8px 0 8px;
  font-size: 29px;
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.status-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.status-hero .hero-kicker {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-stat {
  min-width: 160px;
  align-self: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.hero-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f4f7;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.red {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.gray {
  color: #64748b;
  background: #f1f5f9;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #52606f;
  background: #f1f4f7;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.accepted,
.status-pill.active,
.status-pill.reviewed {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.submitted,
.status-pill.reviewing,
.status-pill.pending {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-pill.waitlisted,
.status-pill.returned,
.status-pill.paused,
.status-pill.draft {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.rejected,
.status-pill.withdrawn,
.status-pill.absent {
  color: var(--danger);
  background: var(--danger-soft);
}

.task-list,
.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item,
.timeline-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child,
.timeline-item:last-child {
  border-bottom: 0;
}

.task-index {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
}

.task-item.done .task-index {
  color: var(--green);
  background: var(--green-soft);
}

.task-title {
  font-weight: 700;
}

.task-note,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #edf0f3;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #e35d69);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.day-cell {
  min-height: 66px;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  background: #fff;
}

.day-cell span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.day-cell strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
}

.day-cell.has-report {
  border-color: #b9e0d8;
  background: var(--green-soft);
}

.day-cell.missing {
  border-color: #f1d39e;
  background: var(--amber-soft);
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 42px 22px;
  text-align: center;
}

.empty-state h3 {
  margin: 14px 0 6px;
}

.empty-state p {
  max-width: 520px;
  margin: 0 0 18px;
  color: var(--muted);
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 14px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.field label .required {
  color: var(--red);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d5dce5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input,
.field select {
  min-height: 42px;
  padding: 9px 11px;
}

.field textarea {
  min-height: 110px;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7998be;
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.09);
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

.check-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.split-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.split-note div {
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fb;
}

.split-note strong {
  display: block;
  font-size: 12px;
}

.split-note span {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #5e6a78;
  background: #f8fafb;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfcfd;
}

.cell-main {
  font-weight: 700;
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nowrap {
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar .grow {
  flex: 1;
  min-width: 220px;
}

.toolbar input,
.toolbar select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d5dce5;
  border-radius: 9px;
  background: #fff;
}

.toolbar .grow input {
  width: 100%;
}

.list-stack {
  display: grid;
  gap: 11px;
}

.list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.list-card h4 {
  margin: 0;
  font-size: 14px;
}

.list-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.list-actions {
  display: flex;
  gap: 7px;
}

.content-block {
  white-space: pre-wrap;
  word-break: break-word;
}

.note-card {
  padding: 13px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-soft);
}

.note-card p {
  margin: 5px 0 0;
}

.warning-box,
.info-box,
.success-box {
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 12.5px;
}

.warning-box {
  color: #84520f;
  background: var(--amber-soft);
  border: 1px solid #f0d6a3;
}

.info-box {
  color: #28588a;
  background: var(--blue-soft);
  border: 1px solid #cfe0f2;
}

.success-box {
  color: #176253;
  background: var(--green-soft);
  border: 1px solid #c3e6dd;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.attachment-link:hover {
  border-color: #9bb1c9;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.file-list span {
  color: var(--muted);
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 21, 34, 0.56);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(820px, 100%);
  max-height: min(90vh, 980px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(10, 19, 31, 0.26);
}

.modal.narrow {
  width: min(560px, 100%);
}

.modal.wide {
  width: min(1060px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-size: 18px;
}

.modal-body {
  padding: 20px 22px 24px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-strip div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9fafb;
}

.kpi-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.kpi-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.region-bars {
  display: grid;
  gap: 12px;
}

.region-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.region-row .bar {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #edf0f3;
}

.region-row .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy-2), var(--blue));
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--green);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.loading {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
}

.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: auto;
    padding: 28px 22px 34px;
  }

  .auth-copy {
    padding: 46px 0 28px;
  }

  .auth-copy h1 {
    font-size: 37px;
  }

  .auth-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-panel {
    padding: 34px 20px 52px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    height: auto;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .brand,
  .sidebar-foot {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 3px;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    width: auto;
    min-width: 0;
    padding: 6px 5px;
    border-radius: 8px;
    font-size: 10px;
    text-align: center;
  }

  .nav-item.active {
    box-shadow: none;
  }

  .nav-glyph {
    width: 23px;
    height: 23px;
    font-size: 9px;
  }

  .main-area {
    padding-bottom: 74px;
  }

  .topbar {
    min-height: 60px;
    padding: 0 15px;
  }

  .topbar-title h1 {
    font-size: 16px;
  }

  .topbar-title p {
    display: none;
  }

  .user-chip span {
    display: none;
  }

  .user-chip {
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .content {
    padding: 18px 13px 34px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 15px;
  }

  .page-head h2 {
    font-size: 21px;
  }

  .metrics {
    gap: 9px;
  }

  .metric {
    min-height: 112px;
    padding: 14px;
  }

  .metric-value {
    font-size: 28px;
  }

  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .status-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .status-hero h2 {
    font-size: 24px;
  }

  .hero-stat {
    min-width: 0;
  }

  .week-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 60px;
    padding: 7px 3px;
  }

  .list-card {
    grid-template-columns: 1fr;
  }

  .list-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .split-note {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.narrow,
  .modal.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-head {
    padding: 17px 17px 13px;
  }

  .modal-body {
    padding: 17px;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-only {
    display: initial;
  }
}

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric-label {
    font-size: 11px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar input,
  .toolbar select {
    flex: 1 1 140px;
  }

  .auth-copy h1 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
