:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-soft: #1d2230;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #58d68d;
  --accent-soft: rgba(88, 214, 141, 0.16);
  --danger: #ff6b6b;
  --warn: #f7b955;
  --info: #57b4ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-small: 12px;
  --font: "Segoe UI", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(87, 180, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(88, 214, 141, 0.12), transparent 26%),
    linear-gradient(180deg, #0b0e13 0%, #111722 100%);
  color: var(--text);
}

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

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

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  margin-bottom: 24px;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.brand p,
.sidebar-note,
.meta {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.nav a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-small);
  color: var(--muted);
  transition: 0.18s ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.content {
  padding: 28px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-head h2 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

.card {
  background: linear-gradient(180deg, rgba(23, 26, 33, 0.94), rgba(17, 20, 28, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h3,
.card h4 {
  margin-top: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 8px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.pill.ok {
  background: var(--accent-soft);
  color: #d8ffe7;
}

.pill.bad {
  background: rgba(255, 107, 107, 0.14);
  color: #ffd7d7;
}

.pill.warn {
  background: rgba(247, 185, 85, 0.15);
  color: #ffe4b6;
}

.toolbar,
.form-row,
.actions,
.buttons,
.tabbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tabbar {
  margin-bottom: 18px;
}

.summary-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tabbar a {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
}

.tabbar a.active {
  color: var(--text);
  background: rgba(87, 180, 255, 0.18);
}

form {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

button,
.button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  background: var(--panel-soft);
  color: var(--text);
}

button.primary,
.button.primary {
  background: linear-gradient(135deg, #59d48f, #2eb67d);
  color: #07110b;
  font-weight: 700;
}

button.danger,
.button.danger {
  background: rgba(255, 107, 107, 0.16);
  color: #ffd6d6;
}

button.info,
.button.info {
  background: rgba(87, 180, 255, 0.16);
  color: #d8eeff;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  font-size: 1rem;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

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

th {
  color: var(--muted);
  font-weight: 600;
}

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

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.flash.success {
  background: rgba(88, 214, 141, 0.13);
}

.flash.error {
  background: rgba(255, 107, 107, 0.12);
}

.flash.info {
  background: rgba(87, 180, 255, 0.12);
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
}

.two-col {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.3fr 0.9fr;
}

.detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 0.8fr;
}

.detail-shell {
  padding: 22px;
}

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

.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
}

.action-stack {
  gap: 14px;
}

.inline-form {
  display: grid;
  gap: 10px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

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

.kpi-list,
.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
}

.logbox {
  background: #090b10;
  color: #dce6f4;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 420px;
  white-space: pre-wrap;
  overflow: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.93rem;
}

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

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

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.checkbox input {
  width: auto;
}

@media (max-width: 1100px) {
  .layout,
  .detail-grid,
  .two-col,
  .grid.cards-4,
  .grid.cards-3,
  .split-forms {
    grid-template-columns: 1fr;
  }

  .detail-list > div,
  .timeline-head {
    flex-direction: column;
  }

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