:root {
  --ink: #10201a;
  --muted: #627268;
  --line: #dbe6df;
  --paper: #ffffff;
  --soft: #f4f8f2;
  --green-900: #0f3f2e;
  --green-700: #1f6f46;
  --green-500: #4f9c45;
  --gold: #d7a545;
  --teal: #008f7a;
  --blue: #276fbf;
  --red: #c2412d;
  --shadow: 0 20px 50px rgba(16, 32, 26, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 63, 46, 0.94), rgba(28, 94, 55, 0.9) 42%, rgba(215, 165, 69, 0.82)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  color: #fff;
}

.brand-mark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 18px;
  color: var(--green-900);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.brand-mark img {
  height: 48px;
  width: auto;
}

.brand-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-copy p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.7;
}

.brand-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
}

.brand-stat {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  padding: 14px;
  backdrop-filter: blur(10px);
}

.brand-stat strong {
  display: block;
  font-size: 24px;
}

.brand-stat span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

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

.auth-box {
  width: min(100%, 500px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-box h2,
.section-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.auth-box p,
.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mode-tabs,
.data-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.tab-button,
.pill-button {
  cursor: pointer;
  border-radius: 8px;
  background: #ecf4ed;
  color: var(--green-900);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab-button:hover,
.pill-button:hover {
  transform: translateY(-1px);
}

.tab-button.active,
.pill-button.active {
  background: var(--green-900);
  color: #fff;
}

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

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

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(79, 156, 69, 0.14);
}

.field input:disabled {
  background: #f2f5f1;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--green-900), var(--green-500));
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 63, 46, 0.22);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-900);
}

.icon-button {
  background: var(--green-900);
  color: #fff;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.message {
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.45;
}

.message.error {
  border: 1px solid rgba(194, 65, 45, 0.3);
  background: #fff0ed;
  color: var(--red);
}

.message.success {
  border: 1px solid rgba(31, 111, 70, 0.25);
  background: #ebf8ef;
  color: var(--green-900);
}

.app-layout {
  min-height: 100vh;
  background: #f5f8f3;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px clamp(16px, 3vw, 34px);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.topbar-brand img {
  height: 42px;
  width: auto;
}

.topbar-brand strong {
  display: block;
  color: var(--green-900);
}

.topbar-brand span {
  color: var(--muted);
  font-size: 12px;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}

.role-badge,
.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.role-badge {
  background: #fff3cd;
  color: #73510a;
}

.status-badge {
  background: #e8f5e9;
  color: #1b5e20;
}

.status-badge.pending {
  background: #eef4ff;
  color: #1d4f91;
}

.status-badge.other {
  background: #f5edf7;
  color: #6a2c72;
}

.content {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 34px) 42px;
}

.hero-band {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.quick-panel,
.stat-card,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(16, 32, 26, 0.08);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 63, 46, 0.98), rgba(42, 124, 63, 0.92) 58%, rgba(215, 165, 69, 0.9)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: auto, 42px 42px;
  color: #fff;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 46px);
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.hero-metric {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.13);
}

.hero-metric strong {
  display: block;
  font-size: 24px;
}

.hero-metric span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.quick-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.quick-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
}

.quick-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.quick-row strong {
  text-align: right;
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.stat-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #edf7e9;
  color: var(--green-900);
  font-weight: 900;
}

.stat-card:nth-child(2) .stat-icon {
  background: #fff2da;
  color: #8a5b00;
}

.stat-card:nth-child(3) .stat-icon {
  background: #e8f3ff;
  color: #155f9f;
}

.stat-card:nth-child(4) .stat-icon {
  background: #f5edf7;
  color: #6a2c72;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 26px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 170px auto;
  gap: 10px;
  margin: 18px 0;
}

.table-panel {
  overflow: hidden;
}

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

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

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

th {
  background: #f0f6ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdf8;
}

.entity-name {
  color: var(--ink);
  font-weight: 900;
}

.muted-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.clamp.two {
  -webkit-line-clamp: 2;
}

.clamp.three {
  -webkit-line-clamp: 3;
}

.clamp.four {
  -webkit-line-clamp: 4;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .login-layout,
  .hero-band {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 470px;
  }

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

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

@media (max-width: 760px) {
  .brand-panel,
  .login-panel {
    padding: 18px;
  }

  .brand-strip,
  .hero-metrics,
  .stats-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

  .user-block {
    width: 100%;
    justify-content: space-between;
  }

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

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  td {
    border-bottom: 0;
    padding: 8px 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }
}
