/* ============================================================
   APTIVO EMPLOYEE PORTAL — Premium Admin Template
   Bootstrap 5 + jQuery 3 · No frameworks
   ============================================================ */

:root {
  --apt-primary: #1f6fe0;
  --apt-primary-dark: #1557b8;
  --apt-primary-soft: #eaf2fe;
  --apt-navy: #0d2a5c;
  --apt-ink: #1c2b41;
  --apt-body: #5b6b83;
  --apt-line: #e6ebf3;
  --apt-bg: #f4f7fc;
  --apt-card: #ffffff;
  --apt-success: #16a34a;
  --apt-success-soft: #e8f7ee;
  --apt-warning: #f59e0b;
  --apt-warning-soft: #fdf3e0;
  --apt-danger: #ef4444;
  --apt-danger-soft: #fdeaea;
  --apt-purple: #7c5cfc;
  --apt-purple-soft: #f0ecfe;
  --apt-teal: #0ea5a4;
  --apt-teal-soft: #e4f6f6;
  --apt-radius: 14px;
  --apt-shadow: 0 1px 2px rgba(13, 42, 92, .04), 0 8px 24px rgba(13, 42, 92, .06);
  --apt-shadow-lg: 0 12px 40px rgba(13, 42, 92, .12);
  --sidebar-w: 260px;
  --sidebar-collapsed: 78px;
  --topbar-h: 68px;
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--apt-bg);
  color: var(--apt-ink);
  font-size: .925rem;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .apt-brand-text, .apt-display {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--apt-ink);
  font-weight: 600;
}

a { color: var(--apt-primary); text-decoration: none; }
a:hover { color: var(--apt-primary-dark); }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d4e5; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   LAYOUT — Sidebar / Topbar / Content
   ============================================================ */
.apt-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--apt-card);
  border-right: 1px solid var(--apt-line);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width .25s ease, transform .25s ease;
}

.apt-sidebar .apt-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--apt-line);
  flex-shrink: 0;
}

.apt-brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--apt-primary) 0%, var(--apt-teal) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.apt-brand-text { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.apt-brand-text span { color: var(--apt-primary); }
.apt-brand-sub { font-size: .62rem; color: var(--apt-body); letter-spacing: .12em; text-transform: uppercase; }
.apt-brand-logo { height: 54px; max-height: 56px; max-width: 225px; width: auto; object-fit: contain; display: block; }

.apt-nav { padding: 1rem .75rem; overflow-y: auto; flex: 1; }
.apt-nav-label {
  font-size: .66rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #9aa8bf;
  padding: .35rem .75rem .5rem;
}
.apt-nav-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .68rem .8rem;
  border-radius: 10px;
  color: var(--apt-body);
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: .15rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.apt-nav-link i { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.apt-nav-link:hover { background: var(--apt-primary-soft); color: var(--apt-primary-dark); }
.apt-nav-link.active {
  background: var(--apt-primary-soft);
  color: var(--apt-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--apt-primary);
}

.apt-sidebar-footer {
  border-top: 1px solid var(--apt-line);
  padding: .75rem;
  flex-shrink: 0;
}

.apt-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .25s ease;
  display: flex;
  flex-direction: column;
}

body.apt-collapsed .apt-sidebar { width: var(--sidebar-collapsed); }
body.apt-collapsed .apt-sidebar .apt-brand { display: none !important; }
body.apt-collapsed .apt-nav-label,
body.apt-collapsed .apt-nav-link .apt-nav-text,
body.apt-collapsed .apt-sidebar-footer .apt-nav-text { display: none !important; }
body.apt-collapsed .apt-nav-link { justify-content: center; padding: .68rem; }
body.apt-collapsed .apt-main { margin-left: var(--sidebar-collapsed); }

/* ---------- Topbar ---------- */
.apt-topbar {
  height: var(--topbar-h);
  background: var(--apt-card);
  border-bottom: 1px solid var(--apt-line);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.apt-search {
  position: relative;
  max-width: 340px;
  width: 100%;
}
.apt-search i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: #9aa8bf; font-size: .95rem;
}
.apt-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--apt-line);
  border-radius: 10px;
  background: var(--apt-bg);
  padding: 0 .9rem 0 2.4rem;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.apt-search input:focus {
  background: #fff;
  border-color: var(--apt-primary);
  box-shadow: 0 0 0 4px rgba(31, 111, 224, .1);
}

.apt-icon-btn {
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--apt-line);
  background: var(--apt-card);
  color: var(--apt-body);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  position: relative;
  transition: background .15s, color .15s;
}
.apt-icon-btn:hover { background: var(--apt-primary-soft); color: var(--apt-primary); }
.apt-icon-btn .apt-dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--apt-danger);
  border: 2px solid #fff;
}

.apt-user {
  display: flex; align-items: center; gap: .65rem;
  padding: .3rem .65rem .3rem .3rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  transition: background .15s, border-color .15s;
}
.apt-user:hover { background: var(--apt-bg); border-color: var(--apt-line); }
.apt-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apt-primary), var(--apt-purple));
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.apt-user-name { font-weight: 600; font-size: .875rem; line-height: 1.15; color: var(--apt-ink); }
.apt-user-role { font-size: .72rem; color: var(--apt-body); }

/* ---------- Content ---------- */
.apt-content { padding: 1.6rem 1.75rem 2.5rem; flex: 1; }

.apt-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.apt-page-title { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.apt-page-sub { color: var(--apt-body); font-size: .875rem; margin: .2rem 0 0; }

/* ============================================================
   CARDS & UI ATOMS
   ============================================================ */
.apt-card {
  background: var(--apt-card);
  border: 1px solid var(--apt-line);
  border-radius: var(--apt-radius);
  box-shadow: var(--apt-shadow);
}
.apt-card-body { padding: 1.35rem; }
.apt-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--apt-line);
}
.apt-card-title { font-size: 1.02rem; font-weight: 600; margin: 0; }

.apt-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
}
.apt-badge-success { background: var(--apt-success-soft); color: var(--apt-success); }
.apt-badge-warning { background: var(--apt-warning-soft); color: #b45309; }
.apt-badge-danger  { background: var(--apt-danger-soft);  color: var(--apt-danger); }
.apt-badge-primary { background: var(--apt-primary-soft); color: var(--apt-primary); }
.apt-badge-purple  { background: var(--apt-purple-soft);  color: var(--apt-purple); }
.apt-badge-muted   { background: #eef2f8; color: var(--apt-body); }

.apt-btn-primary {
  background: var(--apt-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: .62rem 1.15rem;
  font-size: .875rem;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(31, 111, 224, .28);
}
.apt-btn-primary:hover { background: var(--apt-primary-dark); color: #fff; transform: translateY(-1px); }
.apt-btn-primary:active { transform: translateY(0); }

.apt-btn-ghost {
  background: var(--apt-card);
  border: 1px solid var(--apt-line);
  color: var(--apt-ink);
  font-weight: 600;
  border-radius: 10px;
  padding: .62rem 1.15rem;
  font-size: .875rem;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: background .15s, border-color .15s;
}
.apt-btn-ghost:hover { background: var(--apt-bg); border-color: #d4dcea; color: var(--apt-ink); }

/* ---------- Stat cards ---------- */
.apt-stat {
  display: flex; align-items: center; gap: 1rem;
  background: var(--apt-card);
  border: 1px solid var(--apt-line);
  border-radius: var(--apt-radius);
  padding: 1.15rem 1.3rem;
  box-shadow: var(--apt-shadow);
  transition: transform .15s, box-shadow .15s;
}
.apt-stat:hover { transform: translateY(-2px); box-shadow: var(--apt-shadow-lg); }
.apt-stat-icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.apt-stat-value { font-size: 1.65rem; font-weight: 700; font-family: "Poppins", sans-serif; line-height: 1; }
.apt-stat-label { font-size: .8rem; color: var(--apt-body); margin-top: .25rem; }

/* ---------- Progress / rings ---------- */
.apt-progress { height: 10px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.apt-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--apt-success), #35d07f);
  transition: width .4s ease;
}

.apt-ring {
  --p: 75;
  --c: var(--apt-success);
  width: 92px; height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9eef6 0);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.apt-ring::after {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: var(--apt-card, #fff);
}
.apt-ring-value { position: relative; z-index: 1; font-weight: 700; font-family: "Poppins", sans-serif; font-size: 1.15rem; color: var(--apt-ink); }
.apt-ring-sm { width: 68px; height: 68px; }
.apt-ring-sm::after { inset: 7px; }
.apt-ring-sm .apt-ring-value { font-size: .95rem; }

/* ---------- Lists ---------- */
.apt-list-item {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--apt-line);
}
.apt-list-item:last-child { border-bottom: none; padding-bottom: 0; }

/* ---------- Tables ---------- */
.apt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}
.apt-table thead th {
  background: #f7f9fd;
  color: #8291aa;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--apt-line);
  white-space: nowrap;
}
.apt-table tbody td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--apt-line);
  vertical-align: middle;
  color: var(--apt-ink);
}
.apt-table tbody tr:last-child td { border-bottom: none; }
.apt-table tbody tr { transition: background .12s; }
.apt-table tbody tr:hover { background: #fafcff; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border: 1px solid var(--apt-line);
  border-radius: 10px;
  padding: .62rem .85rem;
  font-size: .875rem;
  color: var(--apt-ink);
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--apt-primary);
  box-shadow: 0 0 0 4px rgba(31, 111, 224, .1);
}
.form-label { font-size: .8rem; font-weight: 600; color: var(--apt-ink); margin-bottom: .4rem; }
.form-label .req { color: var(--apt-danger); }
.form-text { font-size: .76rem; }

/* ---------- Kebab / dropdown ---------- */
.dropdown-menu {
  border: 1px solid var(--apt-line);
  border-radius: 12px;
  box-shadow: var(--apt-shadow-lg);
  padding: .4rem;
  font-size: .85rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; color: var(--apt-ink); }
.dropdown-item:hover { background: var(--apt-primary-soft); color: var(--apt-primary-dark); }

/* ---------- Note banner ---------- */
.apt-note {
  background: var(--apt-primary-soft);
  border: 1px solid #d4e4fb;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex; gap: .8rem;
}
.apt-note i { color: var(--apt-primary); font-size: 1.1rem; margin-top: .1rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.apt-login { min-height: 100vh; display: flex; }
.apt-login-form-side {
  flex: 1 1 480px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem clamp(2rem, 6vw, 5.5rem);
  background: #fff;
}
.apt-login-hero-side {
  flex: 1 1 420px;
  position: relative;
  min-height: 100%;
  background-size: cover;
  background-position: center;
}
.apt-login-hero-side::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(13,42,92,.05) 30%, rgba(13,42,92,.45) 100%);
}
.apt-hero-caption {
  position: absolute;
  left: 2.5rem; bottom: 2.5rem;
  z-index: 2;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  max-width: 20ch;
  text-shadow: 0 2px 18px rgba(13,42,92,.45);
}
.apt-hero-badge {
  position: absolute;
  top: 2.2rem; right: 2.2rem;
  z-index: 2;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  color: var(--apt-navy);
  font-weight: 600; font-size: .78rem;
  border-radius: 999px;
  padding: .5rem 1rem;
  box-shadow: var(--apt-shadow);
}
.apt-input-icon { position: relative; }
.apt-input-icon > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9aa8bf; z-index: 2; font-size: .95rem; }
.apt-input-icon .form-control { padding-left: 2.5rem; height: 48px; }
.apt-eye-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: #9aa8bf;
  width: 38px; height: 38px; border-radius: 8px;
}
.apt-eye-toggle:hover { color: var(--apt-primary); }
.apt-login-logo { display: flex; align-items: center; gap: .85rem; margin-bottom: 2rem; }
.apt-login-icon {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
}
.apt-login-title { font-size: 1.7rem; font-weight: 700; letter-spacing: -.01em; }
.apt-login-sub { color: var(--apt-body); margin-bottom: 2rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
  .apt-sidebar { transform: translateX(-100%); box-shadow: var(--apt-shadow-lg); }
  body.apt-mobile-open .apt-sidebar { transform: translateX(0); }
  body.apt-collapsed .apt-sidebar { width: var(--sidebar-w); }
  body.apt-collapsed .apt-main { margin-left: 0; }
  .apt-main { margin-left: 0; }
  .apt-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(13,42,92,.45);
    z-index: 1035;
  }
  body.apt-mobile-open .apt-backdrop { display: block; }
  .apt-login-hero-side { display: none; }
  .apt-content { padding: 1.2rem 1rem 2rem; }
}
@media (min-width: 992px) {
  .apt-backdrop { display: none !important; }
  .apt-sidebar-toggler-mobile { display: none !important; }
}
