:root {
  --sidebar-bg: #0d3349;
  --sidebar-hover: #1a5276;
  --sidebar-active: #148f77;
  --brand-teal: #148f77;
  --brand-dark: #0d3349;
  --content-bg: #f0f4f7;
}

/* ── Layout ── */
body { background: var(--content-bg); font-family: 'Segoe UI', sans-serif; }

.wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px; height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
  overflow: hidden;
}
.sidebar-brand {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .brand-name {
  font-size: 1.4rem; font-weight: 800;
  color: #fff; letter-spacing: 1px;
}
.sidebar-brand .brand-sub {
  font-size: 0.68rem; color: rgba(255,255,255,0.55);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.sidebar-nav .nav-label {
  padding: 10px 20px 4px;
  font-size: 0.65rem; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none; font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar-nav a:hover {
  color: #fff; background: var(--sidebar-hover);
}
.sidebar-nav a.active {
  color: #fff; background: var(--sidebar-hover);
  border-left-color: var(--brand-teal);
}
.sidebar-nav a i { font-size: 1rem; width: 20px; text-align: center; }

/* ── Main content ── */
.main-content {
  margin-left: 240px; flex: 1;
  min-height: 100vh; display: flex; flex-direction: column;
}
.top-bar {
  background: #fff;
  padding: 14px 24px;
  border-bottom: 1px solid #e0e6ec;
  display: flex; align-items: center; justify-content: space-between;
}
.top-bar h5 { margin: 0; font-weight: 600; color: var(--brand-dark); }
.content-area { padding: 24px; flex: 1; }

/* ── Cards ── */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border-radius: 8px; }
.card-header {
  background: #fff; border-bottom: 1px solid #edf0f5;
  font-weight: 600; color: var(--brand-dark);
  border-radius: 8px 8px 0 0 !important;
}

/* ── Stat cards ── */
.stat-card {
  border-radius: 10px; padding: 20px 24px;
  color: #fff; border: none;
}
.stat-card.teal   { background: linear-gradient(135deg, #148f77, #0e6b5a); }
.stat-card.blue   { background: linear-gradient(135deg, #1a5276, #154360); }
.stat-card.orange { background: linear-gradient(135deg, #d35400, #a04000); }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 0.82rem; opacity: 0.85; }
.stat-card i { font-size: 2.2rem; opacity: 0.3; }

/* ── Tables ── */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #6c757d; background: #f8fafc; }
.table td { vertical-align: middle; font-size: 0.9rem; }

/* ── Badges ── */
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-resigned { background: #fff3cd; color: #856404; }

/* ── Buttons ── */
.btn-teal { background: var(--brand-teal); color: #fff; border: none; }
.btn-teal:hover { background: #0e6b5a; color: #fff; }
.btn-outline-teal { color: var(--brand-teal); border: 1px solid var(--brand-teal); background: transparent; }
.btn-outline-teal:hover { background: var(--brand-teal); color: #fff; }

/* ── Form tabs ── */
.nav-tabs .nav-link { color: var(--brand-dark); }
.nav-tabs .nav-link.active {
  border-bottom-color: var(--brand-teal);
  color: var(--brand-teal); font-weight: 600;
}

/* ── Salary live calc ── */
#salary-preview { background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 0.88rem; }
#salary-preview .row-item { display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px dashed #e2e8f0; }
#salary-preview .row-total { display: flex; justify-content: space-between;
  padding: 6px 0; font-weight: 700; color: var(--brand-dark); }

/* ── Print styles (payslip / documents) ── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print-page { box-shadow: none; border: none; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* Public employee registration */
.public-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(20,143,119,0.18), transparent 35%),
    linear-gradient(135deg, #f7fbfc, #e8f1f4);
}
.public-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 32px 16px;
}
.public-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(13,51,73,0.12);
  padding: clamp(20px, 4vw, 40px);
}
.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  width: fit-content;
}
.form-section-title {
  font-weight: 700;
  color: var(--brand-dark);
  border-bottom: 1px solid #e8eef2;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.document-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
}
.document-preview-row:last-child { border-bottom: 0; }

/* Mobile layout */
@media (max-width: 991.98px) {
  .wrapper { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar-brand { padding: 14px 16px 8px; }
  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px 12px;
  }
  .sidebar-nav .nav-label { display: none; }
  .sidebar-nav a {
    flex: 0 0 auto;
    border-left: 0;
    border-radius: 999px;
    padding: 8px 12px;
    white-space: nowrap;
    background: rgba(255,255,255,0.08);
  }
  .sidebar > div:last-child { display: none; }
  .main-content {
    margin-left: 0;
    min-height: auto;
  }
  .top-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 12px 16px;
  }
  .content-area { padding: 16px; }
  .table-responsive-mobile,
  .card-body.p-0 { overflow-x: auto; }
}

@media (max-width: 575.98px) {
  body { font-size: 0.95rem; }
  .public-shell { padding: 16px 10px; }
  .public-card { border-radius: 14px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-num { font-size: 1.55rem; }
  .top-bar { align-items: flex-start; gap: 8px; }
  .content-area { padding: 12px; }
  .btn-group { flex-wrap: wrap; }
  .d-flex.gap-2 { gap: 0.4rem !important; }
  .table th, .table td { font-size: 0.82rem; }
  .document-preview-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
