:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e1ea;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --danger: #b42318;
  --ok: #027a48;
  --soft: #e7f5f2;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(245, 247, 250, 0.88), rgba(245, 247, 250, 0.92)),
    url("https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-panel {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow);
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 20px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.85rem;
}

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

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.primary,
.secondary {
  min-height: 42px;
  border-radius: 7px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-strong);
}

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

.secondary:hover {
  border-color: #a9b6c4;
}

.full-width {
  width: 100%;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px 18px;
  background: #101828;
  color: #fff;
}

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

.brand-logo {
  max-width: 150px;
  max-height: 84px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo[src="seedi_logo.png"] {
  min-height: 46px;
}

.sidebar .eyebrow {
  color: #72e3d7;
}

.nav-toggle {
  display: none;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
  text-align: left;
  padding: 10px 12px;
}

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

.nav-item {
  width: 100%;
  min-height: 42px;
  border-radius: 7px;
  padding: 10px 12px;
  background: transparent;
  color: #d0d5dd;
  font-weight: 800;
  text-align: left;
}

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

.content {
  min-width: 0;
  padding: 28px;
}

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

.topbar h1 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact {
  min-width: 170px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(23, 32, 42, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

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

.metric {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

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

.span-two {
  grid-column: span 2;
}

.form-action,
.form-actions {
  align-self: end;
}

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

.form-actions > * {
  flex: 1 1 auto;
}

.table-wrap {
  overflow-x: auto;
  padding: 12px 18px 18px;
}

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

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

th {
  color: #475467;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  font-size: 0.92rem;
}

.summary-list,
.cards {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.summary-item,
.card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.summary-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.summary-item strong,
.card strong {
  overflow-wrap: anywhere;
}

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

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.badge.warn {
  background: #fffaeb;
  color: var(--warn);
}

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

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

.small-btn {
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 9px;
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 900;
}

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

.empty {
  color: var(--muted);
  font-style: italic;
}

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

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto auto;
    gap: 14px;
  }

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

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

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

@media (max-width: 680px) {
  .content {
    padding: 14px;
  }

  .login-view {
    padding: 14px;
  }

  .login-panel {
    padding: 22px;
  }

  .nav,
  .metrics,
  .form-grid,
  .cards,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .shell {
    display: block;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .brand-logo {
    max-width: 76px;
    max-height: 54px;
  }

  .brand .eyebrow {
    grid-column: 2;
    margin: 0;
  }

  .brand h2 {
    grid-column: 2;
    margin: -4px 0 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav,
  .sidebar .full-width {
    display: none;
  }

  .nav-open .nav,
  .nav-open .sidebar .full-width {
    display: grid;
  }

  .nav-item {
    text-align: center;
  }

  .topbar h1 {
    font-size: 1.7rem;
  }

  .panel-head {
    padding: 14px 14px 0;
  }

  .form-grid,
  .summary-list,
  .cards,
  .table-wrap {
    padding: 14px;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .span-two {
    grid-column: auto;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 100%;
  }
}
