html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Dark mode adjustments for Bootstrap 5.3+ data-bs-theme="dark" */
[data-bs-theme="dark"] .card.shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.3) !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bs-dark) !important;
}

[data-bs-theme="dark"] .badge.bg-light {
  background-color: var(--bs-gray-700) !important;
  color: var(--bs-gray-300) !important;
}

[data-bs-theme="dark"] .text-muted {
  color: var(--bs-gray-400) !important;
}

[data-bs-theme="dark"] .footer {
  border-color: var(--bs-gray-700) !important;
}

/* ── Sidebar Layout ─────────────────────────────────────────────── */
.fm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background-color: #fff;
  border-right: 1px solid var(--bs-border-color);
  z-index: 1030;
  overflow-y: auto;
}

.fm-sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.fm-sidebar-nav {
  padding: 0.5rem 0;
}

.fm-sidebar-section-label {
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  color: #9ca3af;
  padding: 0.75rem 1rem 0.25rem;
  text-transform: uppercase;
}

.fm-sidebar .nav-link,
.fm-offcanvas .nav-link {
  padding: 0.5rem 1rem;
  margin: 1px 0.5rem;
  border-radius: 0.375rem;
  color: var(--bs-body-color);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: background-color 0.15s, color 0.15s;
}

.fm-sidebar .nav-link:hover,
.fm-offcanvas .nav-link:hover {
  background-color: #f3f4f6;
}

.fm-sidebar .nav-link.active,
.fm-offcanvas .nav-link.active {
  background-color: var(--fm-brand-accent-light, #eff6ff);
  color: var(--fm-brand-accent, var(--bs-primary));
  font-weight: 500;
}

.fm-sidebar .nav-link i,
.fm-offcanvas .nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.fm-sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--bs-border-color);
}

.fm-sidebar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fm-sidebar-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}

/* Main content area */
.fm-main-content {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .fm-main-content {
    margin-left: 240px;
  }
}

.fm-main-content > .container-fluid {
  flex: 1;
}

.fm-footer {
  background: #1e1e1e;
  border-top: none;
  margin-top: auto;
  padding: 0.875rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 767.98px) {
  .fm-footer {
    display: none;
  }
}

/* Mobile top bar */
.fm-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    0.5rem max(1rem, env(safe-area-inset-left, 0px));
  background-color: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
}

/* Offcanvas sidebar for mobile */
.fm-offcanvas {
  width: 280px !important;
}

.fm-offcanvas .fm-sidebar-section-label {
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  color: #9ca3af;
  padding: 0.75rem 1rem 0.25rem;
  text-transform: uppercase;
}

/* ── Dark Mode: Sidebar ─────────────────────────────────────────── */
[data-bs-theme="dark"] .fm-sidebar {
  background-color: var(--bs-body-bg);
  border-right-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-sidebar .nav-link:hover,
[data-bs-theme="dark"] .fm-offcanvas .nav-link:hover {
  background-color: rgba(255,255,255,0.05);
}

[data-bs-theme="dark"] .fm-sidebar .nav-link.active,
[data-bs-theme="dark"] .fm-offcanvas .nav-link.active {
  background-color: rgba(59, 130, 246, 0.15);
}

[data-bs-theme="dark"] .fm-sidebar-section-label,
[data-bs-theme="dark"] .fm-offcanvas .fm-sidebar-section-label {
  color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .fm-topbar {
  background-color: var(--bs-body-bg);
  border-bottom-color: var(--bs-border-color);
}

/* ── FieldMind Design Tokens ──────────────────────────────────────── */

/* Card — softer border-based style (replaces shadow-sm cards) */
.fm-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0;
}

.fm-card .card-body,
.fm-card .fm-card-body {
  padding: 1.25rem;
}

.fm-card .card-header,
.fm-card .fm-card-header {
  padding: 1rem 1.25rem;
  background-color: transparent;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}

.fm-card .card-footer,
.fm-card .fm-card-footer {
  padding: 0.75rem 1.25rem;
  background-color: transparent;
  border-top: 1px solid #e5e7eb;
}

/* Table container — rounded wrapper with styled header */
.fm-table-container {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.fm-table-container .table {
  margin-bottom: 0;
}

.fm-table-container .table thead th {
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 0.75rem 1rem;
}

.fm-table-container .table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.fm-table-container .table tbody tr:last-child td {
  border-bottom: none;
}

.fm-table-container .table tbody tr:hover {
  background-color: #f9fafb;
}

/* Pill badges */
.fm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.fm-badge-blue {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.fm-badge-green {
  background-color: #f0fdf4;
  color: #15803d;
}

.fm-badge-red {
  background-color: #fef2f2;
  color: #b91c1c;
}

.fm-badge-yellow {
  background-color: #fefce8;
  color: #a16207;
}

.fm-badge-gray {
  background-color: #f3f4f6;
  color: #4b5563;
}

.fm-badge-purple {
  background-color: #faf5ff;
  color: #7e22ce;
}

/* Empty state */
.fm-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #9ca3af;
}

.fm-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.fm-empty-state p {
  margin-bottom: 0.5rem;
}

/* Spinner */
.fm-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e5e7eb;
  border-bottom-color: #2563eb;
  border-radius: 50%;
  animation: fm-spin 0.75s linear infinite;
}

@keyframes fm-spin {
  to { transform: rotate(360deg); }
}

/* Button tweaks — rounder with focus ring */
.btn {
  border-radius: 0.5rem;
}

.btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}

/* Form control tweaks */
.form-control,
.form-select {
  border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Stat card — used in dashboards */
.fm-stat-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.fm-stat-card .fm-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.fm-stat-card .fm-stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.fm-stat-card .fm-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ── Dark Mode: Design Tokens ──────────────────────────────────── */
[data-bs-theme="dark"] .fm-card {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-card .card-header,
[data-bs-theme="dark"] .fm-card .fm-card-header {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-card .card-footer,
[data-bs-theme="dark"] .fm-card .fm-card-footer {
  border-top-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-table-container {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-table-container .table thead th {
  background-color: rgba(255,255,255,0.03);
  border-bottom-color: var(--bs-border-color);
  color: var(--bs-gray-400);
}

[data-bs-theme="dark"] .fm-table-container .table tbody td {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-table-container .table tbody tr:hover {
  background-color: rgba(255,255,255,0.03);
}

[data-bs-theme="dark"] .fm-badge-blue {
  background-color: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

[data-bs-theme="dark"] .fm-badge-green {
  background-color: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

[data-bs-theme="dark"] .fm-badge-red {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

[data-bs-theme="dark"] .fm-badge-yellow {
  background-color: rgba(234, 179, 8, 0.15);
  color: #fde047;
}

[data-bs-theme="dark"] .fm-badge-gray {
  background-color: rgba(156, 163, 175, 0.15);
  color: var(--bs-gray-400);
}

[data-bs-theme="dark"] .fm-badge-purple {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

[data-bs-theme="dark"] .fm-empty-state {
  color: var(--bs-gray-500);
}

[data-bs-theme="dark"] .fm-stat-card {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-stat-card .fm-stat-label {
  color: var(--bs-gray-400);
}

/* Theme toggle button */
.btn-theme-toggle {
  background: none;
  border: none;
  color: var(--bs-body-color);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  border-radius: 0.375rem;
}

.btn-theme-toggle:hover {
  background-color: var(--bs-tertiary-bg);
}

/* ── Skeleton Loaders ───────────────────────────────────────────── */
@keyframes fm-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 800px 100%;
  animation: fm-shimmer 1.4s infinite linear;
  border-radius: 0.375rem;
  display: inline-block;
}

.skeleton-text {
  height: 1em;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-text.w-50  { width: 50%; }
.skeleton-text.w-75  { width: 75%; }
.skeleton-text.w-25  { width: 25%; }

.skeleton-value {
  height: 2.5rem;
  width: 4rem;
  display: block;
  margin-bottom: 0.25rem;
}

.skeleton-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.skeleton-row {
  height: 2.75rem;
  width: 100%;
  display: block;
  margin-bottom: 1px;
}

[data-bs-theme="dark"] .skeleton,
[data-bs-theme="dark"] .skeleton-text,
[data-bs-theme="dark"] .skeleton-value,
[data-bs-theme="dark"] .skeleton-row {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 800px 100%;
  animation: fm-shimmer 1.4s infinite linear;
}

[data-bs-theme="dark"] .skeleton-card {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

/* ── Building Card Grid view ────────────────────────────────────── */
.fm-building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.fm-building-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.fm-building-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #93c5fd;
  color: inherit;
}

[data-bs-theme="dark"] .fm-building-card {
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .fm-building-card:hover {
  border-color: #3b82f6;
}

/* ── Leaflet Map Container ──────────────────────────────────────── */
#building-map {
  height: 520px;
  border-radius: 0.625rem;
  border: 1px solid #e5e7eb;
  z-index: 1;
}

[data-bs-theme="dark"] #building-map {
  border-color: var(--bs-border-color);
}

/* ── Notification Bell ──────────────────────────────────────────── */
.fm-bell-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--bs-body-color);
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  border-radius: 0.375rem;
  line-height: 1;
}

.fm-bell-btn:hover { background-color: var(--bs-tertiary-bg); }

.fm-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
  line-height: 1;
}

.fm-notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.fm-notif-panel.open { transform: translateX(0); }

.fm-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color);
  font-weight: 600;
}

.fm-notif-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.fm-notif-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid transparent;
  background: var(--bs-tertiary-bg);
  font-size: 0.875rem;
}

.fm-notif-item.alert-critical  { border-left-color: #ef4444; }
.fm-notif-item.alert-warning   { border-left-color: #f59e0b; }
.fm-notif-item.alert-info      { border-left-color: #3b82f6; }
.fm-notif-item.activity        { border-left-color: #10b981; }

.fm-notif-item .notif-time {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.25rem;
}

.fm-notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1049;
  display: none;
}

.fm-notif-overlay.open { display: block; }

/* Live indicator dot */
.fm-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: fm-pulse 2s infinite;
}

@keyframes fm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .fm-live-dot {
    animation: none;
  }
}

/* Tiem.pro time clock hero (mobile-first) */
.tiem-time-hero {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 0.75rem;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.tiem-time-brand {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #047857;
  letter-spacing: 0.02em;
}

.tiem-clock-wrap {
  font-size: 3rem;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", "Courier New", monospace;
  line-height: 1.05;
  color: #111827;
}

.tiem-clock-sec {
  font-size: 1.25rem;
  font-weight: 700;
  vertical-align: super;
  margin-left: 0.05rem;
  color: #374151;
}

.tiem-time-stats {
  background: #374151;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.55rem 0;
  margin-top: 0.65rem;
}

.tiem-time-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.tiem-time-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* /Time — large-phone / notched iPhone layout (safe areas, thumb zone, horizontal scroll) */
.tiem-time-page {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.tiem-time-tabs {
  background-color: #eef2f7;
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.tiem-time-tabs .tiem-tab-active {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.tiem-time-tabs .tiem-tab-inactive {
  background-color: transparent;
  color: #374151;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

[data-bs-theme="dark"] .tiem-time-tabs {
  background-color: #111827;
}

[data-bs-theme="dark"] .tiem-time-tabs .tiem-tab-active {
  background-color: #1f2937;
  color: #f9fafb;
  border-color: rgba(249, 250, 251, 0.12);
}

[data-bs-theme="dark"] .tiem-time-tabs .tiem-tab-inactive {
  color: #d1d5db;
}

@media (max-width: 767.98px) {
  .tiem-time-page {
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
  }

  .tiem-time-toolbar {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
  }

  .tiem-time-toolbar > * {
    flex-shrink: 0;
  }

  .tiem-time-toolbar .btn {
    min-height: 44px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .tiem-time-toolbar .form-select {
    min-height: 44px;
  }

  .tiem-time-tabs .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tiem-time-hero {
    padding: 1rem 1rem 1.15rem;
  }

  .tiem-clock-wrap {
    font-size: clamp(2.35rem, 11vw, 3.35rem);
  }

  .tiem-clock-sec {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
  }

  .tiem-time-stat-label {
    font-size: 0.62rem;
  }

  .tiem-time-stat-value {
    font-size: clamp(1rem, 4.2vw, 1.2rem);
  }

  .tiem-time-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .tiem-time-entries-table {
    min-width: 48rem;
  }

  .tiem-time-page .fm-table-container .btn-sm {
    min-width: 44px;
    min-height: 44px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tiem-time-primary-action {
    min-height: 48px;
    font-size: 1.05rem;
    font-weight: 600;
  }

  .tiem-touch-control,
  .tiem-time-page .form-select,
  .tiem-time-page textarea.form-control {
    min-height: 44px;
    font-size: 1rem;
  }

  .tiem-time-page textarea.form-control {
    min-height: 5.5rem;
  }

  .modal-fullscreen-sm-down .modal-footer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .tiem-time-status-card .tiem-time-primary-action {
    width: auto;
  }
}

@media (min-width: 992px) {
  .tiem-week-day-grid {
    flex-wrap: nowrap;
  }

  .tiem-week-day-grid > .col {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }
}

/* ── Full-Screen Success Overlay ──────────────────────────────────── */
.fm-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.fm-success-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  min-width: min(340px, 90vw);
}

[data-bs-theme="dark"] .fm-success-overlay-inner {
  background: rgba(28, 28, 30, 0.97);
}

.fm-success-checkmark {
  width: clamp(80px, 28vw, 120px);
  height: clamp(80px, 28vw, 120px);
}

.fm-check-svg {
  width: 100%;
  height: 100%;
}

.fm-check-circle {
  stroke: #22c55e;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-miterlimit: 10;
}

.fm-check-path {
  stroke: #22c55e;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.fm-success-animate .fm-check-circle {
  animation: fm-circle-draw 0.55s cubic-bezier(0.65,0,0.45,1) forwards;
}

.fm-success-animate .fm-check-path {
  animation: fm-check-draw 0.35s cubic-bezier(0.65,0,0.45,1) 0.5s forwards;
}

@keyframes fm-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes fm-check-draw {
  to { stroke-dashoffset: 0; }
}

.fm-success-message {
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 700;
  color: var(--bs-body-color);
  line-height: 1.2;
}

.fm-success-tap-hint {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  margin-top: -0.25rem;
}

/* ── Mobile Bottom Tab Bar (iPhone native style) ──────────────────── */
.fm-mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1025;
  display: flex;
  align-items: stretch;
  background-color: rgba(249, 249, 249, 0.94);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04), 0 -4px 16px rgba(0,0,0,0.05);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fm-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px 8px;
  text-decoration: none;
  color: #8e8e93;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 60px;
}

/* Icon wrapper — relative so the dot can be absolute */
.fm-tab-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 30px;
}

.fm-tab-icon-wrap i {
  font-size: 23px;
  line-height: 1;
  position: absolute;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

/* Outline icon: visible when inactive */
.fm-tab-item .fm-icon-outline  { opacity: 1; transform: scale(1); }
.fm-tab-item .fm-icon-filled   { opacity: 0; transform: scale(0.82); }

/* Active: swap to filled, slightly larger */
.fm-tab-item.active .fm-icon-outline { opacity: 0; transform: scale(0.82); }
.fm-tab-item.active .fm-icon-filled  { opacity: 1; transform: scale(1.08); }

.fm-tab-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: font-weight 0.12s ease;
}

.fm-tab-item.active span {
  font-weight: 600;
}

.fm-tab-item.active {
  color: var(--fm-brand-accent, #007AFF);
}

.fm-tab-item:active {
  opacity: 0.45;
  transition: none;
}

/* Clocked-in green dot on Time tab */
.fm-tab-clock-dot {
  position: absolute;
  top: 1px;
  right: 3px;
  width: 8px;
  height: 8px;
  background: #34C759;
  border-radius: 50%;
  border: 1.5px solid rgba(249, 249, 249, 0.94);
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.35);
}

/* Push content above tab bar on mobile */
@media (max-width: 767.98px) {
  .fm-main-content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

/* Coming-soon page icon box */
.fm-coming-soon-icon {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Dark mode tab bar */
[data-bs-theme="dark"] .fm-mobile-tabbar {
  background-color: rgba(22, 22, 23, 0.94);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.05), 0 -4px 16px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .fm-tab-item {
  color: #636366;
}

[data-bs-theme="dark"] .fm-tab-item.active {
  color: var(--fm-brand-accent, #0A84FF);
}

[data-bs-theme="dark"] .fm-tab-clock-dot {
  border-color: rgba(22, 22, 23, 0.94);
}

/* ── Brand Color Themes ─────────────────────────────────────────────────── */

:root {
  --fm-brand-accent: #007AFF;
  --fm-brand-accent-light: #E8F0FE;
  --fm-brand-accent-dark: #0056CC;
}

/* 1. Blue (default) — no override needed */

/* 2. Green */
.fm-brand-green {
  --fm-brand-accent: #28A745;
  --fm-brand-accent-light: #E6F4EA;
  --fm-brand-accent-dark: #1E7E34;
}

/* 3. Purple */
.fm-brand-purple {
  --fm-brand-accent: #7C3AED;
  --fm-brand-accent-light: #EDE9FE;
  --fm-brand-accent-dark: #5B21B6;
}

/* 4. Orange */
.fm-brand-orange {
  --fm-brand-accent: #E95B00;
  --fm-brand-accent-light: #FEF0E7;
  --fm-brand-accent-dark: #B34600;
}

/* 5. Red */
.fm-brand-red {
  --fm-brand-accent: #DC2626;
  --fm-brand-accent-light: #FEE2E2;
  --fm-brand-accent-dark: #B91C1C;
}

/* ── Brand Chrome — colored header/footer for brand identity ── */

/* Desktop sidebar: solid brand color header band */
.fm-sidebar-brand {
  background: var(--fm-brand-accent, #007AFF);
  border-bottom: none;
}
.fm-sidebar-brand .fw-bold,
.fm-sidebar-brand .text-primary {
  color: #fff !important;
}
.fm-sidebar-brand small,
.fm-sidebar-brand .text-body-secondary {
  color: rgba(255, 255, 255, 0.72) !important;
}
.fm-sidebar-brand .fm-bell-btn {
  color: rgba(255, 255, 255, 0.85);
}
.fm-sidebar-brand .fm-bell-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.fm-sidebar-brand .fm-bell-badge {
  background: #fff;
  color: var(--fm-brand-accent, #007AFF);
}

/* Mobile top bar: brand color background */
.fm-topbar {
  background-color: var(--fm-brand-accent, #007AFF) !important;
  border-bottom-color: var(--fm-brand-accent-dark, #0056CC) !important;
}
.fm-topbar .btn-link,
.fm-topbar a,
.fm-topbar .fw-bold,
.fm-topbar .bi-list {
  color: #fff !important;
}
.fm-topbar .fm-sidebar-avatar {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

/* Mobile offcanvas (slide-out) header: brand color */
.fm-offcanvas .offcanvas-header {
  background: var(--fm-brand-accent, #007AFF);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.25rem 1rem;
}
.fm-offcanvas .offcanvas-header .fw-bold,
.fm-offcanvas .offcanvas-header .text-primary {
  color: #fff !important;
}
.fm-offcanvas .offcanvas-header small,
.fm-offcanvas .offcanvas-header .text-body-secondary {
  color: rgba(255, 255, 255, 0.72) !important;
}
.fm-offcanvas .offcanvas-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* Footer: brand color top stripe */
.fm-footer {
  border-top: 3px solid var(--fm-brand-accent, #007AFF);
}

/* Mobile bottom tab bar: brand colored top stripe */
.fm-mobile-tabbar {
  border-top: 3px solid var(--fm-brand-accent, #007AFF);
}

/* Re-tint clocked-in dot to match brand */
.fm-brand-green  .fm-tab-clock-dot { background: #34C759; }
.fm-brand-red    .fm-tab-clock-dot { background: #FF3B30; }
.fm-brand-purple .fm-tab-clock-dot { background: #AF52DE; }

/* ── Full-screen submission confirmation overlay ── */
.fm-submit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.fm-submit-overlay.fm-visible {
  opacity: 1;
}
.fm-submit-overlay-icon {
  font-size: min(30vw, 30vh);
  color: #198754;
  line-height: 1;
  animation: fm-check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fm-submit-overlay-msg {
  font-size: clamp(1.4rem, 6vw, 2.25rem);
  font-weight: 800;
  color: #146c43;
  margin-top: 1.5rem;
  text-align: center;
  padding: 0 1.5rem;
  letter-spacing: -0.01em;
}
.fm-submit-overlay-tap {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 1rem;
}
@keyframes fm-check-pop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Skeleton loaders ─────────────────────────────────────────────────── */
.fm-skeleton {
  background: linear-gradient(90deg, #e9ecef 25%, #dee2e6 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: fm-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes fm-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.fm-skeleton-line {
  height: 0.85em;
  margin-bottom: 0.45em;
  border-radius: 4px;
}
.fm-skeleton-card {
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dee2e6;
}
.fm-skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.fm-skeleton-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.fm-skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
