:root {
  --ink: #17212b;
  --muted: #64717f;
  --line: #dce3ea;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --nav: #102730;
  --accent: #0b6b77;
  --accent-strong: #064e5a;
  --blue: #315f9f;
  --gold: #b98221;
  --green: #2f7d51;
  --red: #a94c45;
  --shadow: 0 18px 45px rgba(20, 34, 48, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 18px;
  color: #eef8fa;
  background: var(--nav);
}

.brand,
.topbar,
.section-head,
.panel-head,
.actions,
.filter-row,
.form-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 900;
}

.brand span,
.quick-profile small {
  display: block;
  margin-top: 3px;
  color: #a7c0c8;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  color: #edf7f9;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.13);
}

.quick-profile {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 26px;
}

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

h1 {
  max-width: 900px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  font-size: 1.42rem;
}

h3 {
  font-size: 1.02rem;
}

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

.section-head p,
.metric span,
.muted,
.drop-zone small {
  color: var(--muted);
}

.section-head p {
  margin-top: 6px;
}

.actions,
.filter-row,
.form-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button,
.segment,
.small-button,
select,
input,
textarea {
  border-radius: 8px;
}

.primary-button,
.ghost-button,
.icon-button,
.segment,
.small-button {
  min-height: 40px;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 800;
}

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

.ghost-button,
.icon-button,
.segment,
.small-button {
  color: var(--ink);
  background: #fff;
}

.icon-button {
  width: 54px;
  font-weight: 900;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: transparent;
}

.segment.is-active {
  color: #fff;
  background: var(--accent);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

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

.metric,
.panel,
.profile-form,
.entry-form,
.drop-zone,
.matrix-card,
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.metric strong {
  font-size: 2.05rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(290px, 0.7fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.recent-panel {
  margin-top: 16px;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.coverage-item {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

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

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.task-list,
.plain-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-list li,
.plain-list li {
  padding: 12px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f2f7f8;
}

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

.product-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  box-shadow: none;
}

.product-card strong {
  line-height: 1.25;
}

.card-meta,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-form,
.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
  padding: 22px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 400;
}

.span-2 {
  grid-column: 1 / -1;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.record-title {
  display: block;
  max-width: 390px;
  font-weight: 900;
}

.muted {
  font-size: 0.86rem;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 900;
  white-space: nowrap;
}

.tag {
  color: var(--accent-strong);
  background: #dff0f2;
}

.tag.prodep {
  color: #5b3f00;
  background: #f6e6bd;
}

.tag.secihti {
  color: #173f78;
  background: #dbe8fb;
}

.status-pill {
  color: #fff;
}

.status-pill.complete {
  background: var(--green);
}

.status-pill.partial {
  background: var(--gold);
}

.status-pill.missing {
  background: var(--red);
}

.document-layout,
.host-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  margin-top: 22px;
}

.drop-zone {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 280px;
  padding: 28px;
  text-align: center;
  border-style: dashed;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

.doc-list {
  display: grid;
  gap: 10px;
}

.doc-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.doc-actions {
  display: flex;
  align-items: start;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
}

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

.matrix-card {
  padding: 18px;
}

.matrix-card h3,
.host-grid h3 {
  margin-bottom: 12px;
}

.matrix-row {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.matrix-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

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

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

  .sidebar {
    gap: 18px;
  }

  .quick-profile {
    margin-top: 0;
  }

  .dashboard-grid,
  .document-layout,
  .host-grid,
  .matrix-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  main {
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .filter-row,
  .segmented {
    width: 100%;
  }

  .actions > *,
  .filter-row > *,
  .segment {
    flex: 1;
  }

  .metric-grid,
  .profile-form,
  .entry-form,
  .cards-grid {
    grid-template-columns: 1fr;
  }

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

  .coverage-item {
    grid-template-columns: 1fr;
  }
}
