:root {
  color-scheme: light dark;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 260px;
  min-height: 100vh;
  background: #0f172a;
  color: #fff;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.system-status {
  margin-top: auto;
  padding: 0.75rem;
  border: 1px solid #2a3c59;
  border-radius: 5px;
  color: #e2e8f0;
  font-size: 0.62rem;
}

.system-status.healthy {
  border-color: #214a3e;
}

.system-status.warning {
  border-color: #4a2a2a;
}

.brand h2 {
  margin: 0 0 0.25rem;
}

.brand p {
  margin: 0 0 1rem;
  color: #cbd5e1;
}

.nav-link {
  color: #e2e8f0;
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main-content {
  flex: 1;
  padding: 2rem;
}

.main-content.full-width {
  max-width: 960px;
  margin: 0 auto;
}

.card,
.grid > div {
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 0.5rem;
}

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

.button-secondary {
  background: #475569;
}

.button-secondary:hover {
  background: #334155;
}

.nav-section-title {
  display: block;
  margin: 1.1rem 0 0.4rem;
  color: #8190a6;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-link.active {
  background: #1676ed;
  color: #fff;
  box-shadow: 0 5px 14px rgba(22, 118, 237, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #3d8af1;
  border-radius: 7px;
  color: #65a9ff;
}

.brand h2 {
  font-size: 0.95rem;
}

.brand p {
  font-size: 0.58rem;
  line-height: 1.35;
}

.system-status strong,
.system-status span,
.system-status small {
  display: block;
}

.system-status span {
  margin: 0.4rem 0 0.85rem;
  color: #73df9e;
}

.system-status small {
  color: #aebbd0;
}

.system-status small b {
  float: right;
  color: #fff;
}

.system-status i {
  display: block;
  height: 4px;
  margin-top: 0.35rem;
  border-radius: 4px;
  background: #243752;
}

.system-status i b {
  display: block;
  width: 80%;
  height: 100%;
  border-radius: inherit;
  background: #18bd65;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

input,
select,
button {
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

button {
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.error {
  color: #dc2626;
}

.error-alert {
  padding: 1rem 1.25rem;
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(254, 226, 226, 0.35);
  border-radius: 16px;
  margin-bottom: 1rem;
}

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

.page-overline {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--muted);
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
}

.page-tools .button {
  padding: 0.8rem 1.2rem;
}

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

.data-table th,
.data-table td {
  padding: 0.95rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.action-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 840px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    text-align: center;
  }
}
