:root {
  --primary: #3065B2;
  --text-primary: #214B82;
  --secondary: #7BD3E0;
  --accent: #C5A536;
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --muted: #5C6F8F;
  --border: #D8E2F0;
  --success: #2E9E6E;
  --warning: #DAA300;
  --danger: #C0392B;
  --shadow: 0 8px 30px rgba(33, 75, 130, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
}

h1, h2, h3, h4 {
  margin: 0;
}

p {
  margin: 0 0 8px 0;
}

.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px 0;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 20px 24px 40px;
}

.nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: none;
  background: transparent;
  padding: 12px;
  text-align: left;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(48, 101, 178, 0.07);
}

.nav-item.active {
  background: rgba(48, 101, 178, 0.12);
  border: 1px solid var(--primary);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.context-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #EEF3FB;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.section {
  margin-bottom: 20px;
}

.section h3 {
  margin-bottom: 8px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th, .table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.primary-button, .secondary-button, .ghost-button {
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.primary-button {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.secondary-button {
  background: rgba(123, 211, 224, 0.18);
  color: var(--text-primary);
  border: 1px solid var(--secondary);
}

.ghost-button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.ghost-button.danger {
  color: var(--danger);
  border-color: rgba(192, 57, 43, 0.4);
}

.full {
  width: 100%;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

input, select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #FBFDFF;
}

label {
  font-size: 13px;
  color: var(--muted);
}

.banner {
  margin: 0 24px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--warning);
  background: #FFF8E6;
  color: #7a5a00;
}

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

.list-item {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #FAFCFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active { background: var(--success); }
.status-pending { background: var(--warning); }
.status-danger { background: var(--danger); }

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(123, 211, 224, 0.2);
  border: 1px solid var(--secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
}

.login {
  position: fixed;
  inset: 0;
  background: rgba(33, 75, 130, 0.06);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 90vw);
  padding: 24px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hidden { display: none !important; }

.error-text {
  color: var(--danger);
  min-height: 18px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--text-primary);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: fade-in 0.2s forwards, fade-out 0.2s 3s forwards;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  to { opacity: 0; transform: translateY(6px); }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 1 1 45%;
    text-align: center;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
