:root {
  --blue: #155eef;
  --blue-dark: #0f3ea8;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --panel: #ffffff;
  --bg: #f6f8fb;
  --green: #07875f;
  --amber: #b45309;
  --red: #c2410c;
  --sky: #0369a1;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.loading-screen,
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #0f3ea8 0%, #155eef 48%, #0f766e 100%);
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--blue);
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.22);
}

.loading-screen p {
  color: white;
  font-weight: 700;
}

.login-panel {
  width: min(100%, 430px);
  color: white;
}

.login-panel h1 {
  margin: 18px 0 6px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-panel .subtitle {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.78);
}

.panel {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.13);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn,
.small-btn {
  min-height: 46px;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 850;
}

.primary-btn {
  background: var(--blue);
  color: white;
}

.secondary-btn {
  background: #eaf1ff;
  color: var(--blue-dark);
}

.danger-btn {
  background: #fff1ed;
  color: var(--red);
}

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

.small-btn {
  min-height: 36px;
  padding: 8px 10px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 13px;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row > * {
  flex: 1;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.input-action.top-align {
  align-items: start;
}

.input-action .small-btn {
  min-width: 64px;
}

.icon-btn {
  font-size: 18px;
}

.demo-list {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mini {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 900;
  flex: none;
}

.brand-title {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 92px;
}

.hero-band {
  background: linear-gradient(135deg, #123d8a, #155eef 56%, #07875f);
  color: white;
  padding: 18px;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.hero-band h1,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero-band h1 {
  font-size: 24px;
  line-height: 1.12;
}

.hero-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.grid {
  display: grid;
  gap: 12px;
}

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

.kpi {
  padding: 14px;
}

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

.kpi-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
}

.kpi-foot {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #123d8a, #155eef 58%, #07875f);
  color: white;
}

.report-hero h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.report-hero p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.progress-ring {
  --value: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#22c55e calc(var(--value) * 1%), rgba(255, 255, 255, 0.22) 0);
  position: relative;
  flex: none;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #123d8a;
}

.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
}

.progress-ring strong {
  font-size: 24px;
  line-height: 1;
}

.progress-ring span {
  margin-top: 32px;
  position: absolute;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.report-stat {
  min-height: 104px;
  padding: 13px;
  display: grid;
  align-content: center;
  gap: 5px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.report-stat span {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.report-stat strong {
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0;
}

.report-stat em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.report-stat.green {
  background: #f0fdf4;
}

.report-stat.green strong {
  color: #07875f;
}

.report-stat.blue {
  background: #eff6ff;
}

.report-stat.blue strong {
  color: #155eef;
}

.report-stat.amber {
  background: #fffbeb;
}

.report-stat.amber strong {
  color: #d97706;
}

.report-stat.red {
  background: #fff1f2;
}

.report-stat.red strong {
  color: #dc2626;
}

.chart-card {
  padding: 14px;
  min-width: 0;
}

.section-title.compact {
  margin: 0 0 12px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: white;
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 950;
}

.legend-list,
.summary-table,
.latest-list,
.progress-list {
  display: grid;
  gap: 9px;
}

.legend-row,
.summary-row,
.latest-row,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.legend-row span,
.summary-row span,
.latest-row span,
.progress-row span {
  color: var(--muted);
  font-size: 12px;
}

.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.summary-row,
.latest-row,
.progress-row {
  padding: 10px 0;
  border-top: 1px solid #eef2f7;
}

.summary-row:first-child,
.latest-row:first-child,
.progress-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary-row > div,
.latest-row > div,
.progress-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.summary-row strong,
.latest-row strong,
.progress-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-focus {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.location-focus span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.location-focus strong {
  font-size: 20px;
}

.metric-list {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.metric-list div {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid #eef2f7;
}

.metric-list div:first-child {
  border-top: 0;
}

.metric-list span {
  color: #334155;
  font-weight: 850;
}

.metric-list strong {
  font-size: 20px;
}

.metric-list .good {
  color: #07875f;
}

.metric-list .ok {
  color: #d97706;
}

.metric-list .bad {
  color: #dc2626;
}

.bar-chart {
  min-height: 190px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(42px, 1fr);
  gap: 10px;
  align-items: end;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  min-height: 172px;
  text-align: center;
}

.bar-track {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 8px;
  background: #edf3ff;
  overflow: hidden;
}

.bar-track span {
  width: 100%;
  min-height: 8px;
  display: block;
  background: linear-gradient(180deg, #155eef, #07875f);
}

.bar-item strong {
  font-size: 13px;
}

.bar-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 160px) 42px;
}

.progress.mini {
  height: 8px;
}

.empty.small {
  padding: 14px 0;
  box-shadow: none;
  border: 0;
}

.saved-screen {
  max-width: 520px;
  margin: 0 auto;
  min-height: calc(100vh - 160px);
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.saved-check {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #22c55e;
  color: white;
  font-size: 48px;
  font-weight: 950;
  box-shadow: 0 18px 35px rgba(34, 197, 94, 0.25);
}

.saved-screen h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.saved-card {
  display: grid;
  gap: 0;
  padding: 0;
  text-align: left;
  overflow: hidden;
  box-shadow: none;
}

.saved-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #eef2f7;
}

.saved-card div:first-child {
  border-top: 0;
}

.saved-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.saved-card strong {
  text-align: right;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}

.section-title h2 {
  font-size: 18px;
}

.progress {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--green);
}

.asset-card,
.campus-card,
.issue-card {
  padding: 14px;
}

.asset-card {
  display: grid;
  gap: 10px;
}

.asset-head,
.asset-meta,
.status-line,
.nav-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.asset-title {
  font-weight: 900;
  line-height: 1.2;
}

.asset-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #334155;
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.tag.green {
  background: #dcfce7;
  color: #166534;
}

.tag.amber {
  background: #fef3c7;
  color: #92400e;
}

.tag.red {
  background: #ffedd5;
  color: #9a3412;
}

.tag.blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.toolbar {
  position: sticky;
  top: 60px;
  z-index: 15;
  display: grid;
  gap: 10px;
  padding: 12px 0;
  background: var(--bg);
}

.segmented {
  display: flex;
  background: #e7edf7;
  padding: 4px;
  border-radius: 8px;
}

.segmented button {
  flex: 1;
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-weight: 850;
}

.segmented button.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--line);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav button {
  min-height: 64px;
  background: white;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.bottom-nav button.active {
  color: var(--blue);
}

.verify-panel {
  padding: 14px;
  display: grid;
  gap: 14px;
}

.verify-layout {
  max-width: 620px;
  margin: 0 auto;
}

.app-form {
  box-shadow: none;
}

.asset-confirm {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.code-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.code-suggestions button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #0f172a;
  font-weight: 850;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-suggestions button:focus,
.code-suggestions button:hover {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue-dark);
}

.form-actions {
  position: sticky;
  bottom: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 8px;
  background: white;
}

.save-status {
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 12px;
}

.qty-stepper.compact {
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
}

.qty-stepper button {
  height: 54px;
  border-radius: 8px;
  background: #eaf1ff;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.qty-value {
  text-align: center;
  font-size: 42px;
  font-weight: 950;
}

.qty-stepper.compact .qty-value {
  font-size: 28px;
}

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

.condition-grid button {
  min-height: 56px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  font-weight: 850;
}

.condition-grid button.active {
  border-color: var(--blue);
  background: #eaf1ff;
  color: var(--blue-dark);
}

.camera-box {
  min-height: 260px;
  border-radius: 8px;
  background: #0f172a;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: white;
}

.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 86px;
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  background: #0f172a;
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.two-col {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
}

@media (max-width: 760px) {
  .report-hero {
    grid-template-columns: 1fr;
  }

  .progress-ring {
    justify-self: start;
    width: 82px;
    height: 82px;
  }

  .progress-ring strong {
    font-size: 20px;
  }

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

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

  .report-stat {
    min-height: 96px;
  }

  .report-stat strong {
    font-size: 24px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .donut {
    width: 118px;
    height: 118px;
  }

  .progress-row {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .progress-row .progress {
    grid-column: 1 / -1;
    order: 3;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .brand-title {
    max-width: 190px;
  }

  .desktop-only {
    display: none;
  }
}

@media (min-width: 760px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
