/* =====================================================================
   Claymorphism theme — shared by every web page.
   Injected by app.py (inject_theme_and_idle_timer). All rules are scoped
   under html.clay so they out-rank each page's own inline <style> block.
   ===================================================================== */

:root {
  --c-bg: #d9ddf6;
  --c-surface: #fbfbff;
  --c-text: #252845;
  --c-muted: #5b5f88;
  --c-heading: #181a3a;
  --c-line: rgba(91, 95, 136, 0.16);

  --c-primary: #6453f5;   --c-primary-rgb: 100, 83, 245;   --c-primary-ink: #4433d6;
  --c-success: #1fae78;   --c-success-rgb: 31, 174, 120;   --c-success-ink: #117a52;
  --c-danger:  #f24e6a;   --c-danger-rgb: 242, 78, 106;    --c-danger-ink: #c52643;
  --c-warning: #f6a02a;   --c-warning-rgb: 246, 160, 42;   --c-warning-ink: #935800;
  --c-info:    #229fdc;   --c-info-rgb: 34, 159, 220;      --c-info-ink: #0f6f9f;
  --c-neutral: #ffffff;   --c-neutral-rgb: 120, 126, 180;  --c-neutral-ink: #3f4370;

  --c-radius: 26px;
  --c-radius-md: 18px;
  --c-radius-sm: 14px;

  /* Clay = soft outer drop shadow + inner highlight/shade, so surfaces look puffy */
  --clay-card:
    14px 18px 36px rgba(4, 12, 48, 0.45),
    -4px -4px 14px rgba(255, 255, 255, 0.10),
    inset -6px -6px 14px rgba(var(--c-primary-rgb), 0.10),
    inset 5px 5px 12px rgba(255, 255, 255, 0.95);
  --clay-card-sm:
    8px 12px 22px rgba(4, 12, 48, 0.40),
    -3px -3px 10px rgba(255, 255, 255, 0.10),
    inset -3px -3px 8px rgba(var(--c-primary-rgb), 0.09),
    inset 3px 3px 8px rgba(255, 255, 255, 0.95);
  --clay-input:
    inset 4px 4px 9px rgba(var(--c-primary-rgb), 0.18),
    inset -4px -4px 9px rgba(255, 255, 255, 0.95);
}

/* ---------- Page ---------- */
/* Animated mesh-gradient backdrop: a fixed <canvas id="app-backdrop"> drawn by
   app-theme.js. This gradient is the static fallback (no WebGL / before first frame). */
html.clay {
  background-color: #16328f !important;
  background-image: linear-gradient(30deg, #0a1a4a 0%, #1f4fd8 55%, #4c9bff 100%) !important;
  background-attachment: fixed !important;
  color: var(--c-text) !important;
}
html.clay body {
  background: transparent !important;
  color: var(--c-text) !important;
}
#app-backdrop {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: -1; pointer-events: none; display: block;
}
/* Text that sits straight on the backdrop */
html.clay .emp-head .emp-eyebrow, html.clay .emp-head .emp-sub, html.clay .emp-section-label { color: rgba(255,255,255,.78) !important; }
html.clay .emp-head .emp-title, html.clay .emp-head h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(5, 15, 50, .35); }
html.clay body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  min-height: 100vh;
}
html.clay h1, html.clay h2, html.clay h3, html.clay h4, html.clay h5, html.clay h6,
html.clay .h1, html.clay .h2, html.clay .h3, html.clay .h4, html.clay .h5, html.clay .h6 {
  color: var(--c-heading) !important;
  font-weight: 800;
  -webkit-text-fill-color: currentColor;
  background-image: none;
}
html.clay h1 i, html.clay h2 i, html.clay h3 i, html.clay h4 i, html.clay h5 i,
html.clay .section-title i { color: var(--c-primary) !important; }
html.clay a { color: var(--c-primary-ink); }
html.clay .text-muted, html.clay small.text-muted, html.clay .muted, html.clay .hint,
html.clay .form-text { color: var(--c-muted) !important; }
html.clay .text-white, html.clay .text-light, html.clay .text-white-50,
html.clay [style*="color: #fff"], html.clay [style*="color:#fff"],
html.clay [style*="color: white"], html.clay [style*="color:white"] {
  color: var(--c-text) !important;
}
html.clay .text-primary { color: var(--c-primary-ink) !important; }
html.clay .text-success { color: var(--c-success-ink) !important; }
html.clay .text-danger  { color: var(--c-danger-ink) !important; }
html.clay .text-warning { color: var(--c-warning-ink) !important; }
html.clay .text-info    { color: var(--c-info-ink) !important; }
html.clay .text-dark    { color: var(--c-heading) !important; }
html.clay .text-secondary { color: var(--c-muted) !important; }
html.clay hr { border-color: var(--c-line); opacity: 1; }

/* ---------- Standard top bar (Back left, Dashboard right) ---------- */
html.clay .app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 0 24px;
  position: relative;
  z-index: 1030;
}
html.clay .app-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-primary-ink) !important;
  font: 700 0.95rem/1.2 'Nunito', system-ui, sans-serif;
  text-decoration: none !important;
  box-shadow: var(--clay-card-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
html.clay .app-topbar-home { color: var(--c-neutral-ink) !important; padding: 10px 18px 10px 16px; }
html.clay .app-topbar-back .lbl-short { display: none; }
html.clay .app-topbar.floating { position: fixed; top: 0; right: 0; margin: 14px 0 0; }
html.clay .app-topbar-back {
  background: var(--c-primary); color: #fff !important;
  box-shadow: 6px 8px 18px rgba(var(--c-primary-rgb), .38), inset -4px -4px 8px rgba(0,0,0,.12), inset 4px 4px 8px rgba(255,255,255,.35);
}
html.clay .app-topbar-btn:hover { transform: translateY(-2px); }
html.clay .app-topbar-btn:active { transform: translateY(1px); box-shadow: var(--clay-input); }
html.clay .app-topbar-btn:focus-visible { outline: 3px solid rgba(var(--c-primary-rgb), .45); outline-offset: 3px; }
/* Pages with a fixed navbar: keep it in flow below the bar */
html.clay.has-topbar .navbar.fixed-top { position: relative !important; }
html.clay.has-topbar .navbar.fixed-top ~ .container,
html.clay.has-topbar .navbar.fixed-top ~ .container-fluid { margin-top: 28px !important; }
html.clay.has-topbar .breadcrumb { display: none !important; }
@media (max-width: 575.98px) {
  html.clay .app-topbar { margin-top: 12px; padding: 0 12px; }
  html.clay .app-topbar { gap: 8px; }
  html.clay .app-topbar-home { padding: 9px 12px !important; }
  html.clay .app-topbar-home span { display: none; }
  html.clay .app-topbar-back .lbl-long { display: none; }
  html.clay .app-topbar-back .lbl-short { display: inline; }
  html.clay .app-topbar-btn { padding: 9px 14px 9px 11px; font-size: .9rem; }
}

/* ---------- Bars & page headers ---------- */
html.clay .navbar, html.clay .navbar-custom, html.clay .top-bar, html.clay .header-bar,
html.clay .page-header, html.clay .header-section, html.clay .login-header,
html.clay .live-header, html.clay .status-bar,
html.clay .action-bar, html.clay .card-header, html.clay .card-header-custom,
html.clay .modal-header, html.clay .notif-header {
  background: var(--c-surface) !important;
  background-image: none !important;
  color: var(--c-heading) !important;
  border: 0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html.clay .navbar, html.clay .navbar-custom, html.clay .top-bar, html.clay .header-bar,
html.clay .page-header, html.clay .header-section, html.clay .live-header,
html.clay .status-bar, html.clay .action-bar {
  box-shadow: var(--clay-card) !important;
  border-radius: var(--c-radius) !important;
}
html.clay .navbar.fixed-top, html.clay .navbar.sticky-top { border-radius: 0 0 var(--c-radius) var(--c-radius) !important; }
html.clay .card-header, html.clay .modal-header, html.clay .notif-header, html.clay .login-header {
  box-shadow: none !important;
  border-bottom: 1px solid var(--c-line) !important;
}
html.clay .navbar *, html.clay .navbar-custom *, html.clay .top-bar *, html.clay .header-bar *,
html.clay .page-header *, html.clay .header-section *, html.clay .login-header *,
html.clay .live-header *, html.clay .card-header *,
html.clay .modal-header *, html.clay .notif-header * {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}
html.clay .navbar-brand, html.clay .navbar h1, html.clay .navbar-brand * { color: var(--c-heading) !important; }
html.clay .navbar .nav-link { color: var(--c-text) !important; }
html.clay .navbar .nav-link.active, html.clay .navbar .nav-link:hover { color: var(--c-primary-ink) !important; }
html.clay .breadcrumb { background: transparent !important; }
html.clay .breadcrumb-item, html.clay .breadcrumb-item a { color: var(--c-muted) !important; }

/* ---------- Clay surfaces ---------- */
html.clay .card, html.clay .cardx, html.clay .panel, html.clay .dashboard-card,
html.clay .stat-card, html.clay .summary-card, html.clay .info-card, html.clay .info-box,
html.clay .profile-card, html.clay .details-card, html.clay .employee-card,
html.clay .feature-card, html.clay .history-card, html.clay .request-card,
html.clay .work-card, html.clay .welcome-card, html.clay .visitor-card, html.clay .setup-card,
html.clay .tpl-card, html.clay .sign-card, html.clay .filter-section, html.clay .filter-form,
html.clay .filter-form-card, html.clay .filter-card, html.clay .form-section,
html.clay .table-container, html.clay .table-section, html.clay .export-section,
html.clay .page-container, html.clay .login-box, html.clay .login-card,
html.clay .login-container, html.clay .verify-box, html.clay .qr-box, html.clay .trigger-box,
html.clay .detail-panel, html.clay .logout-section, html.clay .pv-box, html.clay .box,
html.clay .modal-content, html.clay .notif-panel, html.clay .dropdown-menu,
html.clay .list-group, html.clay .accordion-item, html.clay .clay-card {
  background: var(--c-surface) !important;
  background-image: none !important;
  color: var(--c-text) !important;
  border: 0 !important;
  border-radius: var(--c-radius) !important;
  box-shadow: var(--clay-card) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html.clay .card-body, html.clay .card-footer, html.clay .modal-body, html.clay .modal-footer,
html.clay .list-group-item, html.clay .accordion-button, html.clay .accordion-body {
  background: transparent !important;
  color: var(--c-text) !important;
  border-color: var(--c-line) !important;
}
html.clay a.dashboard-card, html.clay a .dashboard-card, html.clay .dashboard-card[onclick],
html.clay a.feature-card, html.clay .feature-card[onclick], html.clay a.card, html.clay .clay-tile {
  transition: box-shadow .2s ease, transform .2s ease;
  text-decoration: none;
}
html.clay a.dashboard-card:hover, html.clay a:hover .dashboard-card, html.clay .dashboard-card[onclick]:hover,
html.clay a.feature-card:hover, html.clay .feature-card[onclick]:hover, html.clay a.card:hover,
html.clay .clay-tile:hover {
  transform: translateY(-4px);
}
html.clay a.dashboard-card:active, html.clay .dashboard-card[onclick]:active,
html.clay a.feature-card:active, html.clay a.card:active, html.clay .clay-tile:active {
  transform: translateY(1px) scale(.99);
}
html.clay .dashboard-card i, html.clay .feature-card i, html.clay .feature-icon,
html.clay .stat-card i, html.clay .summary-card i {
  color: var(--c-primary) !important;
  -webkit-text-fill-color: currentColor;
  background-image: none !important;
}
html.clay .feature-icon, html.clay .stat-icon {
  background: rgba(var(--c-primary-rgb), .12) !important;
  border-radius: 18px !important;
  box-shadow: inset 3px 3px 6px rgba(255,255,255,.8), inset -3px -3px 6px rgba(var(--c-primary-rgb), .12) !important;
}
html.clay .stat-number, html.clay .summary-value, html.clay .stat-value { color: var(--c-heading) !important; font-weight: 800; }
html.clay .stat-label, html.clay .summary-label { color: var(--c-muted) !important; }
html.clay .section-title { color: var(--c-heading) !important; background: transparent !important; }

/* Soft wells */
html.clay .search-bar, html.clay .search-box, html.clay .snap-box, html.clay .feed-box,
html.clay .map-container, html.clay .preview-img-container, html.clay .no-data {
  background: var(--c-bg) !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: var(--c-radius-md) !important;
  box-shadow: var(--clay-input) !important;
  color: var(--c-muted) !important;
}
html.clay .profile-photo-container {
  background: var(--c-surface) !important;
  border: 0 !important;
  box-shadow: var(--clay-card) !important;
  padding: 6px;
}
html.clay .profile-photo-container img { border-radius: 50%; }

/* ---------- Buttons: coloured clay ---------- */
html.clay .btn, html.clay button:not(.btn-close):not(.navbar-toggler):not(.accordion-button):not(.gm-style *):not(.leaflet-container *),
html.clay input[type="submit"], html.clay input[type="button"],
html.clay .btn-back, html.clay .btn-back-dashboard, html.clay .btn-dashboard, html.clay .btn-login,
html.clay .btn-logout, html.clay .logout-btn, html.clay .btn-verify, html.clay .btn-track,
html.clay .btn-payroll, html.clay .btn-action, html.clay .btn-filter, html.clay .btn-export,
html.clay .btn-excel, html.clay .btn-pdf, html.clay .btn-save, html.clay .btn-map,
html.clay .btn-bill-view, html.clay .btn-submit-request, html.clay .login-trigger,
html.clay .channel-btn, html.clay .expand-btn, html.clay .resend-btn, html.clay .test-lan-btn,
html.clay .back-link {
  --btn-rgb: var(--c-neutral-rgb);
  --btn-bg: var(--c-surface);
  --btn-ink: var(--c-primary-ink);
  background: var(--btn-bg) !important;
  background-image: none !important;
  color: var(--btn-ink) !important;
  -webkit-text-fill-color: currentColor;
  border: 0 !important;
  border-radius: var(--c-radius-sm) !important;
  box-shadow:
    6px 8px 16px rgba(var(--btn-rgb), .32),
    inset -4px -4px 8px rgba(0, 0, 0, .10),
    inset 4px 4px 8px rgba(255, 255, 255, .45) !important;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none !important;
  transition: box-shadow .15s ease, transform .15s ease, filter .15s ease;
}
html.clay .btn:hover, html.clay button:not(.btn-close):not(.navbar-toggler):not(.gm-style *):not(.leaflet-container *):hover,
html.clay .btn-back:hover, html.clay .btn-dashboard:hover, html.clay .logout-btn:hover,
html.clay .back-link:hover, html.clay input[type="submit"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  color: var(--btn-ink) !important;
}
html.clay .btn:active, html.clay .btn.active, html.clay button:not(.btn-close):not(.navbar-toggler):not(.gm-style *):not(.leaflet-container *):active,
html.clay .btn-check:checked + .btn, html.clay input[type="submit"]:active {
  transform: translateY(1px);
  box-shadow:
    2px 3px 6px rgba(var(--btn-rgb), .3),
    inset -2px -2px 5px rgba(255, 255, 255, .35),
    inset 3px 3px 7px rgba(0, 0, 0, .14) !important;
}
html.clay .btn:focus-visible, html.clay button:focus-visible {
  outline: 3px solid rgba(var(--c-primary-rgb), .45);
  outline-offset: 2px;
}
html.clay .btn:disabled, html.clay .btn.disabled, html.clay button:disabled {
  opacity: .55;
  transform: none;
}
html.clay .btn i, html.clay button i { color: inherit !important; }

/* Solid colour clay: white label on a pastel fill */
html.clay .btn-primary, html.clay .btn-filter, html.clay .btn-login, html.clay .btn-verify,
html.clay .btn-save, html.clay .btn-submit-request, html.clay .btn-track, html.clay .login-trigger,
html.clay button[type="submit"]:not([class*="btn-"]), html.clay input[type="submit"] {
  --btn-rgb: var(--c-primary-rgb) !important; --btn-bg: var(--c-primary) !important; --btn-ink: #fff !important;
}
html.clay .btn-success, html.clay .btn-excel, html.clay .btn-payroll {
  --btn-rgb: var(--c-success-rgb) !important; --btn-bg: var(--c-success) !important; --btn-ink: #fff !important;
}
html.clay .btn-danger, html.clay .btn-logout, html.clay .logout-btn, html.clay .btn-pdf, html.clay .remove-btn {
  --btn-rgb: var(--c-danger-rgb) !important; --btn-bg: var(--c-danger) !important; --btn-ink: #fff !important;
}
html.clay .btn-warning { --btn-rgb: var(--c-warning-rgb) !important; --btn-bg: var(--c-warning) !important; --btn-ink: #4a2f00 !important; }
html.clay .btn-info, html.clay .btn-map, html.clay .btn-export {
  --btn-rgb: var(--c-info-rgb) !important; --btn-bg: var(--c-info) !important; --btn-ink: #fff !important;
}
/* Soft (white clay) buttons: coloured label */
html.clay .btn-outline-primary, html.clay .btn-bill-view { --btn-rgb: var(--c-primary-rgb) !important; --btn-ink: var(--c-primary-ink) !important; }
html.clay .btn-outline-success { --btn-rgb: var(--c-success-rgb) !important; --btn-ink: var(--c-success-ink) !important; }
html.clay .btn-outline-danger  { --btn-rgb: var(--c-danger-rgb) !important;  --btn-ink: var(--c-danger-ink) !important; }
html.clay .btn-outline-warning { --btn-rgb: var(--c-warning-rgb) !important; --btn-ink: var(--c-warning-ink) !important; }
html.clay .btn-outline-info    { --btn-rgb: var(--c-info-rgb) !important;    --btn-ink: var(--c-info-ink) !important; }
html.clay .btn-secondary, html.clay .btn-outline-secondary, html.clay .btn-dark,
html.clay .btn-outline-dark, html.clay .btn-light, html.clay .btn-outline-light,
html.clay .btn-back, html.clay .btn-back-dashboard, html.clay .btn-dashboard,
html.clay .back-link { --btn-rgb: var(--c-neutral-rgb) !important; --btn-ink: var(--c-neutral-ink) !important; }
html.clay .btn-link { box-shadow: none !important; --btn-ink: var(--c-primary-ink); }
html.clay .btn-close { filter: none !important; opacity: .6; }

/* Icon-only action buttons in table rows */
html.clay .table-actions { white-space: nowrap; }
.icon-actions { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 10px; }
html.clay .icon-action {
  width: 38px; height: 38px; padding: 0 !important;
  display: inline-grid !important; place-items: center;
  border-radius: 12px !important; font-size: .95rem; line-height: 1;
}

/* ---------- Forms ---------- */
html.clay .form-control, html.clay .form-select, html.clay input[type="text"], html.clay input[type="email"],
html.clay input[type="password"], html.clay input[type="number"], html.clay input[type="tel"],
html.clay input[type="date"], html.clay input[type="month"], html.clay input[type="time"],
html.clay input[type="datetime-local"], html.clay input[type="search"], html.clay input[type="url"],
html.clay input[type="file"], html.clay input:not([type]), html.clay select, html.clay textarea,
html.clay .search-bar input, html.clay .input-group-text {
  background-color: #fff !important;
  background-image: none;
  color: var(--c-text) !important;
  -webkit-text-fill-color: currentColor;
  border: 2px solid transparent !important;
  border-radius: var(--c-radius-sm) !important;
  box-shadow: var(--clay-input) !important;
  font-weight: 600;
}
html.clay .form-select, html.clay select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237b6cf6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right .9rem center !important;
  background-size: 14px 10px !important;
  padding-right: 2.4rem !important;
  -webkit-appearance: none;
  appearance: none;
}
html.clay .form-control:focus, html.clay .form-select:focus, html.clay input:focus,
html.clay select:focus, html.clay textarea:focus {
  outline: none !important;
  border-color: rgba(var(--c-primary-rgb), .55) !important;
  box-shadow: var(--clay-input), 0 0 0 4px rgba(var(--c-primary-rgb), .15) !important;
}
html.clay .is-invalid { border-color: rgba(var(--c-danger-rgb), .7) !important; }
html.clay ::placeholder { color: #a2a5c0 !important; opacity: 1; }
html.clay .form-label, html.clay label { color: var(--c-text) !important; font-weight: 700; }
html.clay .input-group > * { box-shadow: none !important; }
html.clay .input-group { border-radius: var(--c-radius-sm); box-shadow: var(--clay-input); }
html.clay .form-check-input {
  background-color: #fff !important;
  border: 2px solid rgba(var(--c-primary-rgb), .35) !important;
  box-shadow: none !important;
}
html.clay .form-check-input:checked { background-color: var(--c-primary) !important; border-color: var(--c-primary) !important; }
html.clay .form-switch .form-check-input:checked { background-color: var(--c-success) !important; border-color: var(--c-success) !important; }

/* ---------- Tables ---------- */
html.clay .table, html.clay table.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--c-text);
  --bs-table-striped-bg: rgba(var(--c-primary-rgb), .035);
  --bs-table-striped-color: var(--c-text);
  --bs-table-hover-bg: rgba(var(--c-primary-rgb), .07);
  --bs-table-hover-color: var(--c-text);
  --bs-table-border-color: var(--c-line);
  --bs-table-accent-bg: transparent;
  background: transparent !important;
  color: var(--c-text) !important;
  border-color: var(--c-line) !important;
  margin-bottom: 0;
}
html.clay table:not(.table-profile) { border-collapse: separate !important; border-spacing: 0; }
html.clay .table-responsive, html.clay .table-wrapper {
  background: var(--c-surface) !important;
  border-radius: var(--c-radius) !important;
  box-shadow: var(--clay-card) !important;
  border: 0 !important;
  padding: 10px;
}
html.clay .table-container .table-responsive, html.clay .card .table-responsive,
html.clay .panel .table-responsive, html.clay .cardx .table-responsive,
html.clay .clay-card .table-responsive, html.clay .history-card .table-responsive {
  box-shadow: none !important;
  padding: 0;
}
html.clay table th, html.clay table td {
  background-color: transparent !important;
  background-image: none !important;
  color: inherit;
  border-color: var(--c-line) !important;
  box-shadow: none !important;
}
html.clay table td { color: var(--c-text); }
html.clay thead, html.clay thead tr, html.clay .table-dark, html.clay .table-light,
html.clay .thead-dark, html.clay .thead-light, html.clay .table thead {
  background: transparent !important;
  background-image: none !important;
  --bs-table-bg: transparent;
  --bs-table-color: var(--c-heading);
}
html.clay thead th, html.clay .table-dark th, html.clay .table th {
  color: var(--c-primary-ink) !important;
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background-color: rgba(var(--c-primary-rgb), .13) !important;
  border-bottom: 0 !important;
}
html.clay thead th:first-child { border-radius: 14px 0 0 14px; }
html.clay thead th:last-child { border-radius: 0 14px 14px 0; }
html.clay thead th i { color: var(--c-primary) !important; }
html.clay .table-hover > tbody > tr:hover > * { background-color: rgba(var(--c-primary-rgb), .06) !important; }
html.clay .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(var(--c-primary-rgb), .03) !important; }
html.clay .table-profile th {
  color: var(--c-muted) !important; text-transform: none; letter-spacing: 0; font-size: .95rem;
  background-color: rgba(var(--c-primary-rgb), .05) !important;
}
html.clay .table-success > *, html.clay tr.table-success > * { background-color: rgba(var(--c-success-rgb), .10) !important; }
html.clay .table-danger > *, html.clay tr.table-danger > * { background-color: rgba(var(--c-danger-rgb), .10) !important; }
html.clay .table-warning > *, html.clay tr.table-warning > * { background-color: rgba(var(--c-warning-rgb), .12) !important; }
html.clay .table-info > *, html.clay tr.table-info > * { background-color: rgba(var(--c-info-rgb), .10) !important; }

/* ---------- Badges: pastel clay pills ---------- */
html.clay .badge, html.clay .status-badge, html.clay .badge-status, html.clay .permission-badge,
html.clay .renewal-pill, html.clay .tpl-badge, html.clay .clay-chip {
  --badge-rgb: var(--c-neutral-rgb);
  --badge-ink: var(--c-neutral-ink);
  background: rgba(var(--badge-rgb), .22) !important;
  background-image: none !important;
  color: var(--badge-ink) !important;
  -webkit-text-fill-color: currentColor;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.7), inset -2px -2px 4px rgba(var(--badge-rgb), .18) !important;
  font-weight: 800;
  padding: .4em .85em;
}
html.clay .badge.bg-primary, html.clay .badge.text-bg-primary, html.clay .permission-badge.write,
html.clay .badge-shop-manager, html.clay .clay-chip.primary { --badge-rgb: var(--c-primary-rgb); --badge-ink: var(--c-primary-ink); }
html.clay .badge.bg-success, html.clay .badge.text-bg-success, html.clay .badge-in,
html.clay .renewal-pill.green, html.clay .clay-chip.success { --badge-rgb: var(--c-success-rgb); --badge-ink: var(--c-success-ink); }
html.clay .badge.bg-danger, html.clay .badge.text-bg-danger, html.clay .badge-delete,
html.clay .permission-badge.delete, html.clay .renewal-pill.red, html.clay .clay-chip.danger { --badge-rgb: var(--c-danger-rgb); --badge-ink: var(--c-danger-ink); }
html.clay .badge.bg-warning, html.clay .badge.text-bg-warning, html.clay .badge-edit,
html.clay .renewal-pill.orange, html.clay .renewal-pill.yellow, html.clay .clay-chip.warning { --badge-rgb: var(--c-warning-rgb); --badge-ink: var(--c-warning-ink); }
html.clay .badge.bg-info, html.clay .badge.text-bg-info, html.clay .permission-badge.export,
html.clay .badge-system, html.clay .clay-chip.info { --badge-rgb: var(--c-info-rgb); --badge-ink: var(--c-info-ink); }

/* ---------- Alerts ---------- */
html.clay .alert {
  --alert-rgb: var(--c-neutral-rgb);
  background: rgba(var(--alert-rgb), .14) !important;
  color: var(--c-text) !important;
  border: 0 !important;
  border-radius: var(--c-radius-md) !important;
  box-shadow: inset 3px 3px 7px rgba(255,255,255,.7), inset -3px -3px 7px rgba(var(--alert-rgb), .15) !important;
  font-weight: 600;
}
html.clay .alert-success { --alert-rgb: var(--c-success-rgb); }
html.clay .alert-danger  { --alert-rgb: var(--c-danger-rgb); }
html.clay .alert-warning { --alert-rgb: var(--c-warning-rgb); }
html.clay .alert-info, html.clay .alert-primary { --alert-rgb: var(--c-info-rgb); }

/* ---------- Tabs, pills, pagination ---------- */
html.clay .nav-tabs { border-bottom: 0 !important; gap: .6rem; }
html.clay .nav-tabs .nav-link, html.clay .nav-pills .nav-link, html.clay .page-link {
  background: var(--c-surface) !important;
  color: var(--c-text) !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: var(--clay-card-sm) !important;
  font-weight: 700;
  margin-bottom: .3rem;
}
html.clay .nav-tabs .nav-link.active, html.clay .nav-pills .nav-link.active, html.clay .page-item.active .page-link {
  background: var(--c-primary) !important;
  color: #fff !important;
  box-shadow: 6px 8px 16px rgba(var(--c-primary-rgb), .32), inset -3px -3px 7px rgba(0,0,0,.1), inset 3px 3px 7px rgba(255,255,255,.35) !important;
}
html.clay .pagination { gap: .5rem; }
html.clay .page-item.disabled .page-link { opacity: .5; }

/* Gradient-clipped headline text becomes solid, readable text */
html.clay .welcome-header {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--c-heading) !important;
}

/* ---------- Misc ---------- */
html.clay .placeholder {
  background: var(--c-bg) !important;
  color: var(--c-muted) !important;
  box-shadow: var(--clay-input) !important;
  opacity: 1;
}
html.clay .modal-backdrop.show { opacity: .3; }
html.clay .progress { background: #fff !important; box-shadow: var(--clay-input); border-radius: 999px; }
html.clay .dropdown-item { color: var(--c-text) !important; }
html.clay .dropdown-item:hover { background: rgba(var(--c-primary-rgb), .08) !important; }
/* Bootstrap "white box" utilities become clay surfaces (never the page body,
   which stays transparent so the animated backdrop shows through). */
html.clay .bg-white:not(body), html.clay .bg-light:not(body), html.clay .bg-dark:not(body),
html.clay .bg-body:not(body), html.clay .bg-body-tertiary:not(body) {
  background-color: var(--c-surface) !important;
  border-color: transparent !important;
}
html.clay form.bg-white, html.clay div.bg-white.rounded, html.clay .table-responsive.bg-white {
  border-radius: var(--c-radius) !important;
  box-shadow: var(--clay-card) !important;
}
html.clay .shadow, html.clay .shadow-sm, html.clay .shadow-lg { box-shadow: var(--clay-card) !important; }
html.clay .border:not(.form-control):not(.btn) { border-color: var(--c-line) !important; }
html.clay img.rounded-circle, html.clay .employee-photo, html.clay .photo-thumb {
  box-shadow: var(--clay-card-sm);
  border: 3px solid #fff !important;
}
html.clay footer, html.clay .footer { background: transparent !important; color: var(--c-muted) !important; }

/* ---------- Idle-logout warning ---------- */
#app-idle-warning {
  position: fixed; inset: 0; z-index: 2147483000;
  display: none; align-items: center; justify-content: center;
  background: rgba(31, 33, 64, .3);
  font-family: 'Nunito', system-ui, sans-serif;
}
#app-idle-warning.show { display: flex; }
#app-idle-warning .idle-card {
  background: var(--c-surface); color: var(--c-text);
  border-radius: 28px; padding: 28px 30px; width: min(380px, calc(100vw - 32px));
  box-shadow: var(--clay-card);
  text-align: center;
}
#app-idle-warning h5 { margin: 0 0 6px; font-weight: 800; color: var(--c-heading); }
#app-idle-warning p { margin: 0 0 16px; color: var(--c-muted); font-size: .95rem; }
#app-idle-warning .idle-count { font-size: 2.4rem; font-weight: 800; color: var(--c-danger-ink); margin-bottom: 16px; }
#app-idle-warning .idle-actions { display: flex; gap: 12px; justify-content: center; }
#app-idle-warning button {
  border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 6px 8px 16px rgba(var(--c-primary-rgb), .3), inset -3px -3px 7px rgba(0,0,0,.1), inset 3px 3px 7px rgba(255,255,255,.4);
}
#app-idle-warning button.stay { background: var(--c-primary); color: #fff; }
#app-idle-warning button.leave { background: #fff; color: var(--c-danger-ink); }

/* =====================================================================
   Employee page components (attendance home, expenses, advance)
   ===================================================================== */
.emp-shell { max-width: 760px; margin: 0 auto; padding: 12px 16px 48px; display: grid; gap: 22px; }
.emp-shell.wide { max-width: 1100px; }
.emp-eyebrow { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.emp-title { margin: 2px 0 0; font-size: clamp(1.4rem, 3.6vw, 1.9rem); font-weight: 800; color: var(--c-heading); }
.emp-sub { margin: 4px 0 0; color: var(--c-muted); font-weight: 600; }
.emp-section-label { margin: 0 0 12px 4px; font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
html.clay .clay-card { padding: 22px; }
.emp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Round icon bubble */
.clay-icon {
  --icon-rgb: var(--c-primary-rgb);
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.35rem;
  color: rgb(var(--icon-rgb));
  background: rgba(var(--icon-rgb), .15);
  box-shadow: inset 3px 3px 6px rgba(255,255,255,.8), inset -3px -3px 6px rgba(var(--icon-rgb), .18);
}
.clay-icon.success { --icon-rgb: var(--c-success-rgb); }
.clay-icon.danger  { --icon-rgb: var(--c-danger-rgb); }
.clay-icon.warning { --icon-rgb: var(--c-warning-rgb); }
.clay-icon.info    { --icon-rgb: var(--c-info-rgb); }

/* Quick-action tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.clay-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 18px; border-radius: 24px; background: var(--c-surface);
  box-shadow: var(--clay-card-sm); color: var(--c-heading) !important; font-weight: 800;
  text-decoration: none !important;
}
.clay-tile small { color: var(--c-muted); font-weight: 600; margin-top: -8px; }
.tile-badge {
  position: absolute; top: 12px; right: 12px; min-width: 26px; height: 26px; padding: 0 8px;
  border-radius: 999px; display: grid; place-items: center; font-size: .78rem; font-weight: 800;
  color: #fff; background: var(--c-danger);
  box-shadow: 3px 4px 8px rgba(var(--c-danger-rgb), .35), inset 2px 2px 4px rgba(255,255,255,.35);
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.clay-stat { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--c-surface); box-shadow: var(--clay-card-sm); }
.clay-stat .label { margin: 0; font-size: .8rem; font-weight: 800; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.clay-stat .value { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--c-heading); font-variant-numeric: tabular-nums; }

/* List rows (tables that become cards on phones) */
.clay-list { width: 100%; }
.clay-list td, .clay-list th { padding: 14px 12px !important; vertical-align: middle; }
.clay-list tbody tr + tr td { border-top: 1px solid var(--c-line) !important; }
.clay-list td.num { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--c-heading); white-space: nowrap; }
.clay-list .empty { text-align: center; color: var(--c-muted); padding: 36px 12px !important; font-weight: 600; }
.reason-note { margin-top: 6px; font-size: .82rem; color: var(--c-danger-ink); font-weight: 600; }
@media (max-width: 640px) {
  .clay-list thead { display: none; }
  .clay-list, .clay-list tbody, .clay-list tr, .clay-list td { display: block; width: 100%; }
  .clay-list tr { padding: 12px 4px; }
  .clay-list tbody tr + tr { border-top: 1px solid var(--c-line); }
  .clay-list tbody tr + tr td { border-top: 0 !important; }
  .clay-list td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px !important; text-align: right; }
  .clay-list td::before { content: attr(data-label); font-weight: 800; color: var(--c-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  .clay-list td.empty { display: block; text-align: center; }
  .clay-list td.empty::before { content: none; }
}

/* =====================================================================
   Spotlight glow on dashboard cards (vanilla port of the GlowCard
   React component). app-theme.js adds [data-glow] + an inner glow layer
   and writes the pointer position to --x / --y / --xp on <html>.
   ===================================================================== */
html.clay [data-glow].glow-card {
  --base: 215;               /* backdrop blue */
  --spread: 80;              /* shifts toward violet across the screen */
  --radius: 26;
  --border-size: 2px;
  --spotlight-size: 240px;
  --hue: calc(var(--base) + (var(--xp, 0) * var(--spread, 0)));
  position: relative;
  isolation: isolate;
  border: var(--border-size) solid rgba(255, 255, 255, .65) !important;
  background-color: var(--c-surface) !important;
  background-image: radial-gradient(
    var(--spotlight-size) var(--spotlight-size) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 70% / .16), transparent
  ) !important;
  background-attachment: fixed !important;
}
html.clay [data-glow].glow-card::before,
html.clay [data-glow].glow-card::after {
  pointer-events: none;
  content: "";
  position: absolute;
  inset: calc(var(--border-size) * -1);
  border: var(--border-size) solid transparent;
  border-radius: calc(var(--radius) * 1px);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  -webkit-mask-clip: padding-box, border-box;
  -webkit-mask-composite: source-in;
  mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  mask-clip: padding-box, border-box;
  mask-composite: intersect;
}
/* coloured ring that follows the pointer */
html.clay [data-glow].glow-card::before {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .75) calc(var(--spotlight-size) * .75) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 55% / 1), transparent 100%
  );
  filter: brightness(1.4);
}
/* bright core on the ring */
html.clay [data-glow].glow-card::after {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .4) calc(var(--spotlight-size) * .4) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(0 100% 100% / .9), transparent 100%
  );
}
/* soft outer bloom */
html.clay [data-glow].glow-card > .glow-bloom {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: calc(var(--radius) * 1px);
  filter: blur(18px);
  opacity: .55;
}
html.clay [data-glow].glow-card > .glow-bloom::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 10px solid transparent;
  background-attachment: fixed;
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .75) calc(var(--spotlight-size) * .75) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 60% / 1), transparent 100%
  );
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  -webkit-mask-clip: padding-box, border-box;
  -webkit-mask-composite: source-in;
  mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  mask-clip: padding-box, border-box;
  mask-composite: intersect;
}


/* =====================================================================
   Rolling-digit clock in the top bar (built by app-theme.js).
   Each digit column holds stacked numbers; .move rolls it up one slot.
   ===================================================================== */
.app-clock {
  --clock-h: 30px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  font: 800 26px/1 'Nunito', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(145deg, #1d2d78, #0a1440);
  box-shadow:
    8px 12px 22px rgba(4, 12, 48, .45),
    inset -4px -4px 8px rgba(0, 0, 0, .25),
    inset 3px 3px 7px rgba(255, 255, 255, .18);
  user-select: none;
}
.app-clock:empty { display: none; }
.app-clock .unit {
  display: flex;
  height: var(--clock-h);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.app-clock .col { display: block; width: .6em; text-align: center; }
.app-clock .number { height: var(--clock-h); line-height: var(--clock-h); }
.app-clock .tick { line-height: var(--clock-h); margin-top: -3px; opacity: .75; padding: 0 1px; }
.app-clock .seconds { color: #9ec5ff; }
.app-clock .move { animation: app-clock-move linear 1s infinite; }
@keyframes app-clock-move {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(var(--clock-h) * -1)); }
}
@media (max-width: 575.98px) {
  .app-clock { --clock-h: 22px; height: 40px; padding: 0 12px; font-size: 19px; }
}
/* Clock placed inside a page's own header (dashboards) */
.app-clock.in-header {
  --clock-h: 24px;
  height: 40px; padding: 0 14px; font-size: 20px;
  margin-right: 6px; flex: 0 0 auto;
  box-shadow: 4px 6px 12px rgba(4, 12, 48, .35), inset -3px -3px 6px rgba(0, 0, 0, .25), inset 2px 2px 5px rgba(255, 255, 255, .18);
}
/* Page headers make their children inherit dark text; the clock keeps its own colours */
html.clay .app-clock, html.clay .app-clock * { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html.clay .app-clock .seconds, html.clay .app-clock .seconds * { color: #9ec5ff !important; -webkit-text-fill-color: #9ec5ff !important; }
/* Let the header's right-hand group wrap instead of pushing Logout off-screen on phones */
html.clay :has(> .app-clock.in-header) { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
@media (max-width: 575.98px) {
  .app-clock.in-header { --clock-h: 20px; height: 34px; padding: 0 10px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-clock .move { animation: none; }
}

/* =====================================================================
   Shiny action buttons (CSS port of the ShinyButton React component):
   a light arc sweeps around the border, with speckle + sheen; on hover the
   arc widens and brightens. app-theme.js adds .shiny to solid action buttons.
   The repeated classes out-rank the generic clay button rule.
   ===================================================================== */
@property --shiny-angle   { syntax: "<angle>";      initial-value: 0deg;  inherits: false; }
@property --shiny-offset  { syntax: "<angle>";      initial-value: 0deg;  inherits: false; }
@property --shiny-percent { syntax: "<percentage>"; initial-value: 5%;    inherits: false; }
@property --shiny-shine   { syntax: "<color>";      initial-value: white; inherits: false; }

html.clay.clay.clay .shiny.shiny.shiny.shiny {
  --btn-accent: #c9c1ff;
  /* dark ring in the button's own hue, so the light arc reads like the original's orange-on-black */
  --btn-ring: #2a1d8f;
  --btn-ring: color-mix(in srgb, var(--btn-bg) 55%, #0b0930);
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border: 2.5px solid transparent !important;
  background:
    linear-gradient(var(--btn-bg), var(--btn-bg)) padding-box,
    conic-gradient(
      from calc(var(--shiny-angle) - var(--shiny-offset)),
      var(--btn-ring),
      var(--btn-accent) var(--shiny-percent),
      var(--shiny-shine) calc(var(--shiny-percent) * 2),
      var(--btn-accent) calc(var(--shiny-percent) * 3),
      var(--btn-ring) calc(var(--shiny-percent) * 4)
    ) border-box !important;
  animation: shiny-angle 3s linear infinite;
  transition:
    --shiny-offset .8s cubic-bezier(.25, 1, .5, 1),
    --shiny-percent .8s cubic-bezier(.25, 1, .5, 1),
    --shiny-shine .8s cubic-bezier(.25, 1, .5, 1),
    transform .15s ease;
}
html.clay .shiny.btn-success, html.clay .shiny.btn-excel, html.clay .shiny.btn-payroll { --btn-accent: #a8f7d4; }
html.clay .shiny.btn-danger, html.clay .shiny.btn-logout, html.clay .shiny.logout-btn { --btn-accent: #ffc4ce; }
html.clay .shiny.btn-info, html.clay .shiny.btn-map, html.clay .shiny.btn-export { --btn-accent: #c4ecff; }
html.clay .shiny.btn-warning { --btn-accent: #fff0c4; }

/* speckle dots, revealed under the sweeping arc */
html.clay .shiny::before,
html.clay .shiny::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  z-index: -1;
}
html.clay .shiny::before {
  width: calc(100% - 6px); height: calc(100% - 6px);
  border-radius: inherit;
  background: radial-gradient(circle at 2px 2px, rgba(255,255,255,.9) .5px, transparent 0) padding-box;
  background-size: 4px 4px;
  background-repeat: space;
  -webkit-mask-image: conic-gradient(from calc(var(--shiny-angle) + 45deg), black, transparent 10% 90%, black);
          mask-image: conic-gradient(from calc(var(--shiny-angle) + 45deg), black, transparent 10% 90%, black);
  opacity: .35;
  animation: shiny-angle 3s linear infinite;
}
/* rotating sheen */
html.clay .shiny::after {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(-50deg, transparent, var(--btn-accent), transparent);
  -webkit-mask-image: radial-gradient(circle at bottom, transparent 40%, black);
          mask-image: radial-gradient(circle at bottom, transparent 40%, black);
  opacity: .45;
  animation: shiny-spin 3s linear infinite;
}
html.clay.clay.clay .shiny.shiny.shiny.shiny:is(:hover, :focus-visible) {
  --shiny-percent: 20%;
  --shiny-offset: 95deg;
  --shiny-shine: var(--btn-accent);
}
html.clay .shiny:disabled, html.clay .shiny.disabled { animation: none; }
html.clay .shiny:disabled::before, html.clay .shiny:disabled::after { animation: none; opacity: 0; }

@keyframes shiny-angle { to { --shiny-angle: 360deg; } }
@keyframes shiny-spin  { to { rotate: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  html.clay .shiny, html.clay .shiny::before, html.clay .shiny::after { animation: none !important; }
  html.clay .shiny { transition: none !important; }
}
