:root {
  --bg-1: #f3f7ff;
  --bg-2: #eefcf5;
  --card: #ffffff;
  --text: #152238;
  --muted: #66768d;
  --primary: #1668e3;
  --primary-strong: #0f4ead;
  --accent: #0ea978;
  --danger: #d64545;
  --border: #dce5f3;
  --shadow: 0 12px 28px rgba(17, 45, 95, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #d8ebff 0%, transparent 32%),
    radial-gradient(circle at 90% 0%, #d9f7ea 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-1), #f7f9ff 45%, var(--bg-2));
  min-height: 100vh;
}

.navbar {
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(21, 34, 56, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
}

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

.user-chip {
  background: #f1f6ff;
  border: 1px solid #d8e6ff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--primary-strong);
}

.page-container {
  width: min(1200px, 94%);
  margin: 22px auto 44px;
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}

.flash-success {
  background: #e8f9f1;
  border: 1px solid #baefd7;
  color: #0a7f56;
}

.flash-error {
  background: #ffeded;
  border: 1px solid #ffcfcf;
  color: #b92f2f;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
}

.auth-card {
  width: min(460px, 100%);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid #e7edf8;
  padding: 28px;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.7rem;
}

.auth-card p {
  color: var(--muted);
  margin: 8px 0 20px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7caef7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.14);
}

.auth-alt {
  margin-top: 18px;
  font-size: 0.92rem;
}

.auth-alt a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.dashboard-top h1 {
  margin: 0;
}

.dashboard-top p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid #e7edf8;
  box-shadow: var(--shadow);
  padding: 16px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

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

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

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

thead th {
  text-align: left;
  font-size: 0.82rem;
  color: #4f6076;
  font-weight: 700;
  padding: 12px 10px;
  border-bottom: 1px solid #e8eef8;
}

tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2fb;
  font-size: 0.9rem;
}

tbody tr:hover {
  background: #f8fbff;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e9f0ff;
  color: #255cb2;
}

.action-group {
  display: flex;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, #2f7df8, #1668e3);
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 104, 227, 0.25);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid #d6e2f4;
}

.btn-soft {
  background: #eef4ff;
  color: #2c5ca7;
}

.btn-danger {
  background: #ffefef;
  color: var(--danger);
}

.pagination-row {
  margin-top: 12px;
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 32, 0.4);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.hidden {
  display: none;
}

.modal-panel {
  width: min(820px, 100%);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(10, 33, 66, 0.18);
}

.modal-panel.small {
  width: min(420px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-header h3 {
  margin: 0;
}

.close-modal {
  border: 0;
  background: #f1f4f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}

.full-width {
  grid-column: 1 / -1;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: end;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #0f2445;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.error-page {
  min-height: calc(100vh - 160px);
  display: grid;
  place-content: center;
  text-align: center;
}

.error-page h1 {
  font-size: 4rem;
  margin: 0;
}

@media (max-width: 980px) {
  .control-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .dashboard-top {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .navbar {
    height: auto;
    padding: 12px 14px;
    flex-direction: column;
    align-items: start;
    gap: 10px;
  }

  .page-container {
    width: 94%;
  }

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

  .toolbar-row {
    flex-direction: column;
  }

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