:root {
  --ink: #143a63;
  --muted: #143a63;
  --line: #a8dadc;
  --paper: #f9fafc;
  --panel: #f9fafc;
  --forest: #143a63;
  --forest-2: #143a63;
  --mint: #a8dadc;
  --gold: #f0c65f;
  --rose: #c63838;
  --blue: #a8dadc;
  --shadow: 0 18px 48px rgba(20, 58, 99, 0.16);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--gold);
}

.login-visual {
  min-height: 100vh;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel);
  background-size: cover;
  background-position: center;
  color: var(--forest);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: white;
  color: var(--forest);
}

.brand-logo {
  width: 260px;
  height: 158px;
  display: block;
  object-fit: contain;
}

.sidebar .brand-logo,
.topbar .brand-logo {
  width: 148px;
  height: 90px;
}

.login-visual .brand-logo {
  width: min(360px, 72vw);
  height: auto;
}

.login-copy h1 {
  max-width: 740px;
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 620px;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--forest);
}

.login-panel {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 42px;
  background: var(--gold);
}

.login-box {
  width: min(100%, 460px);
  margin: auto;
  color: var(--forest);
}

.login-box h2,
.section-title h2 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: 0;
}

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

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--forest);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

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

.asset-upload img {
  width: 180px;
  height: 90px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.asset-upload.wide img {
  width: min(100%, 340px);
  height: 160px;
  object-fit: cover;
  padding: 0;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(168, 218, 220, 0.55);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--forest);
  color: var(--panel);
  font-weight: 800;
}

.btn:hover {
  background: var(--forest-2);
}

.btn.secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.warn {
  background: var(--gold);
  color: var(--forest);
  border: 1px solid var(--gold);
}

.btn.danger {
  background: var(--rose);
  color: var(--panel);
  border: 1px solid var(--rose);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
}

.btn.icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 16px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--forest);
  text-align: left;
  font-weight: 750;
}

.nav button.active,
.nav button:hover {
  background: var(--panel);
  color: var(--forest);
  box-shadow: 0 1px 0 rgba(20, 58, 99, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(249, 250, 252, 0.94);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.main-content {
  padding: 28px;
  display: grid;
  gap: 28px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 178px;
}

.row-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.row-check {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--forest);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(20, 58, 99, 0.06);
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(20, 58, 99, 0.06);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-body {
  padding: 18px;
}

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

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

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(168, 218, 220, 0.75);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  font-size: 0.92rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 850;
  background: var(--paper);
  color: var(--forest);
  white-space: nowrap;
}

.status.good {
  background: var(--mint);
  color: var(--forest);
}

.status.warn {
  background: var(--gold);
  color: var(--forest);
}

.status.bad {
  background: var(--forest);
  color: var(--panel);
}

.status.info {
  background: var(--mint);
  color: var(--forest);
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(168, 218, 220, 0.75);
}

.split:last-child {
  border-bottom: 0;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 58, 99, 0.62);
}

.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal header h3 {
  margin: 0;
}

.modal form {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.notice {
  border: 1px solid var(--gold);
  background: var(--paper);
  color: var(--forest);
  border-radius: 8px;
  padding: 12px 14px;
}

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

.accordion summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 14px;
  color: var(--forest);
  font-weight: 850;
  cursor: pointer;
}

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

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--mint);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
}

.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 32px;
  }

  .login-panel {
    min-height: auto;
    padding: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 280px;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

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

@media (max-width: 680px) {
  .topbar,
  .main-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .metrics,
  .filters,
  .form-row {
    grid-template-columns: 1fr;
  }

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

  .login-copy h1 {
    font-size: 2.5rem;
  }
}
