:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --ink: #16202a;
  --muted: #637083;
  --line: #d8dee6;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --danger: #b42318;
  --warning: #a15c07;
  --success: #067647;
  --shadow: 0 12px 35px rgba(22, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(360px, 1fr);
  min-height: 100vh;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 7, 0.98) 0 46%, transparent 46%),
    linear-gradient(135deg, #0f766e 0 50%, #2563eb 50% 100%);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.login-panel p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

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

.field label,
.check-group legend {
  color: #344054;
  font-weight: 700;
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--accent-2);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 8px;
  background: #e8edf2;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

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

.btn.blue {
  background: var(--accent-2);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

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

.login-visual {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-board {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
}

.process-lane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.process-lane h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.process-item {
  min-height: 92px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px;
}

.process-item strong {
  display: block;
  margin-bottom: 6px;
}

.process-item span {
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #101828;
  color: #fff;
  padding: 22px 18px;
}

.sidebar .brand {
  margin-bottom: 28px;
}

.sidebar .brand small {
  color: #bac3d0;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: #e4e7ec;
  background: transparent;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.content {
  padding: 22px;
  display: grid;
  gap: 18px;
}

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

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.kpi span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.toolbar .filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

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

th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f5;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.success {
  background: #dcfae6;
  color: var(--success);
}

.badge.warning {
  background: #fef0c7;
  color: var(--warning);
}

.badge.danger {
  background: #fee4e2;
  color: var(--danger);
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel h3 {
  margin: 18px 0 12px;
  font-size: 15px;
  color: #344054;
}

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

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

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

.check-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 9px;
}

.check-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: #344054;
  font-weight: 650;
}

.check-row input {
  margin-top: 3px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

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

.photo-tile {
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  padding: 10px;
}

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

.signature-pad {
  min-height: 86px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fbfcfe;
  color: var(--muted);
  font-weight: 700;
}

.mobile-form {
  max-width: 760px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

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

.report-preview {
  display: grid;
  gap: 12px;
}

.report-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.report-row strong {
  color: #344054;
}

@media (max-width: 1020px) {
  .login-shell,
  .app-shell,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

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

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

  .login-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-panel,
  .content,
  .topbar {
    padding: 16px;
  }

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

  .user-chip {
    text-align: left;
  }

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

  .form-grid,
  .form-grid.two,
  .kpi-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .filters,
  .toolbar input,
  .toolbar select,
  .toolbar .btn {
    width: 100%;
  }

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

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .button-row,
  .nav {
    display: none !important;
  }

  .app-shell,
  .detail-layout {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel {
    border: 0;
    padding: 0;
  }
}

