:root {
  --brand-1: #1e3a5f;
  --brand-2: #2f6690;
  --brand-accent: #3fa796;
  --bg-soft: #f4f7fb;
  --card-radius: 16px;
  --shadow-soft: 0 6px 24px rgba(30, 58, 95, 0.08);
  --shadow-hover: 0 10px 30px rgba(30, 58, 95, 0.14);

  --clr-available: #1f9d55;
  --clr-assigned: #2f6690;
  --clr-needs-return: #d97706;
  --clr-retired: #9ca3af;
}

* { font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif; }

body {
  background: var(--bg-soft);
  min-height: 100vh;
  color: #1f2937;
}

/* -------------------- Navbar -------------------- */
.app-navbar {
  background: linear-gradient(100deg, var(--brand-1) 0%, var(--brand-2) 100%);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 18px rgba(0,0,0,0.12);
}
.app-navbar .navbar-brand { padding: 0.35rem 0; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: #fff;
}
.brand-text .fw-bold { color: #fff; font-size: 1.02rem; line-height: 1.15; }
.brand-sub { color: rgba(255,255,255,0.65); font-size: 0.72rem; }

.app-navbar .nav-link {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  transition: background .15s ease, color .15s ease;
}
.app-navbar .nav-link:hover { color: #fff; background: rgba(255,255,255,0.10); }
.app-navbar .nav-link.active { color: #fff; background: rgba(255,255,255,0.18); }

/* -------------------- Cards -------------------- */
.app-card {
  background: #fff;
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .2s ease, transform .2s ease;
}
.app-card:hover { box-shadow: var(--shadow-hover); }

.stat-card {
  border-radius: var(--card-radius);
  padding: 1.25rem 1.4rem;
  color: #fff;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  min-height: 118px;
}
.stat-card .stat-icon {
  position: absolute; left: -6px; bottom: -10px;
  font-size: 4.2rem; opacity: 0.18;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.9; margin-top: 0.35rem; }

.bg-grad-blue   { background: linear-gradient(135deg, #2f6690, #1e3a5f); }
.bg-grad-green  { background: linear-gradient(135deg, #34c78f, #1f9d55); }
.bg-grad-amber  { background: linear-gradient(135deg, #f7b955, #d97706); }
.bg-grad-gray   { background: linear-gradient(135deg, #9aa6b2, #6b7280); }
.bg-grad-teal   { background: linear-gradient(135deg, #3fa796, #2c7a70); }

/* -------------------- Section header -------------------- */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.1rem;
}
.section-heading h1, .section-heading h2 {
  font-weight: 800; color: var(--brand-1); margin: 0; font-size: 1.4rem;
}
.section-heading .subtitle { color: #6b7280; font-size: 0.9rem; }

/* -------------------- Badges -------------------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.32rem 0.7rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.status-badge .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.badge-available    { background: rgba(31,157,85,0.12);  color: var(--clr-available); }
.badge-available .dot { background: var(--clr-available); }
.badge-assigned      { background: rgba(47,102,144,0.12); color: var(--clr-assigned); }
.badge-assigned .dot { background: var(--clr-assigned); }
.badge-needs-return   { background: rgba(217,119,6,0.13);  color: var(--clr-needs-return); }
.badge-needs-return .dot { background: var(--clr-needs-return); }
.badge-retired        { background: rgba(107,114,128,0.14); color: var(--clr-retired); }
.badge-retired .dot { background: var(--clr-retired); }

.category-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.65rem; border-radius: 10px;
  background: var(--bg-soft); color: var(--brand-1);
  font-size: 0.82rem; font-weight: 600;
}

/* -------------------- Tables -------------------- */
.table-app {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}
.table-app thead th {
  border-bottom: 2px solid #e9edf3;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
  background: #fbfcfe;
}
.table-app tbody tr { transition: background .12s ease; }
.table-app tbody tr:hover { background: #f7fafd; }
.table-app td { vertical-align: middle; padding-top: 0.85rem; padding-bottom: 0.85rem; }

.table-responsive-card { border-radius: var(--card-radius); overflow: hidden; box-shadow: var(--shadow-soft); background:#fff; }

/* -------------------- Buttons -------------------- */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-2), var(--brand-1));
  border: none; color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(47,102,144,0.30);
}
.btn-brand:hover { color: #fff; filter: brightness(1.07); }
.btn-soft {
  background: #eef3f8; border: none; color: var(--brand-1); font-weight: 600;
}
.btn-soft:hover { background: #e2eaf3; color: var(--brand-1); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e5e9ef; background: #fff; color: #4b5563;
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--brand-1); }

/* -------------------- Forms -------------------- */
.form-label { font-weight: 600; font-size: 0.88rem; color: #374151; }
.form-control, .form-select {
  border-radius: 10px; border-color: #e2e8f0; padding: 0.55rem 0.85rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 0.2rem rgba(47,102,144,0.15);
}

.modal-content { border-radius: 18px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { border-bottom: 1px solid #eef1f5; }
.modal-footer { border-top: 1px solid #eef1f5; }

/* dynamic per-category field groups inside forms */
.category-fields { display: none; }
.category-fields.active { display: block; }

/* -------------------- Empty state -------------------- */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: #9ca3af;
}
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: 0.75rem; opacity: 0.6; }

/* -------------------- Footer -------------------- */
.app-footer { color: #9ca3af; font-size: 0.82rem; }

/* -------------------- Responsive tweaks -------------------- */
@media (max-width: 767.98px) {
  .table-responsive-card table { min-width: 640px; }
  .section-heading h1, .section-heading h2 { font-size: 1.2rem; }
  .stat-card { min-height: 96px; padding: 1rem 1.1rem; }
  .stat-card .stat-value { font-size: 1.6rem; }
}

/* Avatar circle for user names */
.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-accent));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
