/* ── Brand color overrides (teal from logo) ─────────────────────────── */
:root {
  --brand:        #5BA8B5;
  --brand-dark:   #3d8a97;
  --brand-light:  #e8f5f7;
  --brand-rgb:    91, 168, 181;
  --sidebar-width: 240px;

  /* Override Bootstrap primary */
  --bs-primary:         #5BA8B5;
  --bs-primary-rgb:     91, 168, 181;
  --bs-link-color:      #3d8a97;
  --bs-link-hover-color:#2e6e79;
}

/* Re-apply Bootstrap primary classes with brand color */
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline-primary:hover {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.text-primary { color: var(--brand) !important; }
.bg-primary    { background-color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
.badge.bg-primary { background-color: var(--brand) !important; }

/* Form focus ring */
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25);
}

/* ── Layout ─────────────────────────────────────────────────────────── */
body {
  background-color: #f4f7f8;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s ease;
  overflow-x: hidden;
}

/* ── Sidebar brand area ──────────────────────────────────────────────── */
#sidebar .sidebar-brand {
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px rgba(255,255,255,.2) solid;
  background: rgba(0,0,0,.08);
}

#sidebar .sidebar-brand img {
  max-height: 2.8rem;
  width: auto;
  /* Logo is teal on white — invert to white for the dark sidebar */
  filter: brightness(0) invert(1);
}

#sidebar .nav-item .nav-link {
  color: rgba(255, 255, 255, .82);
  padding: .7rem 1.25rem;
  font-size: .855rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}

#sidebar .nav-item .nav-link:hover,
#sidebar .nav-item .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.14);
  border-left-color: rgba(255,255,255,.7);
}

#sidebar .sidebar-heading {
  color: rgba(255,255,255,.45);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1rem;
  text-transform: uppercase;
  padding: 1.1rem 1.25rem .3rem;
}

#sidebar .sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: .75rem 1.25rem;
  border-top: 1px rgba(255,255,255,.15) solid;
}

#sidebar .sidebar-footer a {
  color: rgba(255,255,255,.6);
  font-size: .82rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
}

#sidebar .sidebar-footer a:hover {
  color: #fff;
}

#content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
#topbar {
  height: 4rem;
  background: #fff;
  border-bottom: 1px solid #dde3e7;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: .4rem;
  box-shadow: 0 .1rem 1.2rem 0 rgba(58,80,90,.1);
}

.card-header {
  background-color: #fafcfc;
  border-bottom: 1px solid #e0eaec;
}

/* Stat cards */
.stat-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.table th {
  font-size: .78rem;
  letter-spacing: .05rem;
  text-transform: uppercase;
  color: #7a919a;
  font-weight: 600;
}

/* ── Attendance toggle ───────────────────────────────────────────────── */
.attendance-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid #d0dde1;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.attendance-btn.present {
  background: #1cc88a;
  border-color: #1cc88a;
  color: #fff;
}

.attendance-btn.absent {
  background: #e74a3b;
  border-color: #e74a3b;
  color: #fff;
}

/* ── List filters ────────────────────────────────────────────────────── */
.search-col { max-width: 380px; }

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  #sidebar {
    width: 0;
  }
  #sidebar.show {
    width: var(--sidebar-width);
  }
  #content-wrapper {
    margin-left: 0;
  }
}
