:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1f2937;
  --muted: #9ca3af;
  --text: #f9fafb;
  --accent: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --border: #374151;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: linear-gradient(145deg, #0b1220, #111827 60%, #0b1220);
  color: var(--text);
}

a {
  color: #93c5fd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(460px, 95vw);
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 12px;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

button,
.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: #475569;
}

.btn.danger {
  background: var(--danger);
}

.btn.success {
  background: var(--success);
}

.btn.sm {
  padding: 6px 10px;
  font-size: 0.84rem;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.92);
  padding: 18px;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}

.brand {
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a,
.nav button {
  text-align: left;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 10px;
  border-radius: 8px;
  color: #e2e8f0;
}

.nav a.active {
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 1px #60a5fa;
}

.main {
  padding: 18px;
}

.card {
  background: rgba(31, 41, 55, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border: 1px solid #334155;
  padding: 8px;
  vertical-align: top;
}

th {
  background: #0f172a;
}

.muted {
  color: var(--muted);
}

.inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hidden {
  display: none !important;
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 8px 0;
  border: 1px solid;
}

.alert.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.6);
}

.alert.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.6);
}

.tt-grid th,
.tt-grid td {
  min-width: 150px;
}

.tt-item {
  background: #1e3a8a;
  border: 1px solid #2563eb;
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
