:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2433;
  --muted: #627084;
  --border: #d7dde6;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #b42318;
  --warning: #9a6700;
  --ok: #087443;
  --shadow: 0 8px 24px rgba(29, 36, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

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

button.secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

button.secondary:hover {
  background: #eef2f6;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

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

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.login-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-box h1,
.section-title h1 {
  margin: 0;
  font-size: 22px;
}

.login-box p,
.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

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

.sidebar {
  border-right: 1px solid var(--border);
  background: #111827;
  color: #fff;
  padding: 18px;
}

.brand {
  display: grid;
  gap: 2px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand strong {
  font-size: 18px;
}

.brand span,
.user-panel span {
  color: #cbd5e1;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.nav button {
  width: 100%;
  background: transparent;
  border-color: transparent;
  color: #dbe4ef;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.user-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

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

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 96px;
  gap: 8px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f8fafc;
}

td {
  color: var(--text);
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #edf2f7;
  color: var(--muted);
}

.badge.ok {
  background: #e6f4ee;
  color: var(--ok);
}

.badge.warn {
  background: #fff4d6;
  color: var(--warning);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message {
  margin-bottom: 14px;
  border-radius: 6px;
  padding: 10px 12px;
  background: #e6f4ee;
  color: var(--ok);
}

.message.error {
  background: #fee4e2;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
  }

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

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