/* ==========================================================================
   HRBot — Employee App
   style.css — Layout & component styles.
   All colors/gradients/shadows come from base.css tokens. Do not hardcode
   hex values here — add a token to base.css instead.
   ========================================================================== */

@import "base.css";
@import "utilities.css";

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */
* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg-app-alt);
  color: var(--color-ink);
  padding-bottom: 110px;
  /* clearance for the fixed bottom nav */
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   2. Utilities
   -------------------------------------------------------------------------- */
.bg-gradient-custom {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-primary);
}

.text-primary-custom {
  color: var(--color-primary);
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hover-lift {
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-lg) !important;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--color-surface);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.status-denied {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.status-approved {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.pulse-btn {
  animation: pulse-white 2s infinite;
}

@keyframes pulse-white {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   2.5 Top bar — sticky page header

   Renders when a PHP page sets $pageTitle before including components/head.php.
   Optional $pageBackUrl renders a back chevron before the title. Sits above
   page content but below the bottom-sheet modal layer (z-index 1060) so
   sheets cover it on open.
   -------------------------------------------------------------------------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50; /* above page content; below .bottom-sheet (1060) and .custom-bottom-nav (1050? see note) */
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.app-topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-topbar__back {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px; /* visually aligns chevron with the gutter */
  border-radius: 12px;
  color: var(--color-ink);
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.app-topbar__back:hover {
  background: var(--color-paper);
}

.app-topbar__back:active {
  transform: scale(0.92);
}

.app-topbar__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  /* Long titles ellipsise rather than push the back button off-screen */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. Bottom nav
   -------------------------------------------------------------------------- */
.custom-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1050;
}

.nav-item-custom {
  width: 50px;
  height: 50px;
  background: var(--color-paper);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.nav-item-custom.active {
  width: auto;
  padding: 0 20px;
  background: var(--gradient-primary-h);
  color: var(--color-surface) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-item-custom span {
  display: none;
  white-space: nowrap;
}

.nav-item-custom.active span {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* --------------------------------------------------------------------------
   4. Login
   -------------------------------------------------------------------------- */

/* --- Entrance choreography ---------------------------------------------- */
@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(36px);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.22);
  }

  100% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
}

@keyframes shakeX {
  10%,
  90% {
    transform: translateX(-1px);
  }

  20%,
  80% {
    transform: translateX(2px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Hero ----------------------------------------------------------------*/
.auth-hero {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + clamp(24px, 6vh, 40px))
    clamp(20px, 6vw, 32px) clamp(48px, 9vh, 64px);
  background: var(--gradient-hero);
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-hero::before {
  width: 240px;
  height: 240px;
  background: rgba(255, 255, 255, 0.08);
  top: -90px;
  right: -60px;
}

.auth-hero::after {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.05);
  bottom: -50px;
  left: -40px;
}

.hero-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.hero-title {
  color: #fff;
  font-size: clamp(1.45rem, 1.15rem + 1.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.3px;
  margin: 0;
  max-width: 320px;
  position: relative;
  z-index: 1;
}

.hero-chip {
  position: absolute;
  right: clamp(20px, 6vw, 32px);
  bottom: -20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  padding: 9px 14px 9px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-hero-chip);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-ink);
  z-index: 3;
}

.hero-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* Staged load-in: mark → eyebrow → title → chip → sheet, each a beat apart */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark {
    animation: authPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

  .hero-eyebrow {
    animation: authRise 0.5s ease both 0.08s;
  }

  .hero-title {
    animation: authRise 0.55s ease both 0.16s;
  }

  .hero-chip {
    animation:
      authPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.32s,
      floaty 4.5s ease-in-out infinite 1s;
  }

  .auth-sheet {
    animation: sheetSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both 0.18s;
  }
}

/* --- Sheet -----------------------------------------------------------------*/
.auth-sheet {
  flex: 1;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin-top: -28px;
  position: relative;
  z-index: 2;
  padding: clamp(28px, 5vh, 40px) clamp(20px, 6vw, 32px)
    calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
}

.sheet-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.sheet-subtitle {
  font-size: 0.88rem;
  color: var(--color-slate);
  margin: 0 0 28px;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-slate);
  margin-bottom: 8px;
  display: block;
  transition: color 0.2s ease;
}

/* --- Inputs ------------------------------------------------------------- */
.form-control {
  height: 52px;
  border-radius: var(--radius-md) !important;
  background-color: var(--color-paper) !important;
  border-color: var(--color-line) !important;
  font-size: 0.95rem;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease !important;
}

.form-control:hover {
  border-color: var(--color-secondary-light) !important;
}

.form-control:focus {
  background-color: var(--color-surface) !important;
  border-color: var(--color-primary-mid) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14) !important;
}

.form-control:focus ~ .input-icon {
  color: var(--color-primary-mid) !important;
}

/* Invalid state: a quick shake + red ring, cleared the moment input changes */
.form-control.is-invalid {
  border-color: var(--color-danger) !important;
  animation: shakeX 0.45s ease;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14) !important;
}

.form-control.is-invalid ~ .input-icon {
  color: var(--color-danger) !important;
}

.input-icon {
  transition: color 0.2s ease;
}

.password-toggle-btn {
  transition:
    color 0.2s ease,
    transform 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--color-primary-mid) !important;
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.88) !important;
}

/* --- Submit button -------------------------------------------------------*/
.btn-login {
  height: 54px;
  background: var(--color-primary-mid) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-login:hover:not(:disabled) {
  background: var(--color-primary-hover) !important;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.45);
}

.btn-login:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-login:focus-visible {
  outline: none;
  animation: ringPulse 1.1s ease-out infinite;
}

.btn-login:disabled {
  opacity: 0.85;
  cursor: progress;
}

/* Sliding chevron nudge on hover, purely decorative motion on the icon */
.btn-login .btn-arrow {
  transition: transform 0.2s ease;
}

.btn-login:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

/* Spinner shown while the button is in its loading state */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.forgot-link,
.legal-link {
  color: var(--color-primary-mid);
  transition: color 0.2s ease;
}

.forgot-link:hover,
.legal-link:hover {
  color: var(--color-primary-hover);
}

.auth-sheet-foot {
  margin-top: auto;
  padding-top: 24px;
}

/* --- Responsive frame -----------------------------------------------------
   Fluid up to a comfortable phone width, then settles into a centered
   "device frame" on larger viewports — no abrupt breakpoint jump, the
   max-width itself scales with clamp(). */
@media (min-width: 560px) {
  body {
    background: var(--color-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
  }

  .auth-screen {
    width: 100%;
    max-width: clamp(380px, 32vw, 440px);
    min-height: min(86vh, 844px);
    height: min(86vh, 844px);
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.25);
  }

  .auth-sheet {
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark,
  .hero-eyebrow,
  .hero-title,
  .hero-chip,
  .auth-sheet,
  .form-control.is-invalid,
  .btn-login:focus-visible {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   5. Home — content tabs
   -------------------------------------------------------------------------- */
.content-tab {
  transition: all 0.3s ease;
}

.content-tab:not(.bg-primary-light):hover {
  background-color: var(--color-line);
  color: #1e293b !important;
}

/* --------------------------------------------------------------------------
   6. Attendance — calendar
   -------------------------------------------------------------------------- */
.col-day {
  flex: 0 0 14.285%;
  max-width: 14.285%;
  padding: 4px;
}

.calendar-cell {
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.selected-day {
  background-color: var(--color-primary-mid) !important;
  color: var(--color-surface) !important;
  border-color: var(--color-primary-mid) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: scale(1.1);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   7. Profile — accordion
   -------------------------------------------------------------------------- */
.accordion-item {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.accordion-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-lg) !important;
}

.accordion-button::after {
  display: none;
}

.custom-chevron {
  transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed) .custom-chevron {
  transform: rotate(180deg);
  color: var(--color-primary-mid) !important;
}

.btn-dashed {
  border: 2px dashed var(--color-secondary-light) !important;
  transition: all 0.2s;
}

.btn-dashed:hover {
  border-color: var(--color-primary-mid) !important;
  color: var(--color-primary-mid) !important;
  background-color: var(--color-primary-light) !important;
}

/* --------------------------------------------------------------------------
   8. Salary — action button
   -------------------------------------------------------------------------- */
.btn-action {
  background-color: var(--color-bg-app-alt);
  color: var(--color-secondary);
  transition: all 0.3s ease;
}

.btn-action:hover {
  background-color: var(--color-primary-mid);
  color: var(--color-surface);
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   9. Announcements — popup
   -------------------------------------------------------------------------- */
.announcement-app-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-lg);
  border: 1px solid var(--color-line);
  height: 720px;
  width: 100%;
}

.announcement-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-line);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.announcement-item:hover {
  background-color: var(--color-paper);
}

.status-indicator-box {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.status-indicator-box .tick-icon {
  display: none;
}

.announcement-item.read .tick-icon {
  display: inline-block;
  color: var(--color-accent);
  font-size: 15px;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.popup-content-box {
  background: var(--color-surface);
  width: 90%;
  max-width: 460px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popup);
  border: 1px solid var(--color-line);
  overflow: hidden;
}

.popup-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-close-btn {
  border: none;
  background: transparent;
  color: var(--color-slate);
  cursor: pointer;
  font-size: 1.25rem;
}

.popup-body {
  padding: 1.25rem;
  max-height: 360px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  white-space: pre-line;
}

.popup-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: flex-end;
}

.btn-action-primary {
  background: var(--color-purple);
  color: var(--color-surface);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
}

.btn-action-primary:hover {
  background: var(--color-purple-hover);
}

/* --------------------------------------------------------------------------
   10. Bottom sheet (shared component)
   Used by: Attendance "Apply Leave", Announcements detail view, and any
   future modal that should slide up from the bottom rather than center.
   Markup contract:
     .bottom-sheet[hidden]
       .bottom-sheet__backdrop[data-sheet-close]
       .bottom-sheet__panel
         .bottom-sheet__handle
         .bottom-sheet__header > .bottom-sheet__title + .bottom-sheet__close
         .bottom-sheet__body
   JS toggles [hidden] and a `.is-open` class for the transition to run;
   see BottomSheet.open()/close() in components/bottomSheet.js.
   -------------------------------------------------------------------------- */

@keyframes sheetBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes sheetPanelIn {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bottom-sheet[hidden] {
  display: none;
}

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: sheetBackdropIn 0.22s ease both;
}

.bottom-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: min(86vh, 720px);
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -12px 40px -8px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--color-line);
  margin: 10px auto 2px;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.bottom-sheet__panel:active .bottom-sheet__handle {
  background: var(--color-secondary-light);
}

.bottom-sheet__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--color-line);
}
.bottom-sheet__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-ink);
  display: flex;
  align-items: center;
}
.bottom-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-paper);
  color: var(--color-slate);
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.15s ease;
}
.bottom-sheet__close:hover {
  background: var(--color-line);
  color: var(--color-ink);
}
.bottom-sheet__close:active {
  transform: scale(0.9);
}

.bottom-sheet__body {
  padding: 18px 20px 24px;
  overflow-y: auto;
}

/* Exit animation — toggled by JS just before removing [hidden] is reverted */
.bottom-sheet.is-closing .bottom-sheet__backdrop {
  animation: sheetBackdropIn 0.18s ease reverse both;
}
.bottom-sheet.is-closing .bottom-sheet__panel {
  animation: sheetPanelIn 0.22s cubic-bezier(0.4, 0, 1, 1) reverse both;
}

@media (prefers-reduced-motion: reduce) {
  .bottom-sheet__backdrop,
  .bottom-sheet__panel {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   11. Stat cards (KPI row)
   Used by: components/statCard.js — renderStatCardRow()
   -------------------------------------------------------------------------- */
.stat-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-lg);
}
.stat-card__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.stat-card__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.1;
}
.stat-card__label {
  font-size: 0.72rem;
  color: var(--color-slate);
  font-weight: 600;
}

.stat-card--success .stat-card__icon {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}
.stat-card--warning .stat-card__icon {
  background: #fffbeb;
  color: var(--color-warning);
}
.stat-card--danger .stat-card__icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}
.stat-card--info .stat-card__icon {
  background: var(--color-info-bg);
  color: var(--color-info);
}
.stat-card--primary .stat-card__icon {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   12. Daily snapshot (Attendance page)
   Used by: js/pages/attendance.js — updateDailySnapshot()
   One outer shape (.snapshot-card) with state modifiers so switching days
   never jumps layout. Background is a soft tint of the state's variant
   color rather than a left accent bar.
   -------------------------------------------------------------------------- */

@keyframes snapshotIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.snapshot-card {
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--color-surface);
  animation: snapshotIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Re-trigger the animation on every render by toggling this class via JS
   (classList.remove/add, or clone+replace) if the element is reused. */
.snapshot-card.is-refreshing {
  animation: snapshotIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .snapshot-card {
    animation: none !important;
  }
}

/* --- Header row: badge + meta, shared across present/late/leave states ---*/
.snapshot-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.snapshot-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}
.snapshot-card__meta {
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Present / Late: the hero IN → OUT row -------------------------------*/
.snapshot-times {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: clamp(16px, 5vw, 32px);
  padding: 14px 0 4px;
}
.snapshot-time {
  text-align: center;
}
.snapshot-time__label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin-bottom: 4px;
}
.snapshot-time__value {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.snapshot-time__value.is-pending {
  color: var(--color-secondary-light);
}
.snapshot-arrow {
  color: var(--color-secondary-light);
  font-size: 1.1rem;
  display: flex;
  align-self: center;
  margin-top: 14px;
}

/* --- Absent: quiet, single statement -------------------------------------*/
.snapshot-statement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.98rem;
  font-weight: 700;
}
.snapshot-statement i {
  font-size: 1.3rem;
}

/* --- On leave: headline + reason ------------------------------------------*/
.snapshot-leave__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-ink);
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.snapshot-leave__reason {
  font-size: 0.85rem;
  color: var(--color-slate);
  margin: 0;
  line-height: 1.45;
}

/* --- Empty state: no record for the day -----------------------------------*/
.snapshot-card--empty {
  text-align: center;
  padding: 28px 20px;
  color: var(--color-slate);
}
.snapshot-card--empty i {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 8px;
  color: var(--color-secondary-light);
}
.snapshot-card--empty p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- State tints (soft background, replaces the old border-left bar) -----*/
.snapshot-card--success {
  background: var(--color-success-bg);
}
.snapshot-card--success .snapshot-card__badge {
  background: rgba(34, 197, 94, 0.16);
  color: var(--color-success-text);
}
.snapshot-card--success .snapshot-card__meta {
  color: var(--color-success-text);
}

.snapshot-card--warning {
  background: #fffbeb;
}
.snapshot-card--warning .snapshot-card__badge {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.snapshot-card--warning .snapshot-card__meta {
  color: #b45309;
}

.snapshot-card--danger {
  background: var(--color-danger-bg);
}
.snapshot-card--danger .snapshot-card__badge {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-danger);
}
.snapshot-card--danger .snapshot-statement {
  color: var(--color-danger);
}

.snapshot-card--info {
  background: var(--color-info-bg);
}
.snapshot-card--info .snapshot-card__badge {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}
.snapshot-card--info .snapshot-leave__title i {
  color: var(--color-info);
}

.snapshot-card--secondary {
  background: var(--color-paper);
}
.snapshot-card--secondary .snapshot-card__badge {
  background: var(--color-line);
  color: var(--color-secondary);
}
.snapshot-card--secondary .snapshot-leave__title i {
  color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   13. Shimmer skeleton system

   A reusable shimmer effect for loading placeholders across all pages.
   Two flavours:
     .skeleton-shimmer  — block-level element with a moving sheen
     .skeleton-text     — text line placeholder
     .skeleton-circle   — round placeholder
   The sheen uses a wide gradient that travels left-to-right; both the
   base colour and the sheen tint come from design tokens so it slots
   into light or dark cards without clashing.
   -------------------------------------------------------------------------- */
@keyframes skeleton-shine {
  0% {
    background-position: -480px 0;
  }
  100% {
    background-position: 480px 0;
  }
}

.skeleton-shimmer,
.skeleton-text,
.skeleton-circle {
  display: block;
  background-color: #e7ebf3;
  background-image: linear-gradient(
    90deg,
    rgba(231, 235, 243, 0) 0px,
    rgba(247, 250, 255, 0.85) 80px,
    rgba(231, 235, 243, 0) 160px
  );
  background-size: 960px 100%;
  background-attachment: local;
  background-repeat: no-repeat;
  animation: skeleton-shine 1.4s linear infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 12px;
  margin: 0;
  border-radius: 4px;
}

.skeleton-text + .skeleton-text {
  margin-top: 8px;
}

.skeleton-text--title {
  height: 16px;
  width: 60%;
}
.skeleton-text--meta {
  height: 10px;
  width: 40%;
}
.skeleton-text--lg {
  height: 22px;
}
.skeleton-text--sm {
  height: 10px;
}
.skeleton-text--block {
  width: 100%;
}
.skeleton-text--short {
  width: 55%;
}
.skeleton-text--tiny {
  width: 30%;
}

.skeleton-circle {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.skeleton-circle--sm {
  width: 32px;
  height: 32px;
}
.skeleton-circle--lg {
  width: 80px;
  height: 80px;
}

.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.skeleton-block {
  display: block;
  background-color: #e7ebf3;
  background-image: linear-gradient(
    90deg,
    rgba(231, 235, 243, 0) 0px,
    rgba(247, 250, 255, 0.85) 80px,
    rgba(231, 235, 243, 0) 160px
  );
  background-size: 960px 100%;
  background-repeat: no-repeat;
  animation: skeleton-shine 1.4s linear infinite;
  border-radius: var(--radius-md);
  height: 100px;
}

.skeleton-line-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Container that maps to a card shape — used to wrap multi-line skeletons
   inside a card outline so the layout doesn't jump when content arrives. */
.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer,
  .skeleton-text,
  .skeleton-circle,
  .skeleton-block {
    animation: none !important;
    background-image: none !important;
  }
}

/* --------------------------------------------------------------------------
   14. Snackbar

   A self-contained, dependency-free replacement for toastr. Renders into a
   single #hrbot-snackbar-root container that the toast helper auto-creates
   on first call, so any page can use it without extra markup.
   -------------------------------------------------------------------------- */

#hrbot-snackbar-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.hrbot-snackbar {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  padding: 12px 14px 12px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  box-shadow:
    0 12px 30px -8px rgba(15, 23, 42, 0.35),
    0 4px 12px rgba(15, 23, 42, 0.18);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(20px) scale(0.96);
  transition:
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.hrbot-snackbar.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.hrbot-snackbar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #94a3b8;
}

.hrbot-snackbar--success::before {
  background: #22c55e;
}
.hrbot-snackbar--error::before {
  background: #ef4444;
}
.hrbot-snackbar--warning::before {
  background: #f59e0b;
}
.hrbot-snackbar--info::before {
  background: #3b82f6;
}

.hrbot-snackbar__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  margin-top: 1px;
}

.hrbot-snackbar--success .hrbot-snackbar__icon {
  color: #4ade80;
}
.hrbot-snackbar--error .hrbot-snackbar__icon {
  color: #fca5a5;
}
.hrbot-snackbar--warning .hrbot-snackbar__icon {
  color: #fcd34d;
}
.hrbot-snackbar--info .hrbot-snackbar__icon {
  color: #93c5fd;
}

.hrbot-snackbar__body {
  flex: 1;
  min-width: 0;
}

.hrbot-snackbar__close {
  flex-shrink: 0;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  padding: 0;
  margin-left: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.hrbot-snackbar__close:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hrbot-snackbar.is-leaving {
  opacity: 0;
  transform: translateX(20px) scale(0.96);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

@media (max-width: 480px) {
  #hrbot-snackbar-root {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .hrbot-snackbar {
    min-width: 0;
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   15. Index page — live clock chip
   -------------------------------------------------------------------------- */
.live-clock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  color: var(--color-slate);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.live-clock-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}
