:root {
  /* ThriveAllianz brand palette, sampled from the company logo */
  --brand-teal: #2f9da3;
  --brand-orange: #f97c3c;
  --brand-amber: #fbb43f;
  --brand-green: #6dbe45;
  --brand-gray: #6d6e70;

  --brand-1: var(--brand-teal);
  --brand-2: var(--brand-orange);
  --brand-1-rgb: 47, 157, 163;
  --brand-soft: #e7f5f5;
  --ink: #333438;
  --muted: #6d6e70;
  --page-bg: #f6f8f8;
  --surface: #ffffff;
  --surface-border: #e7f0f0;
  --table-border: #e3ecec;
  --card-radius: 14px;
  color-scheme: light;
}

/* Dark mode - toggled by setting data-bs-theme="dark" on <html>.
   Bootstrap 5.3 already re-themes its own components (forms, modals,
   dropdowns, tables) from this attribute; these variables re-theme our
   custom classes (metric tiles, candidate cards, login page, etc). */
[data-bs-theme="dark"] {
  --brand-soft: rgba(47, 157, 163, 0.16);
  --ink: #e9edee;
  --muted: #9fb0b1;
  --page-bg: #10161a;
  --surface: #1b2327;
  --surface-border: #2a3438;
  --table-border: #2a3438;
  color-scheme: dark;
}

/* Several admin tables force a white card background (bg-white) so their
   striping/hover states look right on a colored page background. In dark
   mode, Bootstrap's own --bs-body-color goes light, which combined with a
   forced white background makes the text invisible. Pin those tables back
   to a light, readable text color regardless of theme. */
[data-bs-theme="dark"] .table.bg-white,
[data-bs-theme="dark"] .table.bg-white > :not(caption) > * > * {
  color: #212529;
}

* {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  background: var(--page-bg);
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Theme toggle button */
.theme-toggle-btn {
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-icon {
  transition: transform 0.35s ease;
}
.theme-toggle-btn:hover .theme-toggle-icon {
  transform: rotate(20deg) scale(1.1);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 600;
}

/* Navbar */
.navbar.app-navbar {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 2px 12px rgba(var(--brand-1-rgb), 0.3);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.app-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
}
.app-navbar .brand-logo {
  height: 34px;
  margin-right: 8px;
  border-radius: 6px;
  background: #fff;
  padding: 2px 6px;
}
.app-navbar .badge.role-pill {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 500;
  border-radius: 999px;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(30, 27, 58, 0.06), 0 8px 24px rgba(30, 27, 58, 0.04);
}
.card .card-body {
  padding: 1.25rem 1.4rem;
}

/* Metric tiles */
.metric-tile {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(30, 27, 58, 0.06);
  border-left: 4px solid var(--brand-1);
  transition: background-color 0.25s ease;
}
.metric-tile .metric-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.metric-tile .metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

/* Goal banner */
.goal-banner {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  color: #fff;
  border-radius: var(--card-radius);
  padding: 1.1rem 1.3rem;
}
.goal-banner .goal-progress-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.goal-banner .goal-progress-fill {
  background: #fff;
  height: 100%;
  border-radius: 999px;
}
.goal-progress-track.plain {
  background: var(--surface-border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.goal-progress-track.plain .goal-progress-fill {
  background: var(--brand-green);
  height: 100%;
  border-radius: 999px;
}

/* Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--table-border);
  gap: 4px;
}
.nav-tabs .nav-link {
  border: none;
  color: var(--muted);
  font-weight: 500;
  border-radius: 10px 10px 0 0;
  padding: 0.6rem 1.1rem;
  white-space: nowrap;
}
.nav-tabs .nav-link.active {
  background: var(--surface);
  color: var(--brand-1);
  box-shadow: 0 -2px 0 var(--brand-1) inset;
}
.nav-tabs .nav-link:hover:not(.active) {
  background: rgba(var(--brand-1-rgb), 0.08);
  color: var(--brand-1);
}

/* Phase 6: Collapsible sidebar navigation (admin dashboard).
   .app-body is the flex row below the top navbar: a fixed-width sidebar
   plus the main content area. Collapsed state hides the text labels and
   shrinks to an icon rail; state is persisted to localStorage in
   admin-dashboard.js so it survives a reload. */
.app-body {
  display: flex;
  align-items: flex-start;
}
.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--table-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.app-sidebar.collapsed {
  width: 64px;
}
.sidebar-toggle-btn {
  align-self: flex-end;
  margin: 0.6rem 0.6rem 0.2rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-1);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.25rem 0.6rem 1rem;
  overflow-y: auto;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}
.sidebar-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--muted);
}
.sidebar-link:hover:not(.active) {
  background: rgba(var(--brand-1-rgb), 0.08);
  color: var(--brand-1);
}
.sidebar-link:hover:not(.active) i {
  color: var(--brand-1);
}
.sidebar-link.active {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  color: #fff;
}
.sidebar-link.active i {
  color: #fff;
}
.app-sidebar.collapsed .sidebar-label {
  display: none;
}
.app-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.6rem;
}
.app-content {
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-mobile-toggle {
  display: none;
}

@media (max-width: 860px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .app-sidebar.collapsed {
    width: 240px;
  }
  .app-sidebar.collapsed .sidebar-label {
    display: inline;
  }
  .app-sidebar.collapsed .sidebar-link {
    justify-content: flex-start;
    padding: 0.6rem 0.7rem;
  }
  .sidebar-toggle-btn {
    display: none;
  }
  .sidebar-mobile-toggle {
    display: inline-flex;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 19;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}

/* Buttons */
.btn-primary {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  border: none;
  font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(100deg, #268185, #e2661f);
}
.btn-outline-primary {
  color: var(--brand-1);
  border-color: var(--brand-1);
  font-weight: 500;
}
.btn-outline-primary:hover {
  background: var(--brand-1);
  border-color: var(--brand-1);
}
.btn {
  border-radius: 10px;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
}
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 2px solid var(--table-border);
  font-weight: 600;
}
.table td {
  vertical-align: middle;
}
.table-hover tbody tr:hover {
  background: var(--brand-soft);
}

/* Badges */
.status-badge {
  font-size: 0.72rem;
  padding: 0.4em 0.75em;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Candidate cards (recruiter dashboard) */
.candidate-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.25s ease;
  border-radius: var(--card-radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}
.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(var(--brand-1-rgb), 0.18);
  border-color: var(--brand-1);
}
.candidate-card .card-title {
  color: var(--ink);
}

/* ==========================================================================
   Premium Login Page
   ========================================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: linear-gradient(120deg, #0d3b3d, #123f45, #7a3a15, #123f45);
  background-size: 300% 300%;
  animation: gradientShift 18s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Soft floating decorative blobs behind the login card */
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  animation: floatBlob 12s ease-in-out infinite;
}
.login-blob.blob-1 {
  width: 340px; height: 340px;
  top: -80px; left: -80px;
  background: var(--brand-1);
  animation-delay: 0s;
}
.login-blob.blob-2 {
  width: 300px; height: 300px;
  bottom: -100px; right: -60px;
  background: var(--brand-2);
  animation-delay: 3s;
}
.login-blob.blob-3 {
  width: 220px; height: 220px;
  bottom: 20%; left: 8%;
  background: var(--brand-amber);
  animation-delay: 6s;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}

/* Glassmorphism card */
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  animation: cardRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card .brand-header {
  background: linear-gradient(120deg, rgba(47,157,163,0.9), rgba(249,124,60,0.9));
  color: #fff;
  padding: 2rem 1.5rem 1.6rem;
  text-align: center;
}
.login-card .brand-header .brand-logo-img {
  height: 60px;
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  margin-bottom: 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.login-card .brand-header h4 {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.login-card .card-body {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}
[data-bs-theme="dark"] .login-card .card-body {
  background: rgba(20, 27, 30, 0.82);
}

.login-card .form-control {
  background: rgba(255, 255, 255, 0.9);
}
[data-bs-theme="dark"] .login-card .form-control {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.15);
}

.login-card .input-icon-wrap {
  position: relative;
}
.login-card .input-icon-wrap .bi {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.login-card .input-icon-wrap .form-control {
  padding-left: 2.4rem;
}
.login-card .password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--muted);
  padding: 4px 8px;
  cursor: pointer;
}
.login-card .password-toggle-btn:hover {
  color: var(--brand-1);
}

.login-card .btn-primary {
  padding: 0.65rem 1rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(var(--brand-1-rgb), 0.35);
}

.login-theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 3;
}

.login-footer-note {
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  margin-top: 1.25rem;
  position: relative;
  z-index: 2;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty-state i {
  font-size: 2rem;
  color: #bfe0e0;
  margin-bottom: 0.5rem;
  display: block;
}

/* Toasts */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
}

/* Phase 5: Print / Save-as-PDF for a single dashboard report card.
   printReport() in js/admin-reports.js adds "printing" to <body> and
   "print-target" to the one card being printed; these rules hide everything
   else so the print dialog (and "Save as PDF") only shows that report. */
@media print {
  body.printing .app-navbar,
  body.printing #mainTabs,
  body.printing .no-print {
    display: none !important;
  }
  body.printing .container > *:not(#tab-dashboard) {
    display: none !important;
  }
  body.printing #tab-dashboard > *:not(.print-target) {
    display: none !important;
  }
  body.printing .card.print-target {
    box-shadow: none !important;
    border: none !important;
  }
}
#toast-container .alert {
  border-radius: 12px;
  border: none;
}

/* Form controls */
.form-control, .form-select {
  border-radius: 10px;
  border-color: #d9e6e6;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-1-rgb), 0.15);
}

/* Client dashboard */
.client-card {
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(30, 27, 58, 0.06);
}
.designation-row {
  border-top: 1px solid var(--surface-border);
  padding: 0.75rem 0;
}
.designation-row:first-child {
  border-top: none;
}
.contribution-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-soft);
  color: #1f6d71;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 2px 4px 2px 0;
}

/* Phase C: Client Dashboard redesign - breadcrumb strip, sticky filter bar,
   requirement summary rows (client card -> Requirement drawer drill-in). */
.cd-subbar {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  padding: 0.55rem 1.25rem;
}
.cd-subbar .breadcrumb {
  font-size: 0.85rem;
}
.cd-subbar .breadcrumb-item a {
  color: var(--brand-1);
  text-decoration: none;
}
.cd-subbar .breadcrumb-item.active {
  color: var(--muted);
}
.cd-sticky-filter {
  position: sticky;
  top: 0;
  z-index: 10;
}
.requirement-row-v2 {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.requirement-row-v2:hover {
  border-color: var(--brand-1);
  background: var(--brand-soft);
}
.client-card-v2 {
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(30, 27, 58, 0.06), 0 8px 24px rgba(30, 27, 58, 0.04);
}
.offcanvas.cd-drawer {
  width: 460px;
  max-width: 92vw;
}
@media (max-width: 576px) {
  .offcanvas.cd-drawer {
    width: 100vw;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .metric-tile .metric-value {
    font-size: 1.3rem;
  }
}

/* Phase 2: Attendance + Leave + motivational quote */
.quote-banner {
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  color: #fff;
  border-radius: var(--card-radius);
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-style: italic;
  box-shadow: 0 4px 14px rgba(var(--brand-1-rgb), 0.25);
}

.attendance-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.attendance-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.att-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--muted);
  cursor: default;
}

.att-present { background: var(--brand-green); }
.att-halfday { background: var(--brand-amber); color: #4a3400; }
.att-leave { background: var(--brand-1); }
.att-absent { background: #e05656; }
.att-weekoff { background: var(--muted); opacity: 0.55; }

.att-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.att-dot.att-present { background: var(--brand-green); }
.att-dot.att-halfday { background: var(--brand-amber); }
.att-dot.att-leave { background: var(--brand-1); }
.att-dot.att-absent { background: #e05656; }
.att-dot.att-weekoff { background: var(--muted); }

.leave-list {
  max-height: 220px;
  overflow-y: auto;
}
.leave-item {
  border-bottom: 1px dashed var(--surface-border);
  padding-bottom: 6px;
}

/* Phase 3: Calling Queue banner on the recruiter dashboard */
.queue-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--card-radius);
  background: var(--surface);
}

/* Phase 3: Drag-and-drop ATS Pipeline board (admin) */
.pipeline-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-column {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--card-radius);
  max-height: 75vh;
}

.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  background: var(--page-bg);
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}

.pipeline-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  min-height: 80px;
  transition: background-color 0.15s ease;
}

.pipeline-column-body.drag-over {
  background: var(--brand-soft);
}

.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pipeline-card:active {
  cursor: grabbing;
}

.pipeline-card.dragging {
  opacity: 0.4;
}

.pipeline-empty {
  text-align: center;
  padding: 1rem 0;
}
