:root {
  --ink: #0d1620;
  --muted: #66737f;
  --line: #dce5e9;
  --paper: #ffffff;
  --soft: #f4f7f8;
  --soft-strong: #eef4f6;
  --teal: #008f9c;
  --teal-dark: #006a75;
  --teal-soft: #e5f6f8;
  --danger: #b42318;
  --warning: #986400;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(9, 23, 32, 0.08), rgba(255,255,255,0.78)),
    #dce7eb;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button,
input,
textarea,
select {
  font: inherit;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(0,143,156,0.16), transparent 24rem),
    linear-gradient(135deg, #eef5f6, #fff);
}
.login-card {
  width: min(440px, 100%);
  padding: 32px;
  display: grid;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border: 2px solid rgba(11, 24, 32, 0.84);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(13, 22, 32, 0.12);
}
h1,
h2,
legend {
  font-family: Manrope, Inter, sans-serif;
  letter-spacing: 0;
}
.login-card h1,
.workspace-head h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
}
.login-card p,
.workspace-head p {
  margin: 0;
  color: var(--muted);
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  padding: 8px;
  gap: 0;
}
.sidebar {
  position: sticky;
  top: 8px;
  height: calc(100vh - 16px);
  padding: 18px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  color: #dce9ec;
  background:
    repeating-linear-gradient(120deg, transparent 0 28px, rgba(255,255,255,0.04) 29px 30px),
    linear-gradient(160deg, #07131b, #102832);
  border: 2px solid rgba(11, 24, 32, 0.9);
  border-radius: 8px 0 0 8px;
}
.panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}
.panel-brand span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
}
.sidebar nav {
  display: grid;
  align-content: start;
  gap: 6px;
}
.sidebar a,
.ghost {
  padding: 12px 13px;
  color: rgba(255,255,255,0.78);
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}
.sidebar a.active,
.sidebar a:hover,
.ghost:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.workspace {
  width: 100%;
  padding: 0;
  background: #f5f8f9;
  border: 2px solid rgba(11, 24, 32, 0.9);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}
.workspace-head {
  margin: 0;
  padding: 24px 30px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.notice {
  margin: 18px 24px 0;
  padding: 13px 15px;
  color: #073f46;
  background: #dff5f7;
  border: 1px solid #bce9ed;
  border-radius: 7px;
  font-weight: 800;
}
.stats-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stats-grid article,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 35px rgba(13, 22, 32, 0.05);
}
.stats-grid article {
  padding: 22px;
}
.stats-grid strong {
  display: block;
  font: 900 30px/1 Manrope, sans-serif;
}
.stats-grid span,
.feature-list span {
  color: var(--muted);
  font-weight: 700;
}
.panel {
  margin: 20px 24px;
  padding: 22px;
  border-radius: 8px;
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-title h2 {
  margin: 0;
}
.panel-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.create-panel {
  background:
    linear-gradient(180deg, rgba(229, 246, 248, 0.38), rgba(255,255,255,0) 54px),
    #fff;
}
.create-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.create-summary::-webkit-details-marker {
  display: none;
}
.create-summary::after {
  content: "+";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 7px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.create-panel[open] .create-summary::after {
  content: "-";
}
.create-summary span {
  display: grid;
  gap: 4px;
}
.create-summary strong {
  font: 900 20px/1.15 Manrope, Inter, sans-serif;
}
.create-summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.create-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.view-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--teal-dark);
  background: #e5f6f8;
  border: 1px solid #bce9ed;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.view-link:hover {
  color: #fff;
  background: var(--teal);
}
.feature-list {
  display: grid;
  gap: 10px;
}
.records-grid {
  margin: 20px 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.records-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}
.record-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(13, 22, 32, 0.05);
}
.record-card[open] {
  grid-column: 1 / -1;
  border-color: rgba(0, 143, 156, 0.34);
  box-shadow: 0 20px 50px rgba(13, 22, 32, 0.08);
}
.record-card summary {
  min-height: 92px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.record-card summary::-webkit-details-marker {
  display: none;
}
.record-summary-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.record-summary-main strong {
  overflow: hidden;
  color: var(--ink);
  font: 900 18px/1.18 Manrope, Inter, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-summary-main small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.record-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.record-body {
  padding: 18px;
  background: var(--soft);
  border-top: 1px solid var(--line);
}
.record-body .form-grid {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.status-badge.active {
  color: #006a48;
  background: #def7ec;
}
.status-badge.draft {
  color: var(--warning);
  background: #fff3cd;
}
label {
  display: grid;
  gap: 7px;
  color: #34424d;
  font-size: 13px;
  font-weight: 900;
}
input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
textarea {
  min-height: 92px;
  resize: vertical;
}
fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
legend {
  padding: 0 8px;
  font-weight: 900;
}
legend .view-link {
  margin-left: 10px;
  vertical-align: middle;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.compact label:has(textarea),
.compact button,
.compact .thumb {
  grid-column: 1 / -1;
}
.check {
  grid-template-columns: 20px 1fr;
  align-items: center;
}
.check input {
  width: 18px;
  min-height: 18px;
}
button {
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border: 0;
  border-radius: 7px;
  font-weight: 900;
  cursor: pointer;
}
.record-body .delete-form {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.delete-form button {
  background: var(--danger);
}
.thumb {
  max-width: 180px;
  max-height: 110px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-radius: 8px 8px 0 0;
  }
  .workspace {
    border-left: 2px solid rgba(11, 24, 32, 0.9);
    border-top: 0;
    border-radius: 0 0 8px 8px;
  }
  .stats-grid,
  .compact {
    grid-template-columns: 1fr;
  }
  .records-grid,
  .records-grid-wide {
    grid-template-columns: 1fr;
  }
  .record-card[open] {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .admin-shell {
    padding: 0;
  }
  .workspace-head,
  .panel,
  .stats-grid,
  .records-grid {
    margin-left: 12px;
    margin-right: 12px;
  }
  .workspace-head {
    padding: 20px 18px;
  }
  .record-card summary {
    grid-template-columns: 1fr;
  }
  .record-summary-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
