:root {
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f766e;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 24%),
    linear-gradient(180deg, #eef4ff 0%, #f8fbff 40%, #f3f7fb 100%);
}

a {
  color: inherit;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto 48px;
}

.admin-header,
.card,
.auth-panel,
.tab-bar {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-header,
.card,
.auth-panel {
  border-radius: var(--radius);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-header h1,
.auth-copy h1,
.card-head h2,
.empty-state h2 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.admin-header p,
.auth-copy p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 62ch;
}

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

.ghost-btn,
.primary-btn,
.btn,
.tab-bar a {
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.ghost-btn,
.tab-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.ghost-btn:hover,
.primary-btn:hover,
.btn:hover,
.tab-bar a:hover {
  transform: translateY(-1px);
}

.tab-bar {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  margin: 18px 0 20px;
  border-radius: 18px;
}

.tab-bar a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.card {
  padding: 22px;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  margin: 0;
  font-size: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
}

.table-wrap {
  overflow: auto;
}

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

thead {
  background: rgba(241, 245, 249, 0.9);
}

th,
td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 56px 28px;
}

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

.auth-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}

.auth-copy {
  padding: 42px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.auth-copy h1 {
  color: #fff;
}

.auth-copy p {
  color: rgba(226, 232, 240, 0.84);
}

.auth-form {
  padding: 42px;
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 700;
  font-size: 14px;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 15px;
  background: #fff;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.primary-btn,
.btn.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.btn.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 16px;
  background: #e2e8f0;
  color: #0f172a;
}

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

.row-actions {
  display: grid;
  gap: 10px;
  min-width: 280px;
}

.row-action-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row-action-form input {
  flex: 1 1 180px;
  min-width: 180px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  outline: none;
}

.row-action-form input:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.row-action-form .btn {
  padding: 12px 16px;
  border-radius: 14px;
}

.badge.success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 8px;
}

.stat-card strong {
  font-size: 40px;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.overview-stack {
  margin-top: 20px;
}

.overview-list {
  display: grid;
  gap: 12px;
  padding: 22px 24px 24px;
}

.overview-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.overview-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.overview-row span,
.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 20px;
  color: #0f172a;
  font-size: 14px;
}

.form-message.error {
  color: #b91c1c;
}

.auth-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 980px) {
  .admin-header,
  .auth-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .admin-header {
    align-items: flex-start;
  }

  .auth-copy,
  .auth-form {
    padding: 28px;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100% - 20px, 1240px);
    margin-top: 18px;
  }

  .admin-header,
  .card,
  .auth-panel {
    border-radius: 18px;
  }

  .tab-bar {
    display: flex;
    width: 100%;
    overflow: auto;
  }

  th,
  td {
    padding: 12px 14px;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .overview-row {
    flex-direction: column;
    align-items: flex-start;
  }
}