:root {
  --background: #f4f7f1;
  --foreground: #202722;
  --surface: #ffffff;
  --line: #d6dfd8;
  --muted: #68736b;
  --accent: #0f7f68;
  --accent-strong: #095f50;
  --danger: #b3261e;
  --warning: #bd6b00;
  --shadow: 0 14px 34px rgba(47, 64, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

button:disabled {
  opacity: 0.55;
}

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.auth-screen {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 18px;
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-message {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 800;
}

.topbar {
  display: grid;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.brand-note {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.summary div,
.status-line,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary div {
  min-height: 74px;
  padding: 12px;
}

.summary strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-line {
  margin-bottom: 14px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.status-line.offline {
  background: #f6ead9;
  color: var(--warning);
}

.status-line.online {
  background: #ddf3e7;
  color: var(--accent-strong);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

.main-grid.lower {
  margin-top: 14px;
}

.panel {
  padding: 16px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: #eef1ed;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 850;
  text-align: right;
}

.pill.ready {
  background: #ddf3e7;
  color: var(--accent-strong);
}

.pill.warning {
  background: #f6ead9;
  color: var(--warning);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfb;
  color: var(--foreground);
  padding: 0 12px;
  outline: none;
}

.photo-picker {
  display: grid;
  place-items: center;
  min-height: 54px;
  margin-top: 14px;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 12px;
  overflow: hidden;
  border: 1px dashed #b8c7bd;
  border-radius: 8px;
  background: #eef4ef;
  color: var(--muted);
  text-align: center;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.open-button,
.secondary-button,
.ghost-button,
.mini-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
}

.open-button {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
}

.secondary-button {
  border: 1px solid #abc7bb;
  background: #e7f4ee;
  color: var(--accent-strong);
}

.ghost-button,
.mini-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--foreground);
}

.mini-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: 0.82rem;
}

.install-button {
  background: var(--accent);
  color: white;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.record-card.active {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  border-color: #a9d7c5;
  background: #f0faf5;
}

.record-card.pending {
  border-color: #e2c590;
  background: #fff8ea;
}

.record-card img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #e7ece8;
}

.record-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-body strong,
.record-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-body span {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  margin: 0;
  border: 1px dashed #c4d1c8;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.employee-form {
  display: grid;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  border-radius: 999px;
  background: #f0f2f7;
  color: #25345d;
  padding: 0 6px 0 12px;
  font-size: 0.84rem;
  font-weight: 850;
}

.chip button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #25345d;
}

.settings-box,
.access-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-radius: 8px;
  background: #eef3ef;
  padding: 12px;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.access-box a {
  display: block;
  color: var(--accent-strong);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.wide {
  width: 100%;
  margin-top: 12px;
}

.monitoring-panel {
  margin-top: 14px;
}

.monitor-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.88rem;
}

.monitor-status strong {
  color: var(--foreground);
}

.monitor-status span:last-child {
  margin-left: auto;
  text-align: right;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--warning);
}

.status-dot.ok {
  background: var(--accent);
}

.status-dot.warning {
  background: var(--warning);
}

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

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

.monitor-metric {
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.monitor-metric span,
.disk-box span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.monitor-metric strong,
.disk-box strong {
  display: block;
  margin-top: 5px;
  font-size: 1.1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.disk-box {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.disk-box > div:first-child {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e4;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.meter span.warning {
  background: var(--warning);
}

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

.checker-shell {
  max-width: 980px;
}

.checker-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checker-panel {
  margin-top: 14px;
}

.checker-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.checker-list {
  display: grid;
  gap: 10px;
}

.checker-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.checker-card.active {
  border-color: #a9d7c5;
  background: #f0faf5;
}

.checker-photo {
  width: 68px;
  height: 68px;
  border-radius: 7px;
  object-fit: cover;
  background: #e7ece8;
}

.checker-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.checker-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checker-card-title strong,
.checker-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checker-card-body > span,
.checker-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.checker-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef1ed;
  color: var(--accent-strong);
  padding: 5px 8px;
  font-size: 0.75rem;
  font-weight: 900;
}

.checker-card.active .checker-badge {
  background: #ddf3e7;
}

.checker-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .main-grid,
  .record-card.active {
    grid-template-columns: 1fr;
  }

  .record-card.active {
    justify-items: stretch;
  }

  .record-card.active img {
    display: none;
  }

  .section-heading {
    display: grid;
  }

  .pill {
    text-align: left;
  }

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

  .monitor-status,
  .disk-box > div:first-child {
    display: grid;
  }

  .monitor-status span:last-child {
    margin-left: 0;
    text-align: left;
  }

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

  .checker-controls,
  .checker-card,
  .checker-meta {
    grid-template-columns: 1fr;
  }

  .checker-photo {
    display: none;
  }

  .checker-card-title {
    display: grid;
  }
}
