/* =====================================================================
   UniHRMS — brand theme layer over Tabler  |  scheme: Navy Blue
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --brand:              #0f766e;   /* blue-700 */
  --brand-dark:         #115e59;   /* blue-800 (hover / active) */
  --brand-2:            #10b981;   /* sky-500  (accent) */
  --brand-soft:         rgba(15,118,110,.08);
  --tblr-primary:       #0f766e;
  --tblr-primary-rgb:   15,118,110;
  --tblr-font-sans-serif:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;

  /* Sidebar — neutral dark navy, blue accent only on active/hover */
  --sb-bg:          #0c1a2e;   /* deep navy, not saturated blue */
  --sb-border:      #172540;   /* subtle separator */
  --sb-text:        #ffffff;   /* sub-menu items — white */
  --sb-section:     #9fb4d2;   /* section/menu headers — slightly lighter slate */
  --sb-hover-bg:    rgba(15,118,110,.14);
  --sb-active-from: #0f766e;   /* blue-700 */
  --sb-active-to:   #3b82f6;   /* blue-500 */

  /* Cards */
  --card-border:    #dde3f0;
  --card-radius:    14px;
  --card-shadow:    0 1px 4px rgba(10,24,56,.06);
  --card-shadow-md: 0 4px 16px rgba(10,24,56,.10);

  /* Text */
  --text-muted: #52607a;
}

body { font-family: var(--tblr-font-sans-serif); }

/* ================================================================
   BUTTONS & LINKS
   ================================================================ */
.btn-primary {
  --tblr-btn-bg:                var(--brand);
  --tblr-btn-border-color:      var(--brand);
  --tblr-btn-hover-bg:          var(--brand-dark);
  --tblr-btn-hover-border-color:var(--brand-dark);
  --tblr-btn-active-bg:         var(--brand-dark);
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn-primary:hover  { box-shadow: 0 4px 12px rgba(15,118,110,.30); }
.btn-primary:active { transform: translateY(1px); }

.btn-outline-primary {
  --tblr-btn-color:              var(--brand);
  --tblr-btn-border-color:       var(--brand);
  --tblr-btn-hover-bg:           var(--brand);
  --tblr-btn-hover-border-color: var(--brand);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn-outline-primary:hover { box-shadow: 0 3px 10px rgba(15,118,110,.20); }

.btn { transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }

a            { color: var(--brand); }
.text-primary{ color: var(--brand) !important; }
.page-link   { color: var(--brand); }

/* ================================================================
   SIDEBAR
   ================================================================ */
.navbar-vertical {
  background:   var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  width: 15rem;
}
.navbar-vertical .navbar-nav .nav-link {
  color:         var(--sb-text);
  border-radius: 9px;
  margin:        1px .5rem;
  padding:       .46rem .75rem;
  transition:    background .18s ease, color .18s ease;
}
.navbar-vertical .navbar-nav .nav-link:hover {
  color:      #fff;
  background: var(--sb-hover-bg);
}
.navbar-vertical .navbar-nav .nav-item.active > .nav-link {
  color:      #fff;
  background: linear-gradient(135deg, var(--sb-active-from), var(--sb-active-to));
  box-shadow: 0 4px 14px rgba(15,118,110,.38);
}
.navbar-vertical .nav-link-icon { color: inherit; opacity: .9; }
.nav-link.disabled { opacity: .42; }

/* Section labels */
.nav-section {
  padding:       1rem .9rem .3rem;
  font-size:     .68rem;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:         var(--sb-section);
  font-weight:   700;
  cursor:        pointer;
  user-select:   none;
}
.nav-section span { display: flex; align-items: center; }
.section-chevron  { margin-left: auto; opacity: .55; transition: transform .22s ease; font-style: normal; }

.badge-soon {
  background: rgba(147,168,200,.14);
  color:      #93a8c8;
  font-weight:600;
  font-size:  .6rem;
}

/* ================================================================
   BRAND MARK
   ================================================================ */
.brand-badge {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-grid; place-items: center;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.brand-word   { font-weight: 800; letter-spacing: -.3px; color: #fff; }
.brand-avatar {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color:      #fff;
  font-weight:700;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.navbar.d-print-none {
  border-bottom: 1px solid #dde3f0;
  box-shadow:    0 1px 6px rgba(10,24,56,.05);
}

/* ================================================================
   PAGE LAYOUT
   ================================================================ */
.page-body { background: #f1f5fb; }

/* ================================================================
   PAGE TITLE & HEADINGS
   ================================================================ */
.page-title-top { font-weight: 700; letter-spacing: -.4px; font-size: 1.15rem; }
h2.page-title   { font-size: 1.15rem; font-weight: 700; letter-spacing: -.35px; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  border:        1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow:    var(--card-shadow);
  transition:    box-shadow .2s ease;
}
.card .card-header {
  border-bottom: 1px solid #eaeff8;
  font-weight:   600;
  padding:       .85rem 1.15rem;
}
.card .card-title { font-size: .9rem; font-weight: 600; letter-spacing: -.1px; }

/* Clickable card-link hover lift */
a.card.card-link { transition: box-shadow .2s ease, transform .2s ease; text-decoration: none; }
a.card.card-link:hover { box-shadow: var(--card-shadow-md); transform: translateY(-2px); }

/* ================================================================
   KPI TILES
   ================================================================ */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; font-size: 23px;
  flex-shrink: 0;
}
.kpi .kpi-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; }
.kpi .kpi-label { color: var(--text-muted); font-size: .80rem; font-weight: 500; margin-top: 2px; }

.bg-brand-soft {
  background: linear-gradient(135deg, rgba(15,118,110,.09), rgba(14,165,233,.07));
}

/* ================================================================
   TABLES
   ================================================================ */
.table thead th {
  text-transform: uppercase;
  font-size:      .70rem;
  letter-spacing: .07em;
  color:          #3a4f6e;    /* contrast ~6.8:1 on white — WCAG AA ✓ */
  font-weight:    700;
  border-bottom-width: 1px;
}
.table > tbody > tr          { transition: background .12s ease; }
.table-vcenter > tbody > tr:hover td { background: rgba(15,118,110,.035); }

/* ================================================================
   LIST-GROUP
   ================================================================ */
.list-group-item              { transition: background .12s ease; }
.list-group-item-action:hover { background: rgba(15,118,110,.05); }

/* ================================================================
   FORMS
   ================================================================ */
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow:   0 0 0 .2rem rgba(15,118,110,.16);
}
.form-label { font-size: .85rem; font-weight: 500; color: #273550; }
.form-label.required::after { content: " *"; color: #dc2626; }

/* ================================================================
   BADGES — readable contrast
   ================================================================ */
.badge.bg-purple-lt { background: rgba(109,86,252,.11) !important; color: #4a34b8 !important; }
.badge.bg-azure-lt  { background: rgba(14,165,233,.13)  !important; color: #0369a1 !important; }
.badge.bg-green-lt  { background: rgba(22,163,74,.12)   !important; color: #15622c !important; }
.badge.bg-red-lt    { background: rgba(220,38,38,.11)   !important; color: #991b1b !important; }
.badge.bg-yellow-lt { background: rgba(202,138,4,.14)   !important; color: #713f12 !important; }
.badge.bg-blue-lt   { background: rgba(15,118,110,.11)   !important; color: #1e3a8a !important; }
.badge.bg-teal-lt   { background: rgba(13,148,136,.11)  !important; color: #115e59 !important; }
.badge.bg-primary   { background: var(--brand) !important; color: #fff !important; }

/* ================================================================
   SECONDARY TEXT — contrast-safe
   ================================================================ */
.text-secondary { color: var(--text-muted) !important; }
small.text-secondary, .small.text-secondary { color: #52607a !important; }

/* ================================================================
   BACK BUTTON
   ================================================================ */
.btn-back {
  background:   #fff;
  border-color: #c6d2e8;
  color:        #253350;
  font-weight:  600;
  border-radius:8px;
  transition:   background .15s, border-color .15s;
}
.btn-back:hover { background: #ebf0fc; border-color: #9ab0d8; color: #0f2040; }
.btn-back .ti   { font-size: 1rem; vertical-align: -2px; }

/* ================================================================
   WELCOME BANNER
   ================================================================ */
.welcome-banner {
  background:    linear-gradient(135deg, rgba(15,118,110,.10) 0%, rgba(14,165,233,.07) 100%);
  border:        1px solid rgba(15,118,110,.16);
  border-radius: var(--card-radius);
  padding:       1.25rem 1.5rem;
}
.welcome-banner h2 { font-weight: 700; font-size: 1.2rem; letter-spacing: -.3px; margin-bottom: .25rem; }

/* ================================================================
   STAT PILLS
   ================================================================ */
.stat-pill {
  display:        inline-flex;
  align-items:    center;
  gap:            .5rem;
  background:     rgba(255,255,255,.82);
  border:         1px solid rgba(15,118,110,.16);
  border-radius:  50rem;
  padding:        .35rem .85rem;
  font-size:      .82rem;
  font-weight:    600;
  color:          #1a2f50;
  backdrop-filter:blur(4px);
}
.stat-pill .ti { font-size: 1rem; }

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-soft { background: var(--brand-soft); border-radius: var(--card-radius); }
.empty-state {
  text-align:   center;
  padding:      2.5rem 1rem;
  color:        var(--text-muted);
}
.empty-state .ti { font-size: 2.5rem; opacity: .30; display: block; margin-bottom: .75rem; }

/* ================================================================
   MISC UTILITIES
   ================================================================ */
[x-cloak] { display: none !important; }

/* ---- Avatar photo upload widget ---- */
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.avatar-upload-wrap:hover .avatar-upload-overlay { opacity: 1; }

.section-heading {
  font-size:      .72rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color:          #3a4f6e;
  margin:         0 0 .6rem;
}

/* ================================================================
   AUTH SCREEN
   ================================================================ */
.auth-bg {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(15,118,110,.28), transparent 60%),
    radial-gradient(800px 500px at 0% 10%, rgba(14,165,233,.18), transparent 55%),
    #060e1c;
}
.auth-card {
  border:       1px solid #172540;
  border-radius:20px;
  background:   #0c1a2e;
  color:        #d0dcf0;
  box-shadow:   0 30px 60px rgba(0,0,0,.50);
}
.auth-card .form-label { color: #93a8c8; }
.auth-card .form-control { background: #08111e; border-color: #1e3254; color: #d0dcf0; }
.auth-card .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15,118,110,.28); }

.auth-logo {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800;
  font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 30px rgba(15,118,110,.45);
}
.auth-title { font-weight: 800; letter-spacing: -.5px; }
.auth-sub   { color: #93a8c8; }

/* Auth split-screen (login) */
.auth-split { position: fixed; inset: 0; display: flex; overflow: auto; background: #eef2fb; }

.auth-hero {
  position: relative; flex: 1 1 52%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 3.2rem 3.6rem; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 48%, #10b981 130%);
}
.auth-hero::before {
  content: ""; position: absolute; width: 560px; height: 560px;
  right: -160px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,.20), transparent 62%);
}
.auth-hero::after {
  content: ""; position: absolute; width: 420px; height: 420px;
  left: -140px; bottom: -160px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(6,14,28,.45), transparent 60%);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 520px; margin: auto 0; }
.auth-hero .brand-row { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.3px; }
.auth-hero .brand-row .auth-logo { width: 44px; height: 44px; font-size: 20px; background: rgba(255,255,255,.18); color: #fff; box-shadow: none; backdrop-filter: blur(4px); }
.auth-hero h1 { font-weight: 800; font-size: 2.35rem; line-height: 1.12; letter-spacing: -1px; margin: 2.4rem 0 1rem; }
.auth-hero .lead { color: rgba(255,255,255,.88); font-size: 1.02rem; max-width: 440px; margin-bottom: 2.2rem; }

.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .95rem; }
.auth-points li { display: flex; align-items: flex-start; gap: .8rem; color: rgba(255,255,255,.94); font-size: .96rem; }
.auth-points .pt-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 18px; }
.auth-points small { display: block; color: rgba(255,255,255,.60); font-weight: 400; }
.auth-hero-foot { position: relative; z-index: 1; color: rgba(255,255,255,.55); font-size: .82rem; }

.auth-pane {
  flex: 1 1 48%; display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(180deg, #f4f7fe 0%, #eef2fb 100%);
}
.auth-pane .auth-card { width: 100%; max-width: 412px; }
.auth-card .input-icon-addon.end { left: auto; right: 0; }

.auth-split .auth-card {
  background:  #fff;
  border:      1px solid #cdd8f0;
  color:       #111f3c;
  box-shadow:  0 20px 50px rgba(10,24,56,.12);
}
.auth-split .auth-card h1,
.auth-split .auth-card h2,
.auth-split .auth-card .auth-title { color: #111f3c !important; }
.auth-split .auth-card .form-label  { color: #273550; }
.auth-split .auth-card .form-control { background: #fff; border-color: #c6d2e8; color: #111f3c; }
.auth-split .auth-card .form-control::placeholder { color: #8ea5c5; }
.auth-split .auth-card .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15,118,110,.16); }
.auth-split .auth-card .input-icon-addon { color: #7a96c0; }
.auth-split .auth-card .auth-sub  { color: #52607a; }
.auth-split .auth-card .auth-logo { box-shadow: 0 8px 22px rgba(15,118,110,.28); }

/* ================================================================
   RESPONSIVE — mobile sidebar drawer
   ================================================================ */
@media (max-width: 991.98px) {
  .auth-split  { position: static; min-height: 100vh; }
  .auth-hero   { display: none; }
  .auth-pane   { flex: 1 1 100%; min-height: 100vh; }

  .navbar-vertical {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 16rem; max-width: 84vw; z-index: 1050;
    overflow-y: auto;
    transform:  translateX(-100%);
    transition: transform .25s ease;
  }
  .navbar-vertical.sidebar-show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.55); }
  .navbar-vertical .navbar-toggler { display: none; }
  .navbar-vertical #sidebar-menu  { display: block !important; }
  .page-wrapper   { margin-left: 0 !important; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(4,10,24,.55); z-index: 1040; }
  body.sidebar-open { overflow: hidden; }
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  .navbar-vertical, .navbar.d-print-none, .footer, .d-print-none { display: none !important; }
  .page-wrapper { margin: 0 !important; }
  .page-body    { padding: 0 !important; background: #fff !important; }
  body, .page, .page-body { background: #fff !important; }
  .card  { border: none !important; box-shadow: none !important; }
  .table thead th { color: #000 !important; }
  a[href]:after   { content: none !important; }
}

/* ===== Sidebar tools: filter · pinned · recent · mini mode (July 2026) ===== */
.sb-filter { padding: .35rem .75rem .1rem; }
.sb-filter input {
  background: #12233d; border: 1px solid var(--sb-border); color: #fff;
  border-radius: 8px; width: 100%; padding: .35rem .65rem; font-size: .8rem; outline: none;
}
.sb-filter input:focus { border-color: #3b82f6; }
.sb-filter input::placeholder { color: #7a8aa3; }

.navbar-vertical .sb-pin {
  margin-left: auto; opacity: 0; cursor: pointer; color: #8aa2c8;
  font-size: .8rem; padding: 0 .1rem; transition: opacity .12s;
}
.navbar-vertical .nav-link:hover .sb-pin { opacity: .85; }
.navbar-vertical .sb-pin.on { opacity: .95 !important; color: #ffd24a; }

/* while filtering: force every item visible, then JS hides non-matches */
aside.sb-filtering .navbar-nav li.nav-item { display: block !important; }
aside.sb-filtering .navbar-nav li.nav-item.sb-fhide { display: none !important; }
aside.sb-filtering .nav-section .section-chevron { display: none; }

/* dynamic Pinned / Recent groups (outside the accordion) */
.navbar-vertical .nav-section.sb-dyn { cursor: default; }
.navbar-vertical .nav-section.sb-dyn .ti { margin-right: .35rem; }

/* mini (icon-rail) mode — desktop only */
/* sticky sidebar header: brand + collapse toggle + filter stay on top
   while the menu scrolls beneath them */
.sb-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--sb-bg);
  padding: .55rem 0 .3rem;
  border-bottom: 1px solid var(--sb-border);
}
.sb-head-row { display: flex; align-items: center; padding: 0 .75rem; }
.sb-mini-toggle {
  display: none; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; margin-left: auto; border-radius: 7px;
  color: #8aa2c8; font-size: 1rem; cursor: pointer; user-select: none;
}
.sb-mini-toggle:hover { color: #fff; background: var(--sb-hover-bg); }
@media (min-width: 992px) {
  .sb-mini-toggle { display: flex; }
  body.sb-mini .sb-head-row { flex-direction: column; gap: .3rem; padding: 0; }
  body.sb-mini .sb-mini-toggle { margin-left: 0; }
  body.sb-mini .navbar-vertical { width: 4.25rem; }
  body.sb-mini .page-wrapper,
  body.sb-mini .navbar-vertical.navbar-expand-lg ~ .page-wrapper { margin-left: 4.25rem !important; }
  body.sb-mini .navbar-vertical .nav-link-title,
  body.sb-mini .navbar-vertical .brand-word,
  body.sb-mini .navbar-vertical .sb-filter,
  body.sb-mini .navbar-vertical .sb-pin,
  body.sb-mini .navbar-vertical .nav-link .badge { display: none !important; }
  body.sb-mini .navbar-vertical li.nav-item { display: block !important; }
  /* each link becomes a fixed square, centred in the rail — the active
     gradient box then sits symmetrically instead of hugging the left */
  body.sb-mini .navbar-vertical .nav-link {
    width: 2.9rem; height: 2.5rem; margin: 2px auto; padding: 0;
    display: flex; align-items: center; justify-content: center;
  }
  body.sb-mini .navbar-vertical .nav-link-icon { margin: 0; width: auto; }
  /* no horizontal scrollbar in the rail */
  body.sb-mini .navbar-vertical,
  body.sb-mini .navbar-vertical .navbar-collapse,
  body.sb-mini .navbar-vertical #sidebar-menu,
  body.sb-mini .navbar-vertical ul.navbar-nav { overflow-x: hidden !important; }
  /* hide the vertical scrollbar track too (wheel/touch scrolling still works) —
     its ~15px gutter was squeezing the icons and the active box off-centre */
  body.sb-mini .navbar-vertical,
  body.sb-mini .navbar-vertical .navbar-collapse,
  body.sb-mini .navbar-vertical #sidebar-menu,
  body.sb-mini .navbar-vertical ul.navbar-nav { scrollbar-width: none; -ms-overflow-style: none; }
  body.sb-mini .navbar-vertical::-webkit-scrollbar,
  body.sb-mini .navbar-vertical .navbar-collapse::-webkit-scrollbar,
  body.sb-mini .navbar-vertical #sidebar-menu::-webkit-scrollbar,
  body.sb-mini .navbar-vertical ul.navbar-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
}
@media (min-width: 992px) {
  /* in the icon rail, category names become thin separators between groups */
  body.sb-mini .navbar-vertical li.nav-item.nav-section {
    display: block !important;
    height: 0; padding: 0; margin: .45rem .8rem;
    border-top: 1px solid var(--sb-border);
    overflow: hidden; cursor: default;
  }
  body.sb-mini .navbar-vertical li.nav-item.nav-section span { display: none !important; }
}
