:root {
  --navy: #1F3864;
  --blue: #2E5B8A;
  --light: #D9E6F2;
  --grey: #595959;
  --danger: #B3261E;
  --success: #1E6B3C;
  --warning: #B8860B;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #F4F7FB;
  color: #1a1a1a;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
}

.topbar .brand span { color: var(--light); }

.topbar nav a {
  color: white;
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

.topbar nav a:hover { color: var(--light); text-decoration: none; }

.topbar .user-chip {
  background: rgba(255,255,255,0.12);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-left: 1.25rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--grey);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.card {
  background: white;
  border: 1px solid #E0E6EE;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(31,56,100,0.06);
}

.card h3 {
  margin-top: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 800px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.stat {
  text-align: center;
}
.stat .num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}
.stat .label {
  color: var(--grey);
  font-size: 0.85rem;
}

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

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #E8EDF4;
  font-size: 0.92rem;
}

th {
  background: var(--light);
  color: var(--navy);
  font-weight: 600;
}

tr:hover td { background: #FAFBFD; }

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--navy);
  color: white;
  font-size: 0.92rem;
  cursor: pointer;
}
.btn:hover { background: var(--blue); text-decoration: none; }
.btn-secondary { background: #E8EDF4; color: var(--navy); }
.btn-secondary:hover { background: var(--light); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }

form .field { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.3rem; font-size: 0.88rem; color: var(--grey); font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #E8EDF4;
  color: var(--navy);
}
.badge-success { background: #E3F3E8; color: var(--success); }
.badge-danger { background: #FBE7E5; color: var(--danger); }
.badge-warning { background: #FDF2DB; color: var(--warning); }
.badge-info { background: var(--light); color: var(--blue); }

.flash {
  padding: 0.8rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}
.flash-success { background: #E3F3E8; color: var(--success); border: 1px solid #BFE3CB; }
.flash-danger { background: #FBE7E5; color: var(--danger); border: 1px solid #F3C3BE; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--blue));
}
.auth-card {
  background: white;
  border-radius: 14px;
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.auth-card h1 {
  color: var(--navy);
  font-size: 1.4rem;
  margin-top: 0;
  text-align: center;
}
.auth-card .sub { text-align: center; color: var(--grey); margin-bottom: 1.5rem; font-size: 0.88rem; }
.auth-footer { text-align: center; margin-top: 1rem; font-size: 0.88rem; color: var(--grey); }

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--grey);
}

.table-actions { white-space: nowrap; }
.table-actions form { display: inline; }
