:root {
  --bg: #0e1114;
  --bg-soft: #151a1f;
  --bg-strong: #090c0f;
  --panel: #181d23;
  --panel-soft: #11161b;
  --panel-strong: #0b0f13;

  --ink: #e8edf2;
  --ink-soft: #8b98a5;
  --ink-faint: #65717d;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);

  --accent: #c6a15b;
  --accent-deep: #9f7c3f;
  --accent-wash: rgba(198, 161, 91, 0.12);

  --success: #3f8f6b;
  --warning: #c08a2e;
  --danger: #b14a3f;
  --neutral: #6d7882;

  --shadow: none;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

small {
  display: block;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

code {
  padding: 0.16rem 0.42rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--bg);
}

.auth-card,
.table-card,
.form-card,
.hero-card,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.auth-card {
  width: min(520px, 100%);
  padding: 1.6rem;
  border-top: 2px solid var(--accent);
}

.auth-copy,
.card-head p,
.note-panel p,
.helper-copy,
.brand p {
  color: var(--ink-soft);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  padding: 1.4rem 1.1rem;
  border-right: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
}

.brand {
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  margin: 0.32rem 0 0.4rem;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-kicker,
.eyebrow {
  display: inline-block;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
}

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

.nav-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.2rem;
}

.nav-list a,
button,
.ghost-button {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-list a {
  padding: 0.64rem 0.8rem;
  border-radius: 8px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-weight: 600;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.nav-list a.active {
  background: var(--accent-wash);
  color: var(--ink);
  border-left-color: var(--accent);
}

.logout-form {
  margin-top: 1.2rem;
}

.content {
  padding: 1.3rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.page-header h2,
.hero-card h3,
.card-head h3,
.auth-card h1 {
  margin: 0.3rem 0 0;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-card h1 {
  font-size: 1.8rem;
}

.page-header h2 {
  font-size: 1.32rem;
}

.hero-card h3 {
  font-size: 1.5rem;
  max-width: 820px;
}

.admin-chip {
  min-width: 180px;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  text-align: right;
}

.admin-chip span {
  display: block;
  font-weight: 600;
}

.admin-chip small {
  margin-top: 0.12rem;
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--accent);
  margin-bottom: 1rem;
}

.metric-grid,
.panel-grid,
.info-grid,
.admin-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card {
  padding: 0.9rem 0.95rem;
  background: var(--panel-soft);
}

.metric-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 0.32rem;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.panel-grid {
  grid-template-columns: minmax(320px, 360px) 1fr;
  margin-bottom: 1rem;
}

.table-card,
.form-card {
  padding: 0.95rem;
}

.wide-card {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

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

.stack-form,
.grid-form {
  display: grid;
  gap: 0.72rem;
}

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

.grid-form button {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}

input,
select,
textarea,
button,
.ghost-button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.82rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-deep);
}

textarea {
  resize: vertical;
}

button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.72rem 0.96rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

button {
  background: var(--accent);
  color: #111416;
}

button:hover {
  background: var(--accent-deep);
  color: #f4efe4;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
}

.inline-form,
.filter-grid,
.button-row,
.chip-row,
.stack-actions,
.admin-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-grid {
  width: 100%;
}

.filter-grid > * {
  flex: 1 1 180px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.checkbox-field input {
  width: auto;
}

.scope-field {
  display: grid;
  gap: 0.5rem;
}

.scope-picker {
  display: grid;
  gap: 0.5rem;
  max-height: 280px;
  overflow: auto;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.scope-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.scope-option input {
  width: auto;
  margin-top: 0.15rem;
}

.scope-option span {
  display: grid;
  gap: 0.16rem;
}

.scope-option small {
  color: var(--ink-soft);
  font-weight: 500;
}

.flash {
  margin-bottom: 0.9rem;
  padding: 0.78rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(63, 143, 107, 0.12);
  border-color: rgba(63, 143, 107, 0.25);
  color: #9ed0b8;
}

.flash-danger {
  background: rgba(177, 74, 63, 0.12);
  border-color: rgba(177, 74, 63, 0.25);
  color: #e0a098;
}

.flash-warning {
  background: rgba(192, 138, 46, 0.12);
  border-color: rgba(192, 138, 46, 0.25);
  color: #e1bf7d;
}

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

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

thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  background: var(--panel-soft);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-success {
  background: rgba(63, 143, 107, 0.14);
  color: #95c9b1;
}

.badge-warning {
  background: rgba(192, 138, 46, 0.14);
  color: #dfc081;
}

.badge-danger {
  background: rgba(177, 74, 63, 0.14);
  color: #dda097;
}

.badge-neutral {
  background: rgba(109, 120, 130, 0.16);
  color: #b2bcc5;
}

.note-panel,
.action-stack,
.info-card,
.admin-card {
  padding: 0.82rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.info-card p,
.helper-copy {
  margin: 0;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-card-head,
.stack-actions {
  align-items: center;
  justify-content: space-between;
}

.admin-card h4 {
  margin: 0 0 0.2rem;
}

.danger-copy {
  color: #e0a098;
  font-weight: 600;
}

.bullet-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.section {
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 1100px) {
  .layout,
  .panel-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 720px) {
  .content,
  .sidebar,
  .auth-card {
    padding: 1rem;
  }

  .page-header,
  .hero-card,
  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-chip {
    min-width: 0;
    width: 100%;
    text-align: left;
  }
}
