:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #697586;
  --line: #dde3ea;
  --sidebar: #121826;
  --sidebar-soft: #20293a;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

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

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

button,
input,
textarea {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f6;
}

.login-shell {
  width: min(100%, 460px);
  padding: 24px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.eyebrow,
.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 6px;
}

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

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  background: white;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.alert {
  border-radius: 10px;
  padding: 12px;
  margin-top: 18px;
  font-size: 14px;
}

.alert.error {
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #fecdca;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  color: #d9e2ef;
  padding: 18px 14px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 18px;
}

.sidebar-brand span {
  display: block;
  color: #9aa8bb;
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

details {
  border-radius: 10px;
}

details[open] {
  background: var(--sidebar-soft);
}

summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 750;
  font-size: 14px;
}

summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px 8px 22px;
  color: #aebbd0;
  font-size: 13px;
  border-radius: 8px;
}

.sidebar-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav a.active {
  color: white;
  background: var(--accent);
}

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

.top-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.top-header h1 {
  margin: 0;
  font-size: 24px;
}

.breadcrumb {
  margin: 0 0 4px;
}

.header-actions,
.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.environment {
  color: #1849a9;
  background: #eff4ff;
}

.healthy,
.neutral {
  color: var(--success);
  background: #ecfdf3;
}

.profile {
  color: #344054;
  font-weight: 750;
}

.ghost-button {
  color: #344054;
  background: white;
  border: 1px solid var(--line);
}

.ghost-button:hover {
  color: var(--text);
  background: #f8fafc;
}

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

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

.kpi-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.kpi-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.kpi-card span,
.kpi-card small {
  color: var(--muted);
}

.kpi-card strong {
  font-size: 26px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 22px;
}

.panel {
  padding: 18px;
}

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

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

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.empty-chart {
  height: 220px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  background: #f8fafc;
}

.bar {
  width: 52px;
  border-radius: 10px 10px 0 0;
  background: #cfd8e3;
}

.bar.short {
  height: 74px;
}

.bar.mid {
  height: 118px;
}

.bar.tall {
  height: 164px;
  background: var(--accent);
}

.status-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 10px;
}

.state-stack {
  display: grid;
  gap: 12px;
}

.loading-row {
  display: grid;
  gap: 8px;
}

.loading-row span {
  height: 12px;
  border-radius: 999px;
  background: #e7edf3;
}

.loading-row span:nth-child(2) {
  width: 78%;
}

.loading-row span:nth-child(3) {
  width: 52%;
}

.toast {
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #067647;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
}

.modal-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfcfe;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.modal-preview p {
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.master-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.wide-field {
  grid-column: span 2;
}

.form-actions,
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions {
  justify-content: flex-start;
}

.search-form {
  min-width: min(100%, 420px);
}

.checkline {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.checkline input {
  width: auto;
}

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

.healthy-text {
  color: var(--success);
}

.table-scroll {
  overflow-x: auto;
}

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

.master-table {
  min-width: 1180px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  font-size: 13px;
}

th {
  color: #475467;
  background: #f8fafc;
}

td input,
td textarea {
  min-width: 150px;
}

td textarea {
  min-width: 220px;
}

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

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar-brand div:not(.brand-mark),
  .sidebar-nav a {
    display: none;
  }

  summary {
    padding: 10px 8px;
    font-size: 12px;
  }

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

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

@media (max-width: 720px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-nav {
    display: none;
  }

  .top-header,
  .panel-header {
    display: grid;
  }

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

  .content {
    padding: 16px;
  }

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

  .wide-field {
    grid-column: auto;
  }

  .search-form {
    min-width: 0;
  }
}

.master-title-block {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.master-title-block h2 {
  margin: 2px 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.master-title-block p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.office-panel {
  border-radius: 10px;
  padding: 20px;
}

.office-panel-header {
  align-items: center;
}

.compact-tools {
  margin-top: -2px;
  margin-bottom: 18px;
}

.pill-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.office-table {
  min-width: 1120px;
}

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

.office-table td {
  vertical-align: top;
  color: #344054;
}

.strong-cell {
  color: var(--text);
  font-weight: 800;
}

.description-cell {
  max-width: 340px;
  min-width: 220px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.right-cell {
  text-align: right;
}

.status-pill,
.sort-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  color: var(--success);
  background: #ecfdf3;
}

.status-pill.muted {
  color: #667085;
  background: #f2f4f7;
}

.sort-chip {
  color: #344054;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.icon-action {
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--accent);
  background: white;
  border: 1px solid #b7e4df;
  font-size: 12px;
  box-shadow: none;
}

.icon-action:hover {
  color: white;
  background: var(--accent);
}

.modal-shell {
  width: min(920px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.modal-shell::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.modal-header,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.modal-header p:not(.section-eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-close {
  align-self: flex-start;
}

.modal-body {
  max-height: min(68vh, 680px);
  overflow-y: auto;
  padding: 20px;
}

.office-modal-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: start;
}

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

.toggle-line {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #344054;
  font-weight: 750;
}

.toggle-line input {
  width: auto;
  height: 16px;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

@media (max-width: 720px) {
  .master-title-block h2 {
    font-size: 24px;
  }

  .office-panel-header,
  .compact-tools,
  .modal-header,
  .modal-actions {
    display: grid;
  }

  .office-modal-form {
    grid-template-columns: 1fr;
  }

  .modal-body {
    max-height: 70vh;
  }
}

.template-modal {
  width: min(1120px, calc(100vw - 32px));
}

.checklist-template-form {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.checklist-template-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

.checklist-items-section {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 16px;
}

.checklist-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.checklist-items-header h4 {
  margin: 0 0 4px;
  font-size: 20px;
}

.checklist-items-header p {
  margin: 0;
  color: var(--muted);
}

.checklist-items-list {
  display: grid;
  gap: 12px;
}

.checklist-item-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(220px, 1fr) minmax(260px, 1.35fr) auto auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 18px 44px 14px 14px;
}

.checklist-item-card .wide-field {
  grid-column: auto;
}

.compact-toggle {
  min-height: 44px;
  white-space: nowrap;
}

.danger-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff1f2;
  color: #e11d48;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.danger-icon:hover {
  background: #e11d48;
  color: white;
}

@media (max-width: 1100px) {
  .checklist-item-card {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .checklist-item-card .wide-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .checklist-template-form,
  .checklist-item-card {
    grid-template-columns: 1fr;
  }

  .checklist-items-header {
    display: grid;
  }
}


.filter-select,
.request-actions select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

.request-list {
  display: grid;
  gap: 14px;
}

.request-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 16px;
}

.request-card-header,
.request-grid,
.request-actions,
.request-actions form {
  display: flex;
  gap: 12px;
}

.request-card-header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 12px;
}

.request-card h3,
.request-card p {
  margin: 0;
}

.request-card h3 {
  margin-top: 2px;
  font-size: 18px;
}

.request-card small {
  color: var(--muted);
  line-height: 1.5;
}

.request-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  margin-top: 14px;
}

.request-grid div {
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.request-grid strong {
  display: block;
  margin-bottom: 6px;
}

.request-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}

.request-actions form:first-child {
  flex: 1 1 420px;
}

.request-actions select {
  min-width: min(100%, 360px);
}

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

@media (max-width: 720px) {
  .request-card-header,
  .request-actions,
  .request-actions form {
    display: grid;
  }

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