:root {
  --ink: #172126;
  --muted: #66757c;
  --line: #d8e1e3;
  --soft: #f3f7f7;
  --surface: #ffffff;
  --dark: #132127;
  --accent: #0f766e;
  --accent-dark: #0a5b55;
  --gold: #b88922;
  --danger: #a63a2a;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: var(--dark);
  color: #f8fbfb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #eaf7f5;
  display: grid;
  place-items: center;
}

.brand-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b8c8cc;
  font-size: 0.86rem;
}

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

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-label {
  margin: 0 0 2px;
  padding: 0 13px;
  color: #9fb1b6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #edf5f4;
  text-align: left;
  padding: 0 13px;
  font-weight: 700;
}

.tab:hover,
.tab.active {
  background: rgba(255, 255, 255, 0.12);
}

.tab.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.user-box {
  min-width: 180px;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.user-box span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1rem;
}

.search {
  width: min(390px, 100%);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

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

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

.form .check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  color: var(--ink);
}

.form .check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.message {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #bfe4df;
  border-radius: 8px;
  background: #eaf7f5;
  color: var(--accent-dark);
  font-weight: 700;
}

.message.error {
  border-color: #edc2bb;
  background: #fff1ef;
  color: var(--danger);
}

.message.warning {
  border-color: #f0d58d;
  background: #fff8df;
  color: #7a5600;
}

.install-panel {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.filter-panel {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.filter-panel select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.form,
.list-panel,
.cart-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(25, 44, 48, 0.1);
}

.form {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.form textarea {
  min-height: 86px;
  resize: vertical;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.primary,
.secondary,
.danger,
.small {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 12px;
  font-weight: 800;
}

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

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

.secondary,
.small {
  background: #eef3f3;
  border-color: var(--line);
  color: var(--ink);
}

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

.small {
  min-height: 32px;
  white-space: nowrap;
}

.small.delete {
  color: var(--danger);
  background: #fff;
}

.cart-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.cart-head p,
.cart-empty,
.cart-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.cart-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.cart-select select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.cart-item strong,
.cart-item span,
.cart-item a {
  display: block;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.cart-item a {
  width: fit-content;
  margin-top: 5px;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.cart-price {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cart-price span {
  color: var(--muted);
  font-weight: 700;
}

.qty-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.qty-controls span {
  min-width: 28px;
  text-align: center;
  color: var(--ink);
  font-weight: 800;
}

.cart-total {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cart-total span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.block {
  display: block;
  margin-top: 5px;
  line-height: 1.35;
}

.tag-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eaf7f5;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.workflow-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  line-height: 1.38;
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-list a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.source-list a:hover {
  text-decoration: underline;
}

.list-panel {
  overflow: hidden;
}

.list-head {
  min-height: 58px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

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

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

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

tbody tr:hover {
  background: #f8fbfb;
}

.row-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.table-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.table-link:hover {
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef3f3;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  background: #e6f6ef;
  color: #11613d;
}

.status-inactive {
  background: #f3eeee;
  color: #8b342b;
}

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

.empty {
  padding: 22px;
  color: var(--muted);
}

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

  .sidebar {
    position: static;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }

  .topbar {
    display: grid;
  }
}

@media (max-width: 620px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .tabs,
  .form-actions,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.55rem;
  }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), transparent 38%),
    linear-gradient(315deg, rgba(184, 137, 34, 0.16), transparent 30%),
    var(--soft);
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
}

.login-brand {
  color: var(--ink);
}

.login-brand span {
  color: var(--muted);
}

.login-form {
  box-shadow: 0 18px 50px rgba(25, 44, 48, 0.16);
}

.login-message {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}
