/* ==========================================================================
   PTC-TMS application styles (on top of Bootstrap 5.3)
   Ethiopian TVET branding: deep green primary, gold accent.
   WCAG 2.1 AA: visible focus rings, reduced-motion support.
   ========================================================================== */

:root {
  --ptc-green: #146c43;
  --ptc-green-dark: #0f5132;
  --ptc-gold: #f0b429;
  --ptc-sidebar-w: 250px;
}

body.portal-body { background: #f4f6f5; font-size: 0.95rem; }

/* ---------------------------- brand badge ------------------------------- */
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 0.6rem; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--ptc-green), var(--ptc-green-dark));
  color: #fff; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.5px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
}
.brand-badge-lg { width: 3.4rem; height: 3.4rem; font-size: 1.15rem; border-radius: 0.9rem; }
.letter-spacing-2 { letter-spacing: 2px; }

/* ------------------------------- sidebar -------------------------------- */
.sidebar {
  width: var(--ptc-sidebar-w); min-width: var(--ptc-sidebar-w);
  min-height: 100vh; background: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: margin-left .2s ease-in-out;
  scrollbar-width: thin;
}
.sidebar-brand { background: #f8faf9; }
.sidebar-heading {
  list-style: none; padding: .9rem 1rem .25rem; margin: 0;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: #8a978f;
}
.sidebar .nav-link {
  color: #2f3b34; border-radius: .5rem; margin: .08rem .5rem;
  padding: .45rem .7rem; font-size: .875rem; display: flex; align-items: center; gap: .55rem;
}
.sidebar .nav-link i { font-size: 1rem; color: var(--ptc-green); width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { background: #eef5f0; color: var(--ptc-green-dark); }
.sidebar .nav-link.active { background: var(--ptc-green); color: #fff; font-weight: 600; }
.sidebar .nav-link.active i { color: var(--ptc-gold); }
.sidebar .badge { font-size: .64rem; }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; z-index: 1045; top: 0; left: 0; height: 100vh;
    margin-left: calc(-1 * var(--ptc-sidebar-w)); box-shadow: 0 0 2rem rgba(0,0,0,.15);
  }
  body.sidebar-open .sidebar { margin-left: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1040; }
}

/* -------------------------------- topbar -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 1030;
  background: #fff; border-bottom: 1px solid #e4e9e6;
  padding: .55rem 1rem;
}
.topbar .dropdown-menu { max-height: 340px; overflow-y: auto; width: 320px; }

/* ------------------------------- KPI cards ------------------------------ */
.kpi-card { border: 0; border-left: 4px solid #adb5bd !important; box-shadow: 0 1px 3px rgba(16,24,20,.06); }
.border-start-primary { border-left-color: #0d6efd !important; }
.border-start-success { border-left-color: var(--ptc-green) !important; }
.border-start-warning { border-left-color: #fd7e14 !important; }
.border-start-info    { border-left-color: #0dcaf0 !important; }
.border-start-danger  { border-left-color: #dc3545 !important; }

/* ------------------------------- avatars -------------------------------- */
.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; flex: 0 0 auto;
  background: var(--ptc-green); color: #fff; font-weight: 700; font-size: .8rem;
}
.avatar-xl { width: 5rem; height: 5rem; font-size: 2rem; }

/* ---------------------------- public site bits --------------------------- */
.college-navbar { background: var(--ptc-green-dark); }
.college-navbar .navbar-brand, .college-navbar .nav-link { color: #f2f7f4; }
.college-navbar .nav-link:hover, .college-navbar .nav-link.active { color: var(--ptc-gold); }
.college-footer { background: #12351f; }
.hero {
  background: linear-gradient(rgba(15, 81, 50, .88), rgba(15, 81, 50, .88)),
              repeating-linear-gradient(45deg, #146c43 0 12px, #0f5132 12px 24px);
  color: #fff; border-radius: 1rem;
}
.hero .btn-warning { background: var(--ptc-gold); border-color: var(--ptc-gold); color: #3d2c00; font-weight: 600; }
.stat-card { border: 0; box-shadow: 0 2px 10px rgba(16,24,20,.08); border-radius: .8rem; }
.stat-card .h3 { color: var(--ptc-green-dark); font-weight: 800; }
.program-card { border: 1px solid #e4e9e6; border-radius: .8rem; transition: transform .15s, box-shadow .15s; height: 100%; }
.program-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1.2rem rgba(16,24,20,.12); }
.program-card .badge-level { background: var(--ptc-gold); color: #3d2c00; font-weight: 700; }

/* -------------------------------- auth ---------------------------------- */
.auth-body { background: linear-gradient(160deg, #e9f3ec 0%, #f4f6f5 55%, #fdf6e3 100%); }
.auth-card { max-width: 440px; margin: 0 auto; border-radius: 1rem; }

/* ------------------------------- tables --------------------------------- */
.table > :not(caption) > * > * { padding: .55rem .7rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; color: #5c6b62; }
.font-monospace { font-size: .82em; }

/* --------------------------- accessibility ------------------------------ */
a:focus-visible, button:focus-visible, .form-control:focus-visible,
.form-select:focus-visible, .btn:focus-visible, .form-check-input:focus-visible {
  outline: 3px solid #6ea8fe; outline-offset: 2px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--ptc-green-dark); color: #fff; padding: .6rem 1rem; border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* -------------------------------- print --------------------------------- */
@media print {
  .sidebar, .topbar, .btn, footer { display: none !important; }
  body.portal-body { background: #fff; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}
