:root {
  --bg: #07100e;
  --bg-soft: #0d1f1b;
  --panel: rgba(13, 31, 27, 0.94);
  --panel-strong: rgba(8, 24, 20, 0.98);
  --line: rgba(118, 214, 177, 0.22);
  --text: #eef8f3;
  --muted: #a7c5b9;
  --primary: #61d6a8;
  --primary-strong: #2fb783;
  --accent: #f2c14e;
  --danger: #ff6b57;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, #07100e 0%, #0d1f1b 48%, #050807 100%);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.home-hero {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.home-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.home-hero h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
}

.home-hero p {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.auth-shell,
.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.auth-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 460px;
  margin: 8vh auto 0;
  padding: 26px;
}

.admin-panel {
  padding: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

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

.admin-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--primary);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.admin-table td {
  color: #dcece6;
  font-size: 0.9rem;
}

.admin-status {
  margin: 0 0 16px;
  color: var(--muted);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 31, 27, 0.98), rgba(6, 18, 16, 0.96));
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand__icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--primary);
  font-size: 1.45rem;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

h3 {
  margin-bottom: 0;
}

.app-nav {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.app-nav__item {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.app-nav__item--active,
.app-nav__item:hover {
  color: var(--primary);
  background: rgba(97, 214, 168, 0.08);
  border-color: var(--line);
}

.sidebar-card,
.status-banner,
.sri-search-panel,
.sri-results-panel,
.sri-detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 18px;
  color: var(--muted);
}

.sidebar-card h3 {
  color: var(--text);
}

.app-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.app-main__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar__actions,
.sri-actions,
.sri-pagination {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.pill:hover:not(:disabled) {
  transform: translateY(-1px);
}

.pill:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pill--primary {
  color: #06110e;
  background: linear-gradient(135deg, var(--primary), #b6f4d7);
}

.pill--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.status-banner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 1.2fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.status-banner p:last-child {
  margin: 0;
  color: var(--muted);
}

.status-banner[data-tone="success"] {
  border-color: rgba(97, 214, 168, 0.55);
}

.status-banner[data-tone="warning"] {
  border-color: rgba(242, 193, 78, 0.6);
}

.status-banner[data-tone="error"] {
  border-color: rgba(255, 107, 87, 0.6);
}

.sri-layout {
  display: grid;
  gap: 18px;
}

.sri-search-panel,
.sri-results-panel,
.sri-detail-panel {
  padding: 20px;
}

.sri-field-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.6fr) minmax(210px, 0.85fr) minmax(96px, 0.35fr);
  gap: 14px;
  align-items: end;
}

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

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

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(97, 214, 168, 0.42);
  border-radius: 8px;
  color: var(--text);
  background: #10261f;
  padding: 10px 12px;
  outline: none;
  color-scheme: dark;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(97, 214, 168, 0.16);
}

select,
.field select,
.sri-form select {
  appearance: auto;
  color: var(--text);
  background-color: #10261f;
  border-color: rgba(97, 214, 168, 0.42);
  color-scheme: dark;
}

select:hover,
.field select:hover,
.sri-form select:hover {
  border-color: var(--primary);
  background-color: #14342a;
}

select:focus,
.field select:focus,
.sri-form select:focus {
  color: var(--text);
  background-color: #10261f;
}

select option,
.field select option,
.sri-form select option {
  color: #eef8f3;
  background-color: #10261f;
}

select option:checked {
  color: #06110e;
  background-color: var(--primary);
}

.field--disabled {
  opacity: 0.55;
}

.field--disabled select {
  cursor: not-allowed;
}

.sri-actions {
  margin-top: 16px;
}

.table-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(97, 214, 168, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.results-note {
  margin: -2px 0 14px;
  max-width: 82ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.sri-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.sri-table th,
.sri-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.sri-table th {
  color: var(--primary);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.sri-table td {
  color: #dcece6;
  font-size: 0.9rem;
}

.sri-table strong {
  color: var(--text);
}

.sri-pagination {
  margin-top: 16px;
  justify-content: flex-end;
}

.pill--small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.sri-detail-panel[hidden] {
  display: none;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
}

.detail-summary span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.detail-summary strong {
  color: var(--text);
}

.detail-table {
  min-width: 1080px;
}

@media (max-width: 920px) {
  .app-dashboard {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-main__top,
  .status-banner,
  .table-card__top {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .sri-field-grid {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .admin-menu,
  .admin-form {
    grid-template-columns: 1fr;
  }

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