:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #dde3ea;
  --panel: #ffffff;
  --bg: #f5f7f4;
  --brand: #0d6b58;
  --brand-dark: #09483c;
  --gold: #c99128;
  --blue: #2d67b1;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(13, 107, 88, 0.05) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(13, 107, 88, 0.04) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 34px 34px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: 9px 11px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: #10231f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  min-height: 56px;
  margin-bottom: 26px;
}

.brand img {
  width: 46px;
  height: 46px;
}

.brand span {
  display: grid;
  gap: 3px;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.shell {
  margin-left: 260px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 12px;
  box-shadow: 0 8px 30px rgba(24, 33, 47, 0.04);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.kpi,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
}

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

.kpi strong {
  font-size: 28px;
  line-height: 1.1;
}

.kpi small {
  color: var(--brand);
  font-weight: 800;
}

.panel {
  padding: 18px;
}

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

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

.panel-head h2 {
  margin: 0;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.accent-panel {
  background: linear-gradient(145deg, #ffffff, #eef8f5);
}

.metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.metric-line:last-of-type {
  border-bottom: 0;
}

.metric-line span {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td strong,
td small {
  display: block;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

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

.narrow {
  max-width: 820px;
}

.row-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) 130px;
  align-items: center;
  gap: 12px;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece9;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

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

.role-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

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

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: stretch;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(16, 35, 31, 0.94), rgba(13, 107, 88, 0.84)),
    url("logo.svg");
  background-size: cover, 420px;
  background-repeat: no-repeat;
  background-position: center, left 8% bottom 10%;
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: #fff;
}

.login-visual img {
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
}

.login-visual h1 {
  max-width: 760px;
  margin: 0;
  font-size: 50px;
  line-height: 1.02;
}

.login-visual p {
  max-width: 610px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 25px;
}

.login-card button {
  width: 100%;
  margin-top: 4px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.alert {
  border: 1px solid #f6c8c3;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .nav-link {
    flex: 0 0 auto;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

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

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

  .login-page {
    grid-template-columns: 1fr;
  }

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

  .login-visual h1 {
    font-size: 36px;
  }

  .login-card {
    margin: 26px 0;
  }
}

@media (max-width: 620px) {
  .kpis,
  .role-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 24px;
  }

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