:root {
  --primary: #696cff;
  --primary-soft: rgba(105, 108, 255, 0.12);
  --primary-strong: #5f61e6;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f8fb;
  --border: #e9e9f2;
  --text: #2f2f3b;
  --muted: #6c7293;
  --success: #71dd37;
  --danger: #ff5b5b;
  --warning: #ffc86c;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Public Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
}

body {
  min-height: 100vh;
}

body.auth-page {
  background: linear-gradient(135deg, #f6f7ff 0%, #eef3ff 100%);
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 18px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
  padding: 20px 24px;
  margin-bottom: 26px;
}

.topbar h1, .topbar h2, .topbar h3 {
  margin: 0;
  font-weight: 800;
}

.topbar .title-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.card {
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  background: var(--surface) !important;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04) !important;
}

.stat-card {
  min-height: 170px;
  padding: 18px;
}

.stat-card .label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: clamp(2rem, 2vw, 2.7rem);
  margin-top: 12px;
  font-weight: 800;
  line-height: 1;
}

.stat-card.success .value {
  color: var(--success);
}

.btn {
  border-radius: 12px !important;
  font-weight: 600 !important;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-strong) 100%) !important;
  border: none !important;
}

.btn-primary:hover {
  filter: brightness(1.02);
}

.form-control {
  border-radius: 12px !important;
  border-color: var(--border) !important;
  min-height: 46px;
  padding: 0.9rem 1rem;
}

.form-control:focus {
  border-color: rgba(105, 108, 255, 0.5) !important;
  box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.15) !important;
}

.table thead th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-soft);
}

.table td, .table th {
  vertical-align: middle;
  padding: 1rem 0.9rem;
}

.list-group-item {
  border-color: var(--border) !important;
  border-radius: 12px !important;
  margin-bottom: 10px;
}

.auth-card {
  max-width: 460px;
  margin: 80px auto;
  border-radius: 24px !important;
  border: 1px solid rgba(110, 113, 227, 0.12) !important;
  background: rgba(255,255,255,0.96) !important;
  box-shadow: 0 24px 60px rgba(105, 108, 255, 0.08) !important;
}

.auth-card h2 {
  font-weight: 800;
  color: var(--text);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.alert {
  border-radius: 12px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.badge-soft {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .action-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
