/* ══════════════════════════════════════════════════════════════
   public/css/admin.css  —  Don De Dieu School
   Bootstrap-first approach:
   • Overrides Bootstrap CSS variables at :root
   • Uses Bootstrap spacing/sizing scale (rem)
   • Custom rules ONLY for what Bootstrap can't do natively
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── 1. BOOTSTRAP VARIABLE OVERRIDES ────────────────────────── */
:root {
  /* Remap Bootstrap's core palette to school brand */
  --bs-primary:              #0d2144;
  --bs-primary-rgb:          13, 33, 68;
  --bs-secondary:            #e8a020;
  --bs-secondary-rgb:        232, 160, 32;
  --bs-success:              #2e7d32;
  --bs-success-rgb:          46, 125, 50;

  /* Typography */
  --bs-body-font-family:     'DM Sans', sans-serif;
  --bs-body-bg:              #f0f4f8;
  --bs-body-color:           #1a2840;

  /* Cards & borders */
  --bs-border-radius:        0.875rem;
  --bs-border-radius-lg:     0.875rem;
  --bs-border-color:         #e8eef5;
  --bs-card-border-color:    #e8eef5;
  --bs-card-bg:              #fff;
  --bs-card-cap-bg:          #fff;
  --bs-card-cap-padding-y:   1rem;
  --bs-card-cap-padding-x:   1.25rem;

  /* School-specific tokens (used below) */
  --school-navy:             #0d2144;
  --school-navy-mid:         #1a3461;
  --school-gold:             #e8a020;
  --school-gold-light:       #f5c155;
  --school-sidebar-w:        260px;
}

/* ── 2. LAYOUT SHELL ─────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--school-sidebar-w);
  height: 100vh;
  background: linear-gradient(175deg, var(--school-navy) 0%, #0a1c38 100%);
  z-index: 1050;            /* Bootstrap's $zindex-fixed */
  transition: transform .3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#main {
  margin-left: var(--school-sidebar-w);
  min-height: 100vh;
}

/* ── 3. SIDEBAR BRAND ────────────────────────────────────────── */
/* Blade: class="sidebar-brand d-flex align-items-center gap-3 p-3 flex-shrink-0" */
.sidebar-brand {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
  width: 46px;
  height: 46px;
  border: 2px solid var(--school-gold);
  object-fit: cover;
  /* use Bootstrap .rounded-circle in HTML */
}

.brand-text h6 {
  font-family: 'Playfair Display', serif;
  font-size: .82rem;
  line-height: 1.3;
  /* use Bootstrap text-white mb-0 in HTML */
}

.brand-text span {
  color: var(--school-gold-light);
  font-size: .68rem;
}

/* ── 4. SIDEBAR NAVIGATION ───────────────────────────────────── */
/* Blade: <div class="sidebar-nav flex-grow-1 px-3 py-3"> */
.nav-section-label {
  /* also add Bootstrap: text-uppercase fw-semibold px-2 pt-3 pb-1 small */
  color: rgba(255,255,255,.35);
  font-size: .63rem;
  letter-spacing: .12em;
}

.sidebar-link {
  /* Bootstrap base: .d-flex .align-items-center .gap-2 .w-100 .rounded-3 .mb-1 .border-0 .text-start */
  padding: .625rem .75rem;
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  gap: .6875rem;
  width: 100%;
  border: none;
  text-align: left;
  margin-bottom: 2px;
}

.sidebar-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar-link.active {
  background: var(--school-gold);
  color: var(--school-navy);
  font-weight: 600;
}

.sidebar-link.active i { color: var(--school-navy); }

/* ── 5. SIDEBAR BADGE ────────────────────────────────────────── */
/* Bootstrap .badge .rounded-pill, just color override */
.badge-pill {
  margin-left: auto;
  background-color: var(--school-gold) !important;
  color: var(--school-navy) !important;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
}

.sidebar-link.active .badge-pill {
  background-color: var(--school-navy) !important;
  color: var(--school-gold) !important;
}

/* ── 6. SIDEBAR FOOTER ───────────────────────────────────────── */
/* Blade: class="sidebar-footer d-flex align-items-center gap-2 p-3 mt-auto" */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.admin-info span  { color: #fff;                   font-size: .8rem;  font-weight: 500; }
.admin-info small { color: rgba(255,255,255,.45);  font-size: .7rem; }

/* ── 7. TOPBAR ───────────────────────────────────────────────── */
/* Blade: class="topbar bg-white sticky-top border-bottom px-4 py-2 d-flex align-items-center justify-content-between" */
.topbar { z-index: 1040; }

.topbar-left h5 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--school-navy);
  margin: 0;
}

.topbar-left small { color: #94a3b8; font-size: .75rem; }

/* ── 8. SEARCH BOX ───────────────────────────────────────────── */
.search-box { position: relative; width: 220px; }

.search-box input {
  /* extends .form-control */
  border: 1.5px solid var(--bs-border-color);
  border-radius: 30px;
  padding: .4375rem .875rem .4375rem 2.375rem;
  font-size: .82rem;
  background: #f8fafc;
  width: 100%;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}

.search-box input:focus {
  border-color: var(--school-navy);
  background: #fff;
  box-shadow: none;
}

.search-box > i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .85rem;
  pointer-events: none;
}

/* ── 9. ICON BUTTON ──────────────────────────────────────────── */
/* Blade: class="icon-btn btn btn-light rounded-circle" */
.icon-btn {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: .95rem;
  cursor: pointer;
  position: relative;
  transition: background .2s, color .2s;
  text-decoration: none;
  flex-shrink: 0;
}

.icon-btn:hover { background: #e2e8f0; color: #334155; }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── 10. AVATARS ─────────────────────────────────────────────── */
/* Blade: class="avatar-sm rounded-circle" */
.avatar-sm {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--school-navy), var(--school-gold));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  border-radius: 50%;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  background: var(--school-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--school-navy);
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
}

/* ── 11. STAT CARDS ──────────────────────────────────────────── */
/* Blade: class="card stat-card h-100 border" */
.stat-card {
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13,33,68,.08) !important;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card .val {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--school-navy);
  line-height: 1;
}

.stat-card .lbl { color: #64748b; font-size: .78rem; }
.stat-card .chg { font-size: .72rem; font-weight: 600; }
.chg.up { color: var(--bs-success); }
.chg.dn { color: var(--bs-danger,  #dc3545); }

/* ── 12. SECTION TITLE ───────────────────────────────────────── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--school-navy);
  margin: 0;
}

/* ── 13. TABLE OVERRIDES ─────────────────────────────────────── */
/* Blade: class="table table-hover mb-0" */
.table > thead > tr > th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  font-weight: 600;
  border-color: #f1f5f9;
}

.table > tbody > tr > td {
  font-size: .83rem;
  vertical-align: middle;
  border-color: #f8fafc;
}

/* ── 14. STATUS PILLS ────────────────────────────────────────── */
/* Extends Bootstrap .badge */
.status-pill {
  padding: .1875rem .625rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.status-active   { background: #dcfce7; color: #15803d; }
.status-pending  { background: #fef9c3; color: #92400e; }
.status-inactive { background: #fee2e2; color: #b91c1c; }
.status-draft    { background: #f1f5f9; color: #475569; }

/* ── 15. QUICK ACTION BUTTONS ────────────────────────────────── */
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .625rem;
  background: #fff;
  border: 1.5px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  text-decoration: none;
  color: var(--school-navy);
  font-size: .75rem;
  font-weight: 500;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
  cursor: pointer;
  width: 100%;
}

.qa-btn:hover {
  border-color: var(--school-gold);
  background: #fffbf0;
  color: var(--school-navy);
  transform: translateY(-2px);
}

.qa-icon {
  width: 44px;
  height: 44px;
  border-radius: .6875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ── 16. ACTIVITY FEED ───────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child { border-bottom: none; }

.act-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .375rem;
  flex-shrink: 0;
}

.act-text { font-size: .81rem; color: #334155; line-height: 1.5; }
.act-time { font-size: .7rem;  color: #94a3b8; margin-top: .125rem; }

/* ── 17. PROGRESS LABELS ─────────────────────────────────────── */
/* Bootstrap .progress .progress-bar handles the bar itself */
.prog-label {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  margin-bottom: .3125rem;
}

.prog-label span:first-child { color: #475569; font-weight: 500; }
.prog-label span:last-child  { color: var(--school-navy); font-weight: 700; }

/* ── 18. MINI BAR CHART ──────────────────────────────────────── */
.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.mini-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--school-navy);
  opacity: .15;
  transition: opacity .2s;
}

.mini-bar:hover  { opacity: .6; }
.mini-bar.accent { background: var(--school-gold); opacity: .9; }

/* ── 19. WELCOME BANNER ──────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(120deg, var(--school-navy) 0%, var(--school-navy-mid) 60%, #1e4d8c 100%);
  border-radius: var(--bs-border-radius);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(232,160,32,.12);
  pointer-events: none;
}

.welcome-banner::after {
  content: '';
  position: absolute; right: 60px; bottom: -40px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(232,160,32,.08);
  pointer-events: none;
}

.welcome-banner h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
}

.welcome-banner p { color: rgba(255,255,255,.65); }

.welcome-badge {
  background: var(--school-gold);
  color: var(--school-navy);
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .75rem;
  border-radius: 20px;
  display: inline-block;
}

/* ── 20. PAGE HEADER ─────────────────────────────────────────── */
/* Blade: class="page-header d-flex align-items-center justify-content-between mb-4" */
.page-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--school-navy);
}

.page-header p { color: #64748b; font-size: .83rem; margin: .25rem 0 0; }

/* ── 21. BOOTSTRAP COMPONENT TWEAKS ─────────────────────────── */

/* Buttons — map primary/secondary to school colours */
.btn-primary {
  --bs-btn-bg:                  var(--school-navy);
  --bs-btn-border-color:        var(--school-navy);
  --bs-btn-hover-bg:            var(--school-navy-mid);
  --bs-btn-hover-border-color:  var(--school-navy-mid);
  --bs-btn-active-bg:           #0a1c38;
  --bs-btn-active-border-color: #0a1c38;
  --bs-btn-focus-shadow-rgb:    var(--bs-primary-rgb);
}

.btn-secondary {
  --bs-btn-bg:             var(--school-gold);
  --bs-btn-border-color:   var(--school-gold);
  --bs-btn-color:          var(--school-navy);
  --bs-btn-hover-bg:       #d4911c;
  --bs-btn-hover-color:    var(--school-navy);
  --bs-btn-active-bg:      #bf841a;
}

/* Form focus ring */
.form-control:focus,
.form-select:focus {
  border-color: var(--school-navy);
  box-shadow: 0 0 0 .2rem rgba(13,33,68,.15);
}

/* Pagination */
.page-link { color: var(--school-navy); }
.page-item.active .page-link {
  background-color: var(--school-navy);
  border-color:     var(--school-navy);
}

/* Progress */
.progress { border-radius: 99px; }

/* Alerts */
.alert { border-radius: .625rem; }

/* Dropdowns */
.dropdown-menu {
  border-radius: .75rem;
  border-color: var(--bs-border-color);
  font-size: .85rem;
}

/* ── 22. RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar        { transform: translateX(-100%); }
  #sidebar.open   { transform: translateX(0); }
  #main           { margin-left: 0; }
  .search-box     { display: none !important; }
}
