:root {
  --brand-primary: #0b3d91;
  --brand-dark: #08296b;
  --brand-light: #eef3fb;
  --sidebar-width: 240px;
}

body {
  background-color: #f4f6f9;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  padding-top: 56px;
}

/* ---------- Top navbar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-primary));
  z-index: 1040;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - 56px);
  background-color: #fff;
  border-right: 1px solid #e3e6ec;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  transition: margin-left 0.25s ease;
}

.sidebar .nav-link {
  color: #344054;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid transparent;
  font-weight: 500;
}

.sidebar .nav-link i {
  width: 22px;
  margin-right: 8px;
}

.sidebar .nav-link:hover {
  background-color: var(--brand-light);
  color: var(--brand-primary);
}

.sidebar .nav-link.active {
  background-color: var(--brand-light);
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    z-index: 1030;
    margin-left: calc(-1 * var(--sidebar-width));
    box-shadow: 2px 0 10px rgba(0,0,0,0.08);
  }
  .sidebar.show {
    margin-left: 0;
  }
}

.content-area {
  min-width: 0;
  padding: 1.5rem;
}

/* ---------- Dashboard cards ---------- */
.stat-card {
  border: none;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  overflow: hidden;
}

.stat-card .icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.stat-card.bg-1 { background: linear-gradient(135deg,#0b3d91,#1d62d6); }
.stat-card.bg-2 { background: linear-gradient(135deg,#0f9d58,#27c98c); }
.stat-card.bg-3 { background: linear-gradient(135deg,#e08e0b,#f4b942); }
.stat-card.bg-4 { background: linear-gradient(135deg,#7b2ff7,#a566ff); }

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
}

/* ---------- Cards / panels ---------- */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #eef0f4;
  font-weight: 600;
  color: var(--brand-dark);
}

.section-title {
  color: var(--brand-dark);
  font-weight: 600;
  border-left: 4px solid var(--brand-primary);
  padding-left: 10px;
  margin-bottom: 1rem;
}

/* ---------- Table ---------- */
.table thead th {
  background-color: var(--brand-light);
  color: var(--brand-dark);
  white-space: nowrap;
  font-weight: 600;
  border-bottom: 2px solid #d7e0f3;
}

.avatar-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #dee2e6;
}

.photo-preview {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px dashed #adb5bd;
  background: #fafafa;
}

/* ---------- Biometric panel ---------- */
.biometric-box {
  border: 1px solid #e3e6ec;
  border-radius: 10px;
  padding: 1.25rem;
  background: #fbfcfe;
}

.device-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.device-status-dot.connected { background-color: #1ec97c; box-shadow: 0 0 6px #1ec97c; }
.device-status-dot.disconnected { background-color: #dc3545; }

.fingerprint-icon {
  font-size: 3rem;
  color: var(--brand-primary);
}

/* ---------- Login page ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary));
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  overflow: hidden;
}

.login-card .card-header {
  background: var(--brand-primary);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.app-footer {
  background: #fff;
  border-top: 1px solid #e3e6ec;
  color: #6c757d;
}

.detail-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dee2e6;
}

@media print {
  .topbar, .sidebar, .app-footer, .no-print { display: none !important; }
  .content-area { padding: 0 !important; }
  body { padding-top: 0 !important; }
}
