:root {
  --brand: #1a4d8f;
  --brand-dark: #123763;
  --brand-light: #e8f0fb;
  --bg: #f4f6f9;
  --card-border: #e5e9f0;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #2a2f3a;
  margin: 0;
}

/* ---------- Auth pages ---------- */
.auth-body {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-wrap { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; margin: 0 auto;
}
.auth-logo.small { width: 42px; height: 42px; font-size: 16px; margin: 0; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11px; opacity: .7; }

.sidebar-nav { flex: 1; padding: 14px 10px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 14.5px;
  transition: background .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar-nav a i { font-size: 17px; width: 20px; text-align: center; }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-name { font-size: 13.5px; font-weight: 600; }
.user-role { font-size: 11px; opacity: .7; }
.logout-link {
  display: block; text-align: center; font-size: 13px;
  color: rgba(255,255,255,.75); text-decoration: none;
  padding: 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15);
}
.logout-link:hover { background: rgba(255,255,255,.08); color: #fff; }

.main-area { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--card-border);
  padding: 16px 28px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--brand-dark); }
.menu-toggle { background: none; border: none; font-size: 22px; color: var(--brand-dark); }

.content { padding: 26px 28px 50px; }

/* ---------- Cards / stats ---------- */
.stat-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 12px;
  padding: 20px; display: flex; align-items: center; gap: 16px;
  height: 100%;
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--brand-dark); line-height: 1; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

.panel {
  background: #fff; border: 1px solid var(--card-border); border-radius: 12px;
  padding: 22px;
}
.panel-title { font-size: 15.5px; font-weight: 700; color: var(--brand-dark); margin-bottom: 16px; }

/* ---------- Tables ---------- */
.table thead th {
  background: var(--brand-light); color: var(--brand-dark);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px;
  border-bottom: none; font-weight: 700;
}
.table td { vertical-align: middle; font-size: 14px; }
.table-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 6px 6px 0; }

.badge-status { font-size: 11.5px; padding: 5px 10px; border-radius: 20px; font-weight: 600; }
.badge-available { background: #e6f7ee; color: #1a7d4b; }
.badge-assigned { background: #e8f0fb; color: #1a4d8f; }
.badge-maintenance { background: #fff4e0; color: #a6650b; }
.badge-retired { background: #fbe9e9; color: #b23434; }
.badge-active { background: #e6f7ee; color: #1a7d4b; }
.badge-inactive { background: #f1f2f4; color: #6b7280; }
.badge-admin { background: #f3e8fb; color: #7a2ba6; }
.badge-assistant { background: #e8f0fb; color: #1a4d8f; }

.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.filter-bar { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .main-area { margin-left: 0; }
}
