:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #d9dee5;
  --text: #20252d;
  --muted: #68717d;
  --accent: #c83f3f;
  --accent-strong: #a72f33;
  --green: #1d8b63;
  --green-soft: #e6f5ee;
  --amber: #b7791f;
  --amber-soft: #fff2d8;
  --red: #bd2d2d;
  --red-soft: #ffe8e8;
  --ink-soft: #edf1f5;
  --shadow: 0 16px 40px rgba(32, 37, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-label,
.section-label {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.topbar-actions,
.side-actions,
.report-panel-header,
.evidence-header,
.area-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--ink-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover,
.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(32, 37, 45, 0.08);
}

.button:focus-visible,
.file-button:focus-within,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(200, 63, 63, 0.18);
  outline-offset: 2px;
}

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

.button-light {
  background: var(--surface-soft);
}

.button-danger {
  border-color: #f0b8b8;
  background: var(--red-soft);
  color: var(--red);
}

.full {
  width: 100%;
}

.is-hidden {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(420px, 1fr) minmax(320px, 390px);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.side-panel,
.work-panel,
.report-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.side-panel,
.report-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.side-panel {
  padding: 14px;
}

.summary-box {
  padding: 16px;
  border-radius: 8px;
  background: var(--ink-soft);
  border: 1px solid #dce3ea;
}

.summary-box strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 36px;
  line-height: 1;
}

.summary-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.summary-status,
.pill,
.area-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.summary-status.pending,
.pill.pending,
.area-status.pending {
  background: var(--ink-soft);
  color: #49515d;
}

.summary-status.green,
.pill.green,
.area-status.green {
  background: var(--green-soft);
  color: var(--green);
}

.summary-status.amber,
.pill.amber,
.area-status.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.summary-status.red,
.pill.red,
.area-status.red {
  background: var(--red-soft);
  color: var(--red);
}

.area-nav {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.area-tab {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
  text-align: left;
}

.area-tab.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.area-initial {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #20252d;
  color: white;
  font-weight: 900;
}

.area-tab strong {
  display: block;
  font-size: 14px;
  line-height: 1.1;
}

.area-tab small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.side-actions {
  flex-direction: column;
}

.work-panel {
  padding: 18px;
}

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

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

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

textarea {
  min-height: 96px;
  padding: 11px;
  resize: vertical;
}

.staff-shell {
  margin-bottom: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cash-shell {
  margin-bottom: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cash-header {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.8fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

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

.cash-chip {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.cash-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.cash-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.cash-chip.positive strong {
  color: var(--green);
}

.cash-chip.warning strong {
  color: var(--amber);
}

.cash-chip.danger strong {
  color: var(--red);
}

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

.staff-header,
.staff-summary,
.staff-head,
.staff-row {
  display: grid;
  gap: 10px;
}

.staff-header {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 12px;
}

.staff-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.file-picker-button {
  cursor: pointer;
}

.file-picker-button.is-disabled {
  cursor: wait;
  opacity: 0.65;
  pointer-events: none;
}

.file-input-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.attendance-upload-status {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.attendance-upload-status.is-hidden {
  display: none;
}

.attendance-upload-status.success {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
}

.attendance-upload-status.danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
}

.attendance-upload-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.attendance-upload-top strong {
  font-variant-numeric: tabular-nums;
}

.attendance-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
}

.attendance-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.attendance-upload-status.success .attendance-progress span {
  background: var(--green);
}

.attendance-upload-status.danger .attendance-progress span {
  background: var(--red);
}

.staff-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.staff-stat {
  min-height: 68px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.staff-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.staff-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.staff-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.staff-head,
.staff-row {
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, 0.9fr) minmax(100px, 0.7fr) minmax(100px, 0.7fr) minmax(125px, 0.8fr) minmax(150px, 1fr) 42px;
  align-items: center;
}

.staff-head {
  min-height: 44px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.staff-row {
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.staff-row input,
.staff-row select {
  min-height: 38px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #f0b8b8;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.area-header {
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.area-score {
  display: grid;
  grid-template-columns: 12px auto;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  justify-items: end;
  min-width: 120px;
}

.area-score span {
  grid-row: 1 / 3;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #8a95a3;
}

.area-score span.green {
  background: var(--green);
}

.area-score span.amber {
  background: var(--amber);
}

.area-score span.red {
  background: var(--red);
}

.area-score strong {
  font-size: 24px;
}

.area-score small {
  color: var(--muted);
  font-weight: 750;
}

.checklist-shell {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.checklist-head,
.checklist-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(260px, 1fr) minmax(180px, 0.9fr);
  align-items: center;
}

.checklist-head {
  min-height: 44px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.checklist-head span,
.checklist-row > div {
  padding: 12px;
}

.checklist-row {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.checklist-row strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.checklist-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segmented label {
  position: relative;
  display: block;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 36px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.segmented input:checked + span {
  border-color: var(--accent);
  background: rgba(200, 63, 63, 0.09);
  color: var(--accent-strong);
}

.segmented input[value="ok"]:checked + span {
  border-color: #7ac5a8;
  background: var(--green-soft);
  color: var(--green);
}

.segmented input[value="fail"]:checked + span {
  border-color: #edaaaa;
  background: var(--red-soft);
  color: var(--red);
}

.note-input {
  min-height: 38px;
}

.evidence-shell {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.evidence-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  white-space: nowrap;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe5ec;
}

.photo-card footer {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.photo-card small {
  color: var(--muted);
  line-height: 1.2;
  word-break: break-word;
}

.photo-card button {
  min-height: 32px;
  border: 1px solid #f0b8b8;
  border-radius: 6px;
  background: white;
  color: var(--red);
  font-weight: 800;
}

.empty-photos {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.report-panel {
  padding: 16px;
}

.report-panel-header {
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.screen-report {
  display: grid;
  gap: 14px;
}

.report-block {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.report-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.kpi {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.area-mini-list {
  display: grid;
  gap: 8px;
}

.area-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f4;
}

.area-mini:last-child {
  border-bottom: 0;
}

.area-mini strong {
  font-size: 14px;
}

.area-mini small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.issue-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.issue-list li {
  line-height: 1.35;
}

.print-report {
  display: none;
}

.save-notice,
.alert {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  line-height: 1.35;
}

.save-notice.success,
.alert.success {
  border-color: #8fd0b6;
  background: var(--green-soft);
  color: var(--green);
}

.save-notice.danger,
.alert.danger {
  border-color: #f0b8b8;
  background: var(--red-soft);
  color: var(--red);
}

.save-notice a {
  color: inherit;
  font-weight: 850;
}

.install-page,
.history-page,
.detail-page {
  min-height: 100vh;
  padding: 24px;
}

.install-box,
.page-card {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.install-box {
  max-width: 680px;
}

.login-logo {
  display: block;
  width: min(240px, 70vw);
  max-height: 130px;
  object-fit: contain;
  margin: 0 auto 18px;
}

.login-system-title {
  max-width: 560px;
  margin: 0 auto 8px;
  text-align: center;
  font-size: 28px;
  line-height: 1.15;
}

.login-screen-title {
  margin: 0 0 18px;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  font-weight: 850;
  text-transform: uppercase;
}

.page-logo {
  display: block;
  width: min(220px, 60vw);
  max-height: 90px;
  object-fit: contain;
  margin-bottom: 10px;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-field input {
  min-width: 0;
}

.password-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

.login-links {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  font-weight: 800;
}

.login-links a {
  color: var(--accent-strong);
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

.brand-settings {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}

.brand-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 18px;
}

.brand-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.logo-placeholder {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 34px;
  font-weight: 900;
}

.brand-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  max-width: 420px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-row label {
  min-width: 180px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-stat {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.detail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stored-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.stored-photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.user-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-card.inactive {
  background: var(--surface-soft);
  opacity: 0.78;
}

.user-card header,
.user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-card header strong {
  display: block;
  font-size: 18px;
}

.user-card header span,
.user-card header small {
  color: var(--muted);
  font-weight: 750;
}

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

.user-edit-form label:first-of-type {
  grid-column: 1 / -1;
}

.area-assignment {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.area-assignment legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.area-assignment .muted {
  margin-bottom: 10px;
  font-size: 13px;
}

.area-assignment.is-disabled {
  opacity: 0.72;
}

.area-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.area-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 760;
}

.area-checkbox input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
}

.area-checkbox span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.user-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .report-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .area-nav {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

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

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

  .staff-head,
  .checklist-head {
    display: none;
  }

  .staff-row,
  .checklist-row {
    grid-template-columns: 1fr;
  }

  .staff-row > * {
    min-width: 0;
  }

  .checklist-row > div {
    padding: 10px 12px;
  }

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

@media (max-width: 560px) {
  .topbar-actions,
  .meta-grid,
  .cash-header,
  .cash-summary,
  .cash-grid,
  .staff-summary,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .work-panel,
  .report-panel,
  .side-panel {
    border-radius: 0;
  }

  .area-header,
  .evidence-header,
  .report-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-header {
    grid-template-columns: 1fr;
  }

  .staff-actions {
    justify-content: stretch;
  }

  .staff-actions .button {
    flex: 1 1 150px;
  }

  .area-score {
    justify-items: start;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  body {
    background: white;
    color: #111;
  }

  .screen-only {
    display: none !important;
  }

  .print-report {
    display: block;
    font-family: Arial, sans-serif;
  }

  .print-cover {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 3px solid #111;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .print-logo {
    display: block;
    width: 110px;
    max-height: 72px;
    object-fit: contain;
  }

  .print-cover h1 {
    font-size: 26px;
    margin: 0 0 5px;
  }

  .print-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
  }

  .print-meta div,
  .print-kpi div {
    border: 1px solid #ccc;
    padding: 8px;
  }

  .print-meta span,
  .print-kpi span {
    display: block;
    color: #555;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .print-meta strong,
  .print-kpi strong {
    display: block;
    margin-top: 3px;
    font-size: 14px;
  }

  .print-kpi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .print-report h2 {
    font-size: 17px;
    margin: 18px 0 8px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #ccc;
    padding: 6px;
    vertical-align: top;
    text-align: left;
    font-size: 11px;
  }

  .print-table th {
    background: #efefef;
  }

  .print-area {
    break-inside: avoid;
    margin-bottom: 12px;
  }

  .print-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .print-photo {
    break-inside: avoid;
    border: 1px solid #ccc;
    padding: 5px;
  }

  .print-photo img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
  }

  .print-photo small {
    display: block;
    margin-top: 4px;
    color: #444;
    font-size: 10px;
  }
}
