/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #0f172a;
  --secondary-light: #1e293b;
  --accent-color: #06b6d4;
  --success-color: #059669;
  --danger-color: #dc2626;
  --warning-color: #f59e0b;
  --dark: #0f172a;
  --gray: #64748b;
  --light-gray: #f8fafc;
  --border-color: #e2e8f0;
  --text-color: #1e293b;
  --text-light: #475569;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* ============================================
   GLOBAL RESET
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: #fff;
}

/* ============================================
   LANDING PAGE — LAYOUT & HEADER
   ============================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 0 20px; }

header {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e5e7eb;
}

header .container { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 20px; }

header nav { display: flex; align-items: center; gap: 0.5rem; }

header nav a {
  text-decoration: none;
  color: #1e293b;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

header nav a:hover { color: var(--primary-color); background: #f1f5f9; }

header nav a.btn {
  color: white;
  background: var(--primary-color);
  padding: 0.625rem 1.25rem;
  font-weight: 600;
}

header nav a.btn:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.25); }

.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-color); padding: 0.5rem; }

/* ============================================
   LANDING PAGE — HERO, FEATURES, FAQ
   ============================================ */
.hero {
  text-align: center;
  padding: 6rem 0;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, rgba(6,182,212,0.1) 100%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.hero p { font-size: 1.25rem; margin-bottom: 2rem; opacity: 0.9; color: #cbd5e1; }

.features { padding: 5rem 0; background: var(--light-gray); }
.features h2 { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; color: var(--dark); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.feature-card { background: white; padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: var(--shadow); transition: all 0.3s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.feature-card h3 { color: var(--secondary-color); margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600; }
.feature-card p { color: var(--text-light); line-height: 1.7; }
.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
/* Clickable feature cards */
.feature-card-link { display: block; text-decoration: none; text-align: left; cursor: pointer; }
.feature-card-link h3 { color: var(--secondary-color); }
.feature-card-popup { display: block; width: 100%; text-align: left; background: white; font-family: inherit; cursor: pointer; }
.feature-card-cta { display: inline-block; margin-top: 1.25rem; font-size: 0.875rem; font-weight: 600; color: var(--primary-color); }
.feature-card-link:hover .feature-card-cta,
.feature-card-popup:hover .feature-card-cta { text-decoration: underline; }
/* Feature preview popup */
.feature-popup-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1000; align-items: center; justify-content: center; padding: 1.5rem; }
.feature-popup-overlay.open { display: flex; }
/* Default layout: side-by-side (portrait/square images) */
.feature-popup { background: white; border-radius: 16px; width: 100%; max-width: 860px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,0.2); animation: popup-in 0.2s ease; }
@keyframes popup-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.feature-popup-close { position: absolute; top: 1rem; right: 1rem; background: var(--light-gray); border: none; border-radius: 50%; width: 2.25rem; height: 2.25rem; font-size: 1.25rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-color); z-index: 1; transition: background 0.2s; }
.feature-popup-close:hover { background: var(--border-color); }
.feature-popup-inner { display: grid; grid-template-columns: 1fr 1fr; }
.feature-popup-img-wrap { border-radius: 16px 0 0 16px; overflow: hidden; background: var(--light-gray); min-height: 320px; display: flex; align-items: center; justify-content: center; }
.feature-popup-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-popup-body { padding: 2.5rem 2rem 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.feature-popup-icon { font-size: 2.5rem; }
.feature-popup-body h2 { font-size: 1.6rem; font-weight: 700; color: var(--dark); margin: 0; }
.feature-popup-body p { color: var(--text-light); line-height: 1.7; margin: 0; }
.feature-popup-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.feature-popup-list li { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--text-color); font-size: 0.925rem; }
.feature-popup-list li::before { content: "✓"; color: var(--success-color); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
/* Wide layout modifier: image on top, 2-col list below (landscape/dashboard screenshots) */
.feature-popup--wide { max-width: 960px; }
.feature-popup--wide .feature-popup-inner { display: flex; flex-direction: column; }
.feature-popup--wide .feature-popup-img-wrap { border-radius: 16px 16px 0 0; min-height: unset; }
.feature-popup--wide .feature-popup-img { height: auto; max-height: 340px; object-fit: cover; object-position: top left; }
.feature-popup--wide .feature-popup-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 2rem; }
.feature-popup--wide .feature-popup-body { padding: 2rem 2.25rem 2.25rem; }
@media (max-width: 640px) {
  .feature-popup-inner { grid-template-columns: 1fr; }
  .feature-popup-img-wrap { border-radius: 16px 16px 0 0; min-height: 200px; }
  .feature-popup--wide .feature-popup-img { max-height: 200px; }
  .feature-popup--wide .feature-popup-list { grid-template-columns: 1fr; }
}

.faq { padding: 5rem 0; }
.faq h2 { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; }
.faq-item { background: white; margin-bottom: 1rem; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.faq-question { padding: 1.5rem; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; transition: background 0.3s; }
.faq-question:hover { background: var(--light-gray); }
.faq-answer { padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: all 0.3s; }
.faq-item.active .faq-answer { padding: 1.5rem; max-height: 500px; }

/* ============================================
   FOOTER
   ============================================ */
footer { background: linear-gradient(135deg, var(--secondary-color) 0%, #0f172a 100%); color: white; padding: 3rem 0 1.5rem; margin-top: 5rem; }

.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-grid h4 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; color: white; }
.footer-grid p, .footer-grid a { color: rgba(255,255,255,0.7); font-size: 0.875rem; line-height: 1.6; margin-bottom: 0.5rem; text-decoration: none; transition: color 0.2s; }
.footer-grid a:hover { color: white; }
.footer-bottom { text-align: center; padding-top: 1.5rem; }
.footer-bottom p { color: rgba(255,255,255,0.5); font-size: 0.875rem; margin: 0; }

/* ============================================
   MANAGER QUICK CLOCK (Landing)
   ============================================ */
.manager-clock-section { background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%); color: white; border: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.manager-clock-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.manager-clock-icon { font-size: 2.5rem; background: rgba(255,255,255,0.2); width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.manager-clock-header h3 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.manager-clock-subtitle { margin: 0.25rem 0 0 0; opacity: 0.9; font-size: 0.875rem; }
#manager-clock-button-container { display: flex; justify-content: center; width: 100%; }
#manager-clock-button { width: 100%; max-width: 400px; padding: 1rem 2rem; font-size: 1.125rem; font-weight: 600; transition: all 0.2s ease; background-color: white; color: var(--primary-color); border: 2px solid white; }
#manager-clock-button:hover { background-color: rgba(255,255,255,0.9); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
#manager-clock-button.clocked-in { background-color: var(--danger-color); color: white; border-color: var(--danger-color); }
#manager-clock-button.clocked-in:hover { background-color: #c82333; border-color: #bd2130; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-primary:disabled, .btn-primary[disabled] { background: var(--primary-color); transform: none; box-shadow: none; pointer-events: none; }
.btn-secondary { background: var(--gray); color: white; }
.btn-secondary:hover { background: #52525b; }
.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-large, .btn-lg { padding: 1rem 2.5rem; font-size: 1.125rem; font-weight: 600; min-width: 180px; }
.btn-block { display: block; width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; background: var(--light-gray); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 8px; }
.btn-icon:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-icon.danger:hover { background: #fee2e2; color: var(--danger-color); border-color: var(--danger-color); }

/* ============================================
   FORMS — GLOBAL
   ============================================ */
.form-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.875rem; color: var(--dark); }
.form-group.full-width { grid-column: 1 / -1; }

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
}

.form-control:hover, .form-group input:hover { border-color: #cbd5e1; }

.form-control:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: #9ca3af; }

select.form-control, .form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
  cursor: pointer;
}

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.form-section { padding: 1.5rem 0; }
.form-section:not(:last-child) { border-bottom: 1px solid var(--border-color); }
.form-section h3 { font-size: 1.125rem; font-weight: 600; color: var(--text-color); margin-bottom: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.form-hint { font-size: 0.875rem; color: var(--text-light); margin-top: 0.5rem; }
.form-error { color: var(--danger-color); font-size: 0.875rem; margin-top: 0.25rem; display: none; }
.form-error.show { display: block; }
.section-description { color: #6b7280; font-size: 0.875rem; margin-bottom: 1.5rem; }

/* Input group (payrate) */
.input-group { display: flex; align-items: center; position: relative; }
.input-group .form-control { border-radius: 0 8px 8px 0; flex: 1; }
.input-group-prefix, .input-group-suffix { display: flex; align-items: center; padding: 0.75rem 1rem; background: var(--light-gray); border: 1px solid var(--border-color); font-size: 0.875rem; color: var(--text-light); }
.input-group-prefix { border-right: none; border-radius: 8px 0 0 8px; font-weight: 600; color: var(--text-color); }
.input-group-suffix { border-left: none; border-radius: 0 8px 8px 0; font-weight: 500; }
.input-group:focus-within .input-group-prefix, .input-group:focus-within .input-group-suffix { border-color: var(--primary-color); }

/* Password toggle */
.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-input-wrapper .form-control { padding-right: 3rem; }
.password-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 0.5rem 1rem; cursor: pointer; color: var(--text-light); transition: color 0.2s ease; display: flex; align-items: center; justify-content: center; z-index: 10; }
.password-toggle:hover { color: var(--primary-color); }
.password-toggle:focus { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 4px; }
.password-toggle .toggle-icon { font-size: 1.2rem; user-select: none; }

/* Phone 3-box */
.phone-input-group { display: flex; align-items: center; gap: 0.375rem; width: 100%; box-sizing: border-box; overflow: hidden; }
.phone-input { flex: 1 1 0; min-width: 0; max-width: 5rem; text-align: center; padding: 0.5rem 0.25rem; font-size: 0.875rem; border: 1px solid var(--border-color); border-radius: 4px; box-sizing: border-box; transition: border-color 0.2s ease; }
.phone-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.phone-input:last-child { max-width: 6rem; }
.phone-separator { color: var(--text-light); font-weight: 500; user-select: none; }

/* Checkbox */
.checkbox-label { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #374151; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; flex-shrink: 0; margin: 0; cursor: pointer; }
.checkbox-group label { display: flex; align-items: center; cursor: pointer; }
.checkbox-group input[type="checkbox"] { margin-right: 0.75rem; width: 1.25rem; height: 1.25rem; cursor: pointer; }
.checkbox-group span { font-weight: 500; color: var(--text-color); }

/* Color picker */
.color-picker-group { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.color-picker-group input[type="color"] { width: 60px; height: 40px; border: 2px solid var(--border-color); border-radius: 6px; cursor: pointer; padding: 2px; }
.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-group input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-hex-input { flex: 1; padding: 0.5rem; border: 1px solid var(--border-color); border-radius: 6px; font-family: 'Courier New', monospace; font-size: 0.9rem; text-transform: uppercase; }
.color-hex-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert { padding: 1rem 1.5rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: var(--shadow-lg); }
.alert.show { display: block; }
.alert:not(.show):not(.toast) { display: none; }

#global-alert { position: fixed; top: 1rem; right: 1rem; z-index: 10000; min-width: 300px; max-width: 500px; }

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* Dashboard toast variants */
.alert.success { background: #10b981; color: white; border-left: 4px solid #059669; position: fixed; top: 1rem; right: 1rem; z-index: 10002; min-width: 300px; max-width: 500px; animation: slideInRight 0.3s ease-out; }
.alert.error   { background: #ef4444; color: white; border-left: 4px solid #dc2626; position: fixed; top: 1rem; right: 1rem; z-index: 10002; min-width: 300px; max-width: 500px; animation: slideInRight 0.3s ease-out; }
.alert.warning { background: #f59e0b; color: white; border-left: 4px solid #d97706; position: fixed; top: 1rem; right: 1rem; z-index: 10002; min-width: 300px; max-width: 500px; animation: slideInRight 0.3s ease-out; }
.alert.info    { background: #3b82f6; color: white; border-left: 4px solid #2563eb; position: fixed; top: 1rem; right: 1rem; z-index: 10002; min-width: 300px; max-width: 500px; animation: slideInRight 0.3s ease-out; }

.alert-item { padding: 0.75rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; transition: background-color 0.15s ease; }
.alert-item:hover { background: var(--light-gray); }
.alert-item:last-child { border-bottom: none; }
.alert-item-info { flex: 1; }
.alert-item-title { font-weight: 600; color: var(--text-color); margin-bottom: 0.25rem; }
.alert-item-subtitle { font-size: 0.875rem; color: var(--text-light); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-light); font-style: italic; }
.text-danger { color: var(--danger-color); }
.text-short { display: none; }
.text-full { display: inline; }

.back-link { color: #0369a1; text-decoration: none; font-size: 0.875rem; display: inline-block; margin-bottom: 1rem; transition: color 0.2s; }
.back-link:hover { color: #0284c7; text-decoration: underline; }

.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; } .p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; } .p-4 { padding: 2rem; }

/* ============================================
   DEV ACCOUNT BUTTONS
   ============================================ */
.dev-accounts-container { margin-bottom: 1.5rem; padding: 1rem; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 0.5rem; }
.dev-accounts-title { margin: 0 0 0.75rem 0; font-size: 0.875rem; font-weight: 600; color: #0369a1; }
.dev-accounts-list { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-dev-account { padding: 0.5rem; font-size: 0.875rem; background: white; border: 1px solid #0ea5e9; color: #0369a1; border-radius: 0.375rem; cursor: pointer; text-align: left; transition: all 0.2s; }
.btn-dev-account:hover { background: #f0f9ff; border-color: #0284c7; }
.btn-dev-account.multi-account { border-color: #10b981; color: #059669; }
.btn-dev-account.multi-account:hover { background: #f0fdf4; border-color: #059669; }
.dev-account-role { font-size: 0.75rem; color: #64748b; display: block; margin-top: 0.25rem; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--light-gray); }
.auth-card { background: white; padding: 3rem; border-radius: 8px; box-shadow: var(--shadow-lg); width: 100%; max-width: 450px; }
.auth-card h1 { margin-bottom: 2rem; text-align: center; color: var(--dark); }
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--gray); }
.auth-footer a { color: var(--primary-color); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
#btn-scan-kiosk-qr { color: var(--primary-color); text-decoration: none; }

/* ============================================
   DASHBOARD — LAYOUT
   ============================================ */
.dashboard { display: flex; min-height: 100vh; }

/* ============================================
   SIDEBAR
   ============================================ */
/* Applied by inline head script before first paint to prevent sidebar flash on page nav */
.sidebar-pre-collapsed .sidebar { width: 80px; overflow-x: hidden; }
.sidebar-pre-collapsed .main-content { margin-left: 80px; width: calc(100% - 80px); }

/* Suppress sidebar transition during initial page-load collapse restore */
.sidebar.no-transition { transition: none !important; }

.sidebar {
  position: fixed; left: 0; top: 0; height: 100vh; width: 250px;
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
  color: white; padding: 1.5rem 0;
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 1001; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}

@media (min-width: 769px) { .sidebar { cursor: pointer; } .sidebar .nav-item { cursor: pointer; } }
.sidebar.collapsed { width: 80px; overflow-x: hidden; }

.logo { display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; padding: 0 1rem; transition: all 0.3s ease; position: relative; font-size: 1.5rem; font-weight: 700; color: var(--primary-color); text-decoration: none; letter-spacing: -0.02em; }
.logo img { max-width: 100%; height: auto; object-fit: contain; }
.logo-full { display: block; height: 48px; width: auto; }
.logo-icon { display: none; width: 56px; height: 56px; background: white; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.15); object-fit: contain; }
.sidebar.collapsed .logo { padding: 0; margin-bottom: 3rem; }
.sidebar.collapsed .logo-full { display: none; }
.sidebar.collapsed .logo-icon { display: block; }

.account-name { font-size: 0.875rem; color: rgba(255,255,255,0.7); text-align: center; padding: 0 1rem; margin-bottom: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s ease; }
.sidebar.collapsed .account-name { opacity: 0; height: 0; margin: 0; padding: 0; }


.sidebar-nav, .nav { flex: 1; padding: 1rem 0; width: 100%; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.15); margin: 0.75rem 1rem; }
.sidebar.collapsed .nav-divider { margin: 0.75rem 0.5rem; }

.nav-item {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.8); text-decoration: none; transition: all 0.2s;
  cursor: pointer; min-height: 48px; white-space: nowrap; position: relative; flex-wrap: nowrap; width: 100%;
}
.nav-item-secondary { opacity: 0.85; font-size: 0.9rem; }
.nav-item-secondary:hover { opacity: 1; }
.sidebar.collapsed .nav-item { padding: 0; justify-content: center; margin: 0; gap: 0; }
.nav-icon { font-size: 1.25rem; flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; line-height: 1; filter: grayscale(0) brightness(1.2) contrast(1.1); }
.sidebar.collapsed .nav-icon { font-size: 1.75rem; width: 80px; height: 48px; margin: 0; filter: grayscale(0) brightness(1.3) contrast(1.2); }
.nav-text { transition: opacity 0.2s ease; }
.sidebar.collapsed .nav-text { opacity: 0; width: 0; overflow: hidden; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: color-mix(in srgb, var(--primary-color) 40%, transparent); color: white; }
.sidebar.collapsed .nav-item.active { background: color-mix(in srgb, var(--primary-color) 50%, transparent); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; backdrop-filter: blur(2px); }

.mobile-menu-btn { display: none; position: fixed; top: 1rem; left: 1rem; z-index: 1003; background: transparent; border: none; width: 48px; height: 48px; padding: 12px; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.mobile-menu-btn span { display: block; width: 100%; height: 3px; background: var(--primary-color); transition: all 0.3s ease; border-radius: 2px; }

/* ============================================
   DASHBOARD — MAIN CONTENT
   ============================================ */
.main-content { margin-left: 250px; padding: 2rem; transition: margin-left 0.3s ease; min-height: 100vh; width: calc(100% - 250px); flex: 1; }
.sidebar.collapsed + .main-content { margin-left: 80px; width: calc(100% - 80px); }

/* Cap content width on large/HiDPI monitors so the layout doesn't stretch infinitely.
   1600px gives breathing room for wide dashboards without going edge-to-edge on 4K. */
.main-content > * { max-width: 1600px; }

.dashboard-header { background: white; padding: 1.5rem; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 2rem; border: 1px solid var(--border-color); }
.dashboard-header h1 { font-size: 2rem; font-weight: 700; color: var(--text-color); margin-bottom: 0.5rem; }
.dashboard-header p { color: var(--text-light); font-size: 1rem; }

.dashboard-section { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   CARDS
   ============================================ */
.card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border-color); margin-bottom: 2rem; box-sizing: border-box; min-width: 0; }
.card h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-color); margin-bottom: 1rem; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; }
.card-header h2 { margin: 0; }
.card-header-actions { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.card-header-actions > div h2 { margin-bottom: 0.25rem; }
.card-header-actions > div p { color: var(--text-light); font-size: 0.875rem; margin: 0; }
.card-header-flex { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.card-header-flex h3 { margin: 0; flex-shrink: 0; }
.card-header-flex > div { display: flex; gap: 0.5rem; flex-shrink: 0; }
@media (max-width: 480px) {
  .card-header-flex { align-items: stretch; }
  .card-header-flex > div { flex-direction: column; width: 100%; }
  .card-header-flex > div .btn { width: 100%; justify-content: center; }
}
.card-actions { display: flex; gap: 0.75rem; }

/* ============================================
   STATS GRID
   ============================================ */
/* ── Page header: title left, stat bar right on desktop ── */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-header .acct-stat-bar { margin-bottom: 0; }

/* ── Desktop compact account stat bar ── */
.acct-stat-bar {
  display: none; align-items: stretch; gap: 0;
  background: white; border: 1px solid var(--border-color);
  border-radius: 10px; box-shadow: var(--shadow);
  overflow: hidden;
}
.acct-stat-chip {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border-right: 1px solid var(--border-color);
  text-decoration: none; color: inherit;
}
.acct-stat-chip:last-of-type { border-right: none; }
.acct-stat-chip-link { cursor: pointer; transition: background 0.15s ease; }
.acct-stat-chip-link:hover { background: var(--light-gray); }
.acct-stat-chip-icon { font-size: 1.1rem; line-height: 1; }
.acct-stat-chip-body { display: flex; flex-direction: column; gap: 0.05rem; }
.acct-stat-chip-label { font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.acct-stat-chip-value { font-size: 0.9rem; font-weight: 700; color: var(--text-color); }
/* Pay estimate chip — blurred until hovered */
.acct-stat-chip-value--blurred {
  filter: blur(5px);
  transition: filter 0.2s ease;
  user-select: none;
}
.acct-stat-chip:hover .acct-stat-chip-value--blurred {
  filter: none;
}

/* ── Mobile modal clickable rows ── */
.acct-modal-stat-link {
  cursor: pointer; text-decoration: none; color: inherit;
  border-radius: 8px; transition: background 0.15s ease;
  margin: 0 -0.5rem; padding: 0.4rem 0.5rem;
}
.acct-modal-stat-link:hover { background: var(--light-gray); }

/* ── Plan picker modal ── */
.plan-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 9500;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.plan-modal-backdrop.active { display: flex; opacity: 1; }
.plan-modal {
  background: white; border-radius: 16px;
  width: min(92vw, 600px); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
  transform: translateY(10px); transition: transform 0.2s ease;
}
.plan-modal-backdrop.active .plan-modal { transform: translateY(0); }
.plan-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border-color);
  font-weight: 700; font-size: 1rem; color: var(--text-color);
}
.plan-modal-close {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  color: var(--text-light); padding: 0.25rem; line-height: 1;
}
.plan-modal-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; padding: 1.25rem 1.4rem;
}
@media (max-width: 480px) { .plan-modal-grid { grid-template-columns: 1fr; } }
.plan-modal-card {
  border: 2px solid var(--border-color); border-radius: 12px;
  padding: 1.1rem; position: relative; display: flex; flex-direction: column; gap: 0.6rem;
}
.plan-modal-card-active {
  border-color: var(--primary-color);
  background: rgba(37,99,235,0.03);
}
.plan-modal-badge {
  position: absolute; top: -0.65rem; left: 50%; transform: translateX(-50%);
  background: var(--primary-color); color: white;
  font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.6rem;
  border-radius: 20px; white-space: nowrap; letter-spacing: 0.03em;
}
.plan-modal-card-header { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.plan-modal-emoji { font-size: 1.4rem; }
.plan-modal-name { font-size: 1.1rem; font-weight: 700; color: var(--text-color); }
.plan-modal-employees { font-size: 0.8rem; color: var(--text-light); font-weight: 600; }
.plan-modal-features { margin: 0; padding: 0 0 0 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.plan-modal-features li { font-size: 0.82rem; color: var(--text-color); }
.plan-modal-note { font-size: 0.75rem; color: var(--text-light); font-style: italic; border-top: 1px solid var(--border-color); padding-top: 0.5rem; margin-top: auto; }
.plan-modal-footer {
  text-align: center; padding: 1rem 1.4rem 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.83rem; color: var(--text-light);
}
.plan-modal-footer a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.plan-modal-footer a:hover { text-decoration: underline; }

/* ── Calendar Widget ── */
.calendar-widget-body { padding: 0.75rem 1.25rem 1rem; }

/* ── Fleet Widget ── */
.fleet-widget-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem 1.25rem 0.75rem; }
@media (max-width: 600px) {
  .fleet-widget-stats { grid-template-columns: repeat(2, 1fr); }
}
.fleet-stat { display: flex; flex-direction: column; align-items: center; background: var(--light-gray); border-radius: 8px; padding: 0.75rem 0.5rem; }
.fleet-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-color); line-height: 1; }
.fleet-stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-top: 0.25rem; }
.fleet-stat-danger .fleet-stat-value { color: var(--danger, #dc2626); }
.fleet-stat-warn .fleet-stat-value { color: var(--warning, #d97706); }
.fleet-widget-alert { margin: 0 1.25rem 0.75rem; padding: 0.5rem 0.75rem; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; font-size: 0.82rem; color: #92400e; }
.fleet-widget-empty { padding: 1rem 1.25rem; color: var(--text-light); font-size: 0.9rem; }
.calendar-widget-date { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-bottom: 0.75rem; }
.calendar-widget-empty { display: flex; align-items: center; gap: 0.5rem; color: var(--text-light); font-size: 0.9rem; padding: 0.5rem 0; }
.calendar-widget-empty-icon { font-size: 1.2rem; }
.calendar-event-list { display: flex; flex-direction: column; gap: 0.6rem; }
.calendar-event-row { display: flex; align-items: flex-start; gap: 0.65rem; }
.calendar-event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.calendar-event-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.calendar-event-title { font-size: 0.88rem; font-weight: 600; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event-meta { font-size: 0.75rem; color: var(--text-light); }
.calendar-event-loc { color: var(--text-light); }

/* ── Activity Feed Modal ── */
.activity-feed-modal { max-width: 520px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
.activity-feed-modal-body {
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1rem;
  flex: 1;
}
.activity-feed-modal-body .activity-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.activity-feed-modal-body .activity-item:last-child { border-bottom: none; }

/* ── Calendar Create Event Modal (App Drawer) ── */
.cal-create-modal { max-width: 480px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
.cal-create-modal-body { overflow-y: auto; padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.cal-create-date-row { display: flex; align-items: center; gap: 0.75rem; }
.cal-create-date-label { font-weight: 600; font-size: 0.875rem; color: var(--text-color); white-space: nowrap; }
.cal-create-date-input { flex: 1; }
.cal-create-evlist { display: flex; flex-direction: column; gap: 0.35rem; min-height: 1rem; }
.cal-create-evlist-empty { font-size: 0.82rem; color: var(--text-light); margin: 0; padding: 0.25rem 0; }
.cal-create-ev-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; background: var(--light-gray); border-radius: 6px; font-size: 0.83rem; }
.cal-create-ev-title { flex: 1; font-weight: 500; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-create-ev-time { font-size: 0.75rem; color: var(--text-light); white-space: nowrap; }
.cal-ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Widget Picker Modal ── */
/* ── Dashboard toolbar (layout toggle + widget picker button) ── */
.dashboard-toolbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.layout-toggle-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid var(--border-color);
  border-radius: 8px; padding: 0.3rem 0.75rem;
  color: var(--text-light); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.layout-toggle-btn:hover { color: var(--primary-color); border-color: var(--primary-color); background: var(--light-gray); }
.layout-toggle-btn.is-drawer { color: var(--primary-color); border-color: var(--primary-color); background: var(--light-gray); }

/* ── App Drawer ── */
.app-drawer { padding: 0.5rem 0 1rem; max-width: 720px; margin: 0 auto; }
.app-drawer-section { margin-bottom: 1.75rem; }
.app-drawer-section-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-light);
  padding: 0 0.25rem; margin-bottom: 0.75rem;
}
.app-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}
.app-drawer-btn {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 0.65rem;
  background: white; border: 1px solid var(--border-color);
  border-radius: 18px; padding: 1.25rem 0.75rem 1.1rem;
  cursor: pointer; text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
  color: var(--text-color);
  -webkit-tap-highlight-color: transparent;
}
.app-drawer-btn:hover { border-color: var(--primary-color); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.app-drawer-btn:active { transform: translateY(0); box-shadow: none; }
.app-drawer-btn-icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--light-gray); flex-shrink: 0;
  transition: background 0.15s;
}
.app-drawer-btn-icon svg { width: 28px; height: 28px; color: var(--primary-color); }
.app-drawer-btn:hover .app-drawer-btn-icon { background: #e0eaff; }
.app-drawer-btn-label {
  font-size: 0.78rem; font-weight: 600; text-align: center;
  line-height: 1.3; color: var(--text-color);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.app-drawer-cert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-color, #3b82f6); color: #fff;
  font-size: 0.65rem; font-weight: 700; border-radius: 999px;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; line-height: 1;
}
.app-drawer-btn--soon { opacity: 0.5; cursor: default; pointer-events: none; }
.app-drawer-btn--soon .app-drawer-btn-label::after {
  content: ' (Soon)'; font-weight: 400; color: var(--text-light);
}

/* ── Widget picker layout section ── */
.widget-picker-body { padding: 1.1rem 1.4rem 1.25rem; }
.widget-picker-hint { font-size: 0.8rem; color: var(--text-light); margin: 0 0 0.85rem; }
.widget-picker-list { display: flex; flex-direction: column; gap: 0.5rem; }
.widget-picker-layout-section { margin-bottom: 1.25rem; }
.widget-picker-section-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-light); margin-bottom: 0.6rem; }
.widget-picker-layout-pills { display: flex; gap: 0.5rem; }
.layout-pill {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 0.75rem; border-radius: 8px;
  border: 2px solid var(--border-color); background: white;
  font-size: 0.82rem; font-weight: 600; color: var(--text-light);
  cursor: pointer; transition: all 0.15s;
}
.layout-pill:hover { border-color: var(--primary-color); color: var(--primary-color); }
.layout-pill.is-active { border-color: var(--primary-color); background: var(--primary-color); color: white; }
.layout-pill.is-active svg { stroke: white; }

/* Employee Cost/Hours Summary range filter pills */
.cost-range-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.cost-range-pill {
  padding: 0.22rem 0.7rem; border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--light-gray); color: var(--text-light);
  font-size: 0.77rem; font-weight: 600; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.cost-range-pill:hover { background: #e2e8f0; color: var(--text-color); border-color: #94a3b8; }
.cost-range-pill.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

.widget-picker-inline-btn {
  display: none; background: none; border: none; padding: 0;
  color: var(--primary-color); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.01em;
}
.widget-picker-inline-btn:hover { text-decoration: underline; }
.widget-picker-modal { max-width: 420px; }
.widget-picker-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-radius: 10px;
  background: var(--light-gray); gap: 1rem;
}
.widget-picker-row--disabled { opacity: 0.45; pointer-events: none; }
.widget-picker-row-left { display: flex; align-items: center; gap: 0.65rem; flex: 1; min-width: 0; }
.widget-picker-row-icon { font-size: 1.2rem; line-height: 1; }
.widget-picker-row-info { display: flex; flex-direction: column; gap: 0.1rem; }
.widget-picker-row-name { font-size: 0.9rem; font-weight: 600; color: var(--text-color); }
.widget-picker-row-desc { font-size: 0.75rem; color: var(--text-light); }
/* Reorder arrows */
.widget-reorder-arrows { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; margin-right: 0.5rem; }
.widget-reorder-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--border-color);
  background: white; cursor: pointer; color: var(--text-light);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  padding: 0;
}
.widget-reorder-btn:hover:not(:disabled) { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.widget-reorder-btn:disabled { opacity: 0.25; cursor: default; }
/* Toggle switch */
.widget-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.widget-toggle input { opacity: 0; width: 0; height: 0; }
.widget-toggle-slider {
  position: absolute; inset: 0; background: #cbd5e1;
  border-radius: 24px; cursor: pointer; transition: background 0.2s;
}
.widget-toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: #fff;
  border-radius: 50%; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.widget-toggle input:checked + .widget-toggle-slider { background: var(--primary-color); }
.widget-toggle input:checked + .widget-toggle-slider::before { transform: translateX(18px); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

/* ── Mobile account info bar + modal ── */
.acct-info-bar { display: none; }
.acct-info-modal-backdrop { display: none; }

@media (max-width: 768px) {
  .stats-grid-desktop { display: none !important; }

  .acct-info-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: white; border: 1px solid var(--border-color); border-radius: 10px;
    padding: 0.65rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
  }
  .acct-info-bar-left { display: flex; align-items: center; gap: 0.1rem; min-width: 0; }
  .acct-info-role { font-size: 0.85rem; color: var(--text-color); font-weight: 600; }
  .acct-info-btn {
    flex-shrink: 0; background: var(--primary-color); color: white;
    border: none; border-radius: 6px; padding: 0.35rem 0.75rem;
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
    white-space: nowrap;
  }
  .acct-info-btn:active { opacity: 0.85; }

  .acct-info-modal-backdrop {
    display: flex; align-items: center; justify-content: center;
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    z-index: 9000; opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .acct-info-modal-backdrop.active { opacity: 1; pointer-events: all; }
  .acct-info-modal {
    background: white; border-radius: 14px; width: min(92vw, 380px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.18); overflow: hidden;
    transform: translateY(12px); transition: transform 0.2s ease;
  }
  .acct-info-modal-backdrop.active .acct-info-modal { transform: translateY(0); }
  .acct-info-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color);
    font-weight: 700; font-size: 0.95rem; color: var(--text-color);
  }
  .acct-info-modal-close {
    background: none; border: none; font-size: 1rem; cursor: pointer;
    color: var(--text-light); padding: 0.25rem; line-height: 1;
  }
  .acct-info-modal-grid { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
  .acct-modal-stat { display: flex; align-items: center; gap: 0.75rem; }
  .acct-modal-icon { font-size: 1.4rem; width: 2rem; text-align: center; flex-shrink: 0; }
  .acct-modal-detail { display: flex; flex-direction: column; gap: 0.05rem; }
  .acct-modal-detail strong { font-size: 0.95rem; color: var(--text-color); }
  .acct-modal-detail span { font-size: 0.75rem; color: var(--text-light); }
}

.stat-card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border-color); transition: all 0.3s ease; display: flex; align-items: center; gap: 1rem; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.stat-card-link { cursor: pointer; text-decoration: none; color: inherit; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.stat-card-link:hover .stat-details p::after { content: ' →'; opacity: 0.6; }
.stat-card-active  { border-left: 4px solid #10b981; }
.stat-card-info    { border-left: 4px solid #3b82f6; }
.stat-card-warning { border-left: 4px solid #f59e0b; }
.stat-card-danger  { border-left: 4px solid #ef4444; }

.stat-icon { font-size: 2.5rem; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: white; border: 2px solid var(--border-color); border-radius: 12px; flex-shrink: 0; }
.stat-details { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.stat-details h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-color); margin: 0; line-height: 1.2; }
.stat-details p { font-size: 0.875rem; color: var(--text-light); margin: 0; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================
   ACCOUNT SELECTION
   ============================================ */
.account-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.account-card { background: white; border: 2px solid var(--border-color); border-radius: 12px; padding: 1.5rem; cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; gap: 1rem; }
.account-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.account-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.account-card-header h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-color); margin: 0; flex: 1; }
.account-status { padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-active   { background: rgba(16,185,129,0.1); color: #059669; }
.status-inactive { background: rgba(245,158,11,0.1); color: #d97706; }
.account-card-body, .account-info { display: flex; flex-direction: column; gap: 0.5rem; }
.account-role { font-size: 0.875rem; font-weight: 600; color: var(--primary-color); }
.account-subdomain { font-size: 0.875rem; color: var(--text-light); font-family: monospace; }

/* ============================================
   USERS LIST
   ============================================ */
.users-list { display: flex; flex-direction: column; gap: 1rem; }
.user-card { background: white; padding: 1.25rem; border-radius: 12px; border: 1px solid var(--border-color); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1.5rem; transition: all 0.3s ease; }
.user-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
/* Active employees list — avatar + info only, no role/actions columns */
.user-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-color, #1a56db); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; line-height: 1; }
/* Active employees — each card is its own 3-col grid: avatar | name+time | cost */
.active-employees-list { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
.active-emp-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 0 1.25rem; background: white; padding: 0.85rem 1.25rem; border-radius: 12px; border: 1px solid var(--border-color); }
.active-emp-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-color, #1a56db); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.active-emp-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.active-emp-name { font-weight: 600; color: var(--text-color); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-emp-sub  { color: var(--text-light, #6b7280); font-size: 0.82rem; }
.active-emp-cost { color: var(--text-light, #6b7280); font-size: 0.85rem; white-space: nowrap; text-align: right; }
@media (max-width: 480px) {
  .active-emp-card { grid-template-columns: 42px 1fr; gap: 0 0.85rem; }
  .active-emp-cost { grid-column: 2; font-size: 0.78rem; margin-top: 0.1rem; }
}
.user-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.user-name { font-weight: 600; color: var(--text-color); font-size: 1rem; }
.user-email { color: var(--text-light); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; }
.user-payrate { display: inline-flex; align-items: center; font-size: 0.875rem; color: var(--success-color); font-weight: 600; margin-top: 0.25rem; }
.user-role-badge { padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.875rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: center; min-width: 100px; justify-self: start; }
.user-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Role badges */
.role-owner   { background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-admin   { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-manager { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-foreman { background: linear-gradient(135deg, #059669 0%, #10b981 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-employee{ background: linear-gradient(135deg, #374151 0%, #4b5563 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-hr      { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-finance   { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); color: white; border: 1px solid rgba(255,255,255,0.2); }
.role-mechanics { background: #dc2626; color: white; border: 1px solid rgba(255,255,255,0.2); }

/* ============================================
   ACTIVITY FEED
   ============================================ */
.activity-feed { display: flex; flex-direction: column; max-height: 500px; overflow-y: auto; }
.activity-feed-collapsed { display: none; }
.activity-feed-loading, .activity-feed-empty { padding: 2rem; text-align: center; color: var(--text-light); }
.activity-feed-empty-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.card-header-collapsible { cursor: pointer; user-select: none; margin-bottom: 0; transition: opacity 0.15s; }
.card-header-collapsible:hover { opacity: 0.8; }
.card-header-collapsible + .activity-feed:not(.activity-feed-collapsed) { margin-top: 1.5rem; }
.collapse-chevron { font-size: 1.5rem; color: var(--text-light); line-height: 1; transition: transform 0.25s ease; display: inline-block; transform: rotate(0deg); }
.card-header-collapsible.is-open .collapse-chevron { transform: rotate(180deg); }
.activity-item { padding: 1rem; border-bottom: 1px solid var(--border-color); transition: background 0.2s ease; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--light-gray); }
.activity-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.activity-icon { font-size: 1.5rem; flex-shrink: 0; }
.activity-title { font-weight: 600; color: var(--text-color); font-size: 0.95rem; flex: 1; }
.activity-time { font-size: 0.8rem; color: var(--text-light); flex-shrink: 0; }
.activity-message { color: var(--text-light); font-size: 0.875rem; line-height: 1.5; margin-left: 2.25rem; }
.activity-details { margin: 0.5rem 0 0 2.25rem; padding: 0.75rem; background: var(--light-gray); border-radius: 6px; font-size: 0.8rem; }
.activity-details-row { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.activity-details-label { color: var(--text-light); font-weight: 500; }
.activity-details-value { color: var(--text-color); font-weight: 600; }

/* ============================================
   MODALS
   ============================================ */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(2px); }
body.modal-open,
html.modal-open { overflow: hidden; }
.modal:not(.hidden) { display: flex !important; }
.modal-content { background: white; border-radius: 12px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); position: relative; z-index: 10001; }
.modal-sm .modal-content, .modal-sm { max-width: 400px; }
.modal-large .modal-content { max-width: 700px; }
.modal-xl .modal-content { max-width: 900px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-xl .modal-header { flex-shrink: 0; }
.modal-xl .card-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.btn-sm { font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 6px; }
.btn-secondary.btn-sm { font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 6px; }
.btn-danger.btn-sm { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 6px; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-color, #3b82f6);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover, .btn-link:focus-visible {
  color: var(--primary-hover, #2563eb);
  text-decoration-color: currentColor;
  outline: none;
}
.btn-link.btn-sm { font-size: 0.8125rem; }
.btn-danger.btn-sm:hover { background: #ef4444; color: white; border-color: #ef4444; }
@media (max-width: 768px) {
  .btn-sm, .btn-secondary.btn-sm, .btn-danger.btn-sm { font-size: 0.9rem; padding: 0.6rem 1.1rem; min-height: 44px; }
}

.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-color); margin: 0; }

.btn-close, .modal-close { background: transparent; border: none; padding: 0; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: all 0.2s ease; position: relative; flex-shrink: 0; font-size: 0; color: var(--text-light); }
.btn-close::before, .btn-close::after, .modal-close::before, .modal-close::after { content: ''; position: absolute; width: 18px; height: 2px; background: currentColor; border-radius: 1px; transition: all 0.2s ease; }
.btn-close::before, .modal-close::before { transform: rotate(45deg); }
.btn-close::after, .modal-close::after { transform: rotate(-45deg); }
.btn-close:hover, .modal-close:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.btn-close:active, .modal-close:active { background: rgba(239,68,68,0.2); transform: scale(0.95); }

.modal-content form { padding: 1.5rem; }
.modal-content > p { padding: 1.5rem; margin: 0; color: var(--text-color); line-height: 1.6; }
.modal-actions, .modal-footer { padding: 1.5rem; display: flex; gap: 1rem; justify-content: flex-end; border-top: 1px solid var(--border-color); }
.modal-actions .btn, .modal-footer .btn, .modal-footer div .btn { min-width: 100px; }
@media (max-width: 480px) {
  .modal-footer { flex-wrap: wrap; }
  .modal-footer div .btn, .modal-footer .btn { flex: 1; min-width: 0; }
}
@media (max-width: 350px) {
  .modal-footer { flex-direction: column; }
  .modal-footer > div { display: flex; flex-direction: column; width: 100%; }
  .modal-footer div .btn, .modal-footer .btn { width: 100%; flex: unset; }
}

/* ── Signature chooser modal ──────────────────────────────────────────────── */
.modal-sign-chooser-inner {
  max-width: 420px;
}
.sign-chooser-preview {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 1.5rem 0;
  gap: 0.4rem;
}
.sign-chooser-preview.hidden { display: none; }
.sign-chooser-preview-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-light); margin: 0;
}
.sign-chooser-img {
  max-width: 100%; max-height: 80px; object-fit: contain;
  border: 1px solid var(--border-color); border-radius: 8px;
  background: #fafafa; padding: 0.5rem;
}
.sign-chooser-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; padding: 1.5rem;
}
.sign-chooser-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 1.75rem 1rem;
  background: var(--light-gray); border: 2px solid var(--border-color);
  border-radius: 14px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
  min-height: 140px;
}
.sign-chooser-btn:hover, .sign-chooser-btn:active {
  border-color: var(--primary-color);
  background: white;
  transform: scale(1.03);
}
.sign-chooser-icon { font-size: 2.25rem; line-height: 1; }
.sign-chooser-label { font-size: 1.1rem; font-weight: 700; color: var(--text-color); }
.sign-chooser-sub { font-size: 0.78rem; color: var(--text-light); text-align: center; }

/* ── Signature draw overlay (landscape full-screen on mobile) ─────────────── */
.modal-sign-draw-overlay {
  align-items: stretch; justify-content: stretch; padding: 0; overflow: hidden;
}
.modal-sign-draw-inner {
  display: flex; flex-direction: column;
  background: white;
  position: fixed; inset: 0;
  width: 100%; height: 100%;
}
.modal-sign-draw-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sign-draw-back {
  background: none; border: none; cursor: pointer;
  font-size: 0.95rem; color: var(--primary-color); font-weight: 600;
  padding: 0.25rem 0.5rem; border-radius: 6px;
}
.sign-draw-back:hover { background: var(--light-gray); }
.sign-draw-title {
  font-size: 1rem; font-weight: 600; color: var(--text-color);
}
.sig-canvas {
  flex: 1; display: block; width: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #fafafa;
}
.modal-sign-draw-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sig-pad-hint { margin: 0; font-size: 0.82rem; color: var(--text-light); }

/* ── Signature type modal ─────────────────────────────────────────────────── */
.modal-sign-type-inner { max-width: 460px; }

/* ── Signature card preview ───────────────────────────────────────────────── */
.sig-preview-area {
  padding: 1rem 1.5rem 1.5rem;
  display: flex; align-items: center;
}
.sig-preview-img {
  max-width: 100%; max-height: 120px;
  width: auto; height: auto;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fafafa;
  padding: 0.5rem;
  display: block;
}
.sig-none-text { margin: 0; color: var(--text-light); font-size: 0.9rem; }

/* ── Signature modals — portrait phone overrides ──────────────────────────── */
@media (max-width: 540px) and (orientation: portrait) {
  /* Chooser: tighter buttons so they fit without scrolling */
  .sign-chooser-btn { min-height: 90px; padding: 1rem 0.75rem; }
  .sign-chooser-icon { font-size: 1.75rem; }
  .sign-chooser-label { font-size: 0.95rem; }
  .sign-chooser-sub { font-size: 0.72rem; }
  .sign-chooser-actions { gap: 0.75rem; padding: 1rem; }
  .sign-chooser-preview { padding: 0.75rem 1rem 0; }
  .sign-chooser-img { max-height: 60px; }

  /* Draw: compact header/footer to give canvas max height in portrait */
  .sig-pad-hint { display: none; }
  .modal-sign-draw-header { padding: 0.5rem 0.75rem; }
  .modal-sign-draw-footer { padding: 0.5rem 0.75rem; }
  .modal-sign-draw-footer .btn { font-size: 0.85rem; padding: 0.4rem 0.9rem; }

  /* Type: make type-canvas smaller so the modal fits */
  #sig-type-canvas { max-height: 80px !important; }
  .modal-sign-type-inner .modal-header { padding: 1rem 1.25rem; }
  .modal-sign-type-inner .modal-header h2 { font-size: 1.2rem; }
}

/* Break quantity stepper (clock-out modal) */
.break-divider { border: none; border-top: 1px solid var(--border-color); margin: 0.25rem 0 1rem; }
.break-type-row { margin-bottom: 1rem; }
.break-type-label { font-size: 0.875rem; font-weight: 600; color: var(--dark); margin-bottom: 0.5rem; }
.break-stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; width: fit-content; }
.break-stepper-btn { width: 2.5rem; height: 2.5rem; padding: 0; font-size: 1.25rem; line-height: 1; background: var(--light-gray); color: var(--dark); border: none; border-radius: 0; transition: background 0.15s, color 0.15s; }
.break-stepper-btn:hover { background: var(--primary-color); color: #fff; }
.break-stepper-count { min-width: 3rem; text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--dark); padding: 0 0.25rem; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); line-height: 2.5rem; }
.break-total-preview { font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem; font-style: italic; min-height: 1.2em; }
.modal-body { padding: 1.5rem; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.empty-state-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.25rem; color: var(--text-color); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; }

/* ============================================
   BADGES
   ============================================ */
.badge { display: inline-block; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.025em; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-primary   { background: #dbeafe; color: #1e40af; }
.badge-info      { background: #e0f2fe; color: #075985; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-secondary { background: #e5e7eb; color: #374151; }
.badge-default   { background: #f3f4f6; color: #6b7280; }
.badge-active    { display: inline-block; padding: 0.25rem 0.75rem; background: var(--success-color); color: white; border-radius: 12px; font-size: 0.875rem; font-weight: 500; }
.badge-premium   { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; font-size: 0.65rem; padding: 0.15rem 0.5rem; margin-left: 0.5rem; vertical-align: middle; }
.badge-danger    { background: #fee2e2; color: #991b1b; }

/* ── Certificate list rows ────────────────────────────────────────────────── */
.cert-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cert-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: var(--bg-secondary, #f9fafb); border: 1px solid var(--border-color); border-radius: 8px; transition: box-shadow 0.15s; }
.cert-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.cert-row-icon { font-size: 1.75rem; flex-shrink: 0; }
.cert-row-body { flex: 1; min-width: 0; }
.cert-row-name { font-weight: 600; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-row-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; font-size: 0.82rem; color: var(--text-light); align-items: center; }
.cert-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
@media (max-width: 600px) {
  .cert-row { flex-wrap: wrap; align-items: flex-start; gap: 0.6rem; padding: 0.85rem 1rem; }
  .cert-row-icon { font-size: 1.4rem; margin-top: 0.1rem; }
  .cert-row-body { width: calc(100% - 2.2rem); }
  .cert-row-name { white-space: normal; word-break: break-word; }
  .cert-row-meta { gap: 0.4rem; }
  .cert-row-actions { width: 100%; justify-content: flex-end; gap: 0.4rem; margin-top: 0.25rem; }
  .cert-row-actions .btn { flex: 1; text-align: center; font-size: 0.8rem; padding: 0.35rem 0.5rem; }
}
.cert-employee-header { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 1.25rem 0.5rem 0.5rem; border-top: 1px solid var(--border-color); margin-top: 0.5rem; cursor: pointer; user-select: none; border-radius: 6px; transition: background 0.12s; }
.cert-employee-header:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.cert-employee-header:hover { background: var(--light-gray, #f8fafc); }
.cert-employee-avatar { font-size: 1rem; }
.cert-employee-count { font-size: 0.72rem; font-weight: 700; padding: 0.1em 0.45em; border-radius: 999px; background: #e2e8f0; color: #64748b; margin-left: 0.1rem; }
.cert-employee-chevron { margin-left: auto; font-size: 0.7rem; color: #94a3b8; transition: transform 0.18s; display: inline-block; }
.cert-employee-header.open .cert-employee-chevron { transform: rotate(90deg); }
.cert-employee-rows { display: none; padding-bottom: 0.5rem; }
.cert-employee-rows.open { display: block; }
.cert-vwr-meta-card { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:0.75rem; padding:2.5rem 2rem; text-align:center; flex:1; min-height:100vh; background:#fff; }
.cert-vwr-meta-icon  { font-size:3.5rem; line-height:1; }
.cert-vwr-meta-title { font-size:1.35rem; font-weight:700; margin:0; color:var(--text-color); }
.cert-vwr-meta-employee { font-size:0.95rem; color:var(--text-muted); margin:0; }
.cert-vwr-meta-row   { display:flex; gap:0.75rem; align-items:center; font-size:0.95rem; }
.cert-vwr-meta-label { font-weight:600; color:var(--text-muted); min-width:70px; text-align:right; }
.cert-vwr-no-file-note { font-size:0.82rem; color:var(--text-light); margin-top:0.5rem; }

/* Edited time entry row — soft red tint visible to all roles */
tr.entry-row-edited td { color: #b91c1c; }
tr.entry-row-edited { background: #fff5f5; }
tr.entry-row-edited:hover { background: #fee2e2 !important; }

/* Invoice stat card */
.stat-card.stat-card-action { transition: transform 0.15s, box-shadow 0.15s; }
.stat-card.stat-card-action:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); background: var(--primary-light, #eff6ff); }
.stat-card.stat-card-action:active { transform: translateY(0); }

/* Invoice popup */
#invoice-modal .invoice-date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
#invoice-modal .invoice-day-btn { padding: 0.5rem 0.75rem; border: 2px solid #e2e8f0; border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.85rem; text-align: left; transition: all 0.15s; }
#invoice-modal .invoice-day-btn:hover:not(:disabled) { border-color: var(--primary, #2563eb); background: #eff6ff; }
#invoice-modal .invoice-day-btn.selected { border-color: var(--primary, #2563eb); background: #dbeafe; font-weight: 600; }
#invoice-modal .invoice-day-btn.already-invoiced { border-color: #fca5a5; background: #fff5f5; color: #b91c1c; cursor: not-allowed; opacity: 0.7; }
#invoice-modal .invoice-summary { background: #f8fafc; border-radius: 8px; padding: 1rem; margin-top: 1rem; font-size: 0.9rem; }
#invoice-modal .invoice-summary strong { font-size: 1.05rem; }

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .loading-spinner { margin-right: 0.5rem; }

/* ============================================
   SETTINGS
   ============================================ */
.settings-tabs { display: flex; gap: 0.5rem; border-bottom: 2px solid var(--border-color); margin-bottom: 2rem; }
.settings-tab { padding: 0.75rem 1.5rem; background: none; border: none; border-bottom: 3px solid transparent; color: var(--text-light); font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; margin-bottom: -2px; }
.settings-tab:hover { color: var(--primary-color); }
.settings-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.settings-grid > .card { min-width: 0; }

.setting-item { padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--light-gray); }
.setting-item h3 { font-size: 1.125rem; margin-bottom: 0.5rem; color: var(--text-color); }
.setting-item p { color: var(--text-light); margin-bottom: 1rem; font-size: 0.875rem; }
.setting-item .form-group { margin-bottom: 1.5rem; }
.setting-item .form-group:last-of-type { margin-bottom: 0; }
.setting-section { padding: 1.5rem 0; }

/* Premium-locked settings rows / sections */
.setting-premium-locked { opacity: 0.45; pointer-events: none; }
.setting-premium-locked label, .setting-premium-locked input, .setting-premium-locked select, .setting-premium-locked small, .setting-premium-locked h3, .setting-premium-locked p { cursor: not-allowed; }

.logo-preview { padding: 2rem; border: 2px dashed var(--border-color); border-radius: 8px; text-align: center; margin-bottom: 1rem; background: white; min-height: 150px; display: flex; align-items: center; justify-content: center; }
.logo-preview img { display: block; margin: 0 auto; }
.logo-preview p { color: var(--text-light); margin: 0; }

.api-key-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; background: var(--light-gray); border-radius: 8px; margin-bottom: 0.5rem; }

/* ============================================
   SERVICES
   ============================================ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-top: 24px; }
.service-card { background: white; border: 2px solid var(--border-color); border-radius: 16px; padding: 24px; cursor: pointer; transition: all 0.3s ease; position: relative; display: flex; flex-direction: column; }
.service-card:hover { border-color: var(--primary-color); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-card-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.service-card-icon { font-size: 2.5rem; flex-shrink: 0; }
.service-card-info h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-color); margin: 0 0 4px 0; }
.service-card-info p { font-size: 0.875rem; color: var(--text-light); margin: 0; }
.service-card-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: auto; align-self: flex-start; }
.service-card-status.enabled  { background: rgba(5,150,105,0.1); color: var(--success-color); }
.service-card-status.disabled { background: rgba(100,116,139,0.1); color: var(--gray); }
.service-card-status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.service-card-features { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.service-card-features ul { list-style: none; padding: 0; margin: 0; }
.service-card-features li { font-size: 0.875rem; color: var(--text-light); padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.service-card-features li::before { content: "✓"; color: var(--success-color); font-weight: 700; }
.service-card-badge { position: absolute; top: 16px; right: 16px; background: var(--primary-color); color: white; padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.service-card-badge.free    { background: var(--success-color); }
.service-card-badge.premium { background: var(--warning-color); }
.service-card-badge-upgrade { background: linear-gradient(135deg, #f59e0b, #d97706) !important; color: white; text-transform: none !important; letter-spacing: 0; }
/* Locked plan cards — fully visible and inviting, gold accent border */
.service-card-locked { border-color: #f59e0b; }
.service-card-locked:hover { border-color: #d97706; box-shadow: 0 8px 24px rgba(245,158,11,0.2); transform: translateY(-4px); }
.service-card-coming-soon { opacity: 0.55; cursor: default; pointer-events: none; }
/* Upgrade banner inside service detail modal */
.service-upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #f59e0b; border-radius: 12px; padding: 16px 20px; margin: 0 24px 8px; }
.upgrade-banner-body { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.upgrade-banner-icon { font-size: 1.75rem; flex-shrink: 0; }
.upgrade-banner-text { display: flex; flex-direction: column; gap: 2px; }
.upgrade-banner-text strong { color: #92400e; font-size: 0.95rem; }
.upgrade-banner-text span { color: #a16207; font-size: 0.8rem; }
.btn-upgrade { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 0.875rem; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.btn-upgrade:hover { background: linear-gradient(135deg, #d97706, #b45309); color: white; transform: translateY(-1px); }

/* Inventory cards */
.inv-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 640px) { .inv-card-grid { grid-template-columns: 1fr; } }
.inv-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; box-shadow: var(--shadow); transition: box-shadow 0.15s, border-color 0.15s; }
.inv-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-color: var(--primary-color); }
.inv-card-clickable { cursor: pointer; }
.inv-item-card { flex-direction: row; align-items: center; gap: 0.75rem; padding: 0.85rem 1.25rem; }
.inv-item-card .inv-item-name { font-weight: 500; flex: 1; }
.inv-item-card .inv-item-badges { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
@media (max-width: 640px) {
  .inv-item-card { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .inv-item-card .inv-item-badges { flex-wrap: wrap; }
}
.inv-section-divider { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0 0.6rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--border-color); }
.inv-section-divider .inv-section-dot { border-radius: 50%; display: inline-block; flex-shrink: 0; }
.inv-section-divider strong { font-size: 1rem; color: var(--text-color); }
.inv-section-divider .inv-section-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.inv-badge-site { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; background: var(--primary-color); color: white; }
.inv-badge-trailer { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; background: #fef3c7; color: #92400e; }
.inv-badge-count { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; background: var(--primary-light, #eff6ff); color: white; }
.inv-type-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.inv-type-badge.badge-count      { background: #dbeafe; color: #1e40af; }
.inv-type-badge.badge-inspection { background: #fce7f3; color: #9d174d; }
.inv-tag { font-size: 0.7rem; background: var(--light-gray); border-radius: 20px; padding: 0.15rem 0.5rem; white-space: nowrap; }

/* Dashboard inventory widget */
.inv-widget-stat { background: var(--light-gray); border-radius: 10px; padding: 0.75rem 0.5rem; text-align: center; }
.inv-widget-stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text-color); line-height: 1.1; }
.inv-widget-stat-lbl { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); margin-top: 0.2rem; }
.inv-widget-stat-warn .inv-widget-stat-val { color: #dc2626; }
.inv-widget-stat-ok  .inv-widget-stat-val { color: #16a34a; }
.inv-widget-site-card { background: var(--white); border: 1px solid var(--border-color); border-radius: 10px; padding: 0.8rem 0.9rem; }
.inv-widget-site-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; flex-wrap: wrap; }
.inv-widget-site-name { font-weight: 600; font-size: 0.88rem; color: var(--text-color); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Gauge site cards */
/* ============================================
   FINANCE LABOUR COST WIDGET
   ============================================ */
#finance-widget-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }

.finance-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.finance-kpi {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.9rem 1.1rem; border-radius: 10px;
}
.finance-kpi--blue   { background: linear-gradient(135deg,#dbeafe,#eff6ff); border:1px solid #bfdbfe; }
.finance-kpi--green  { background: linear-gradient(135deg,#dcfce7,#f0fdf4); border:1px solid #bbf7d0; }
.finance-kpi--purple { background: linear-gradient(135deg,#ede9fe,#f5f3ff); border:1px solid #ddd6fe; }
.finance-kpi--amber  { background: linear-gradient(135deg,#fef3c7,#fffbeb); border:1px solid #fde68a; }
.finance-kpi-label { font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-light); }
.finance-kpi-value { font-size:1.45rem; font-weight:800; color:var(--text-color); line-height:1; }
.finance-kpi--blue   .finance-kpi-value { color:#1d4ed8; }
.finance-kpi--green  .finance-kpi-value { color:#15803d; }
.finance-kpi--purple .finance-kpi-value { color:#6d28d9; }
.finance-kpi--amber  .finance-kpi-value { color:#92400e; }

.finance-chart-wrap { display:flex; flex-direction:column; gap:0.4rem; }
.finance-chart-label { font-size:0.75rem; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:0.04em; }

@media (max-width: 768px) {
  .finance-chart-desktop { display: none; }
  .finance-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .finance-kpi { padding: 0.75rem 0.85rem; }
  .finance-kpi-value { font-size: 1.25rem; }
  .finance-kpi-label { font-size: 0.65rem; }

  /* HR widget: stack to single column on mobile */
  .hr-widget-actions {
    grid-template-columns: 1fr;
  }
  .hr-widget-actions .hr-action-btn-soon {
    max-width: 100%;
  }
}

/* ============================================
   EMPLOYEE INVENTORY HISTORY WIDGET
   ============================================ */
#emp-inv-widget-body { padding: 0; }

.emp-inv-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem; text-align: center; color: var(--text-light);
}
.emp-inv-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.6; }
.emp-inv-empty p { margin: 0; font-size: 0.9rem; }

.emp-inv-list { display: flex; flex-direction: column; }
.emp-inv-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}
.emp-inv-row:last-child { border-bottom: none; }
.emp-inv-row-left  { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.emp-inv-site-icon { font-size: 1.4rem; flex-shrink: 0; }
.emp-inv-row-info  { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.emp-inv-site-name { font-weight: 700; font-size: 0.9rem; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-inv-meta      { font-size: 0.75rem; color: var(--text-light); }
.emp-inv-row-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.emp-inv-pct       { font-size: 1.2rem; font-weight: 800; line-height: 1; }
.emp-inv-pct-label { font-size: 0.65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.emp-inv-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border-color); }
.emp-inv-view-all { font-size: 0.83rem; font-weight: 600; color: var(--primary-color); text-decoration: none; }
.emp-inv-view-all:hover { text-decoration: underline; }

/* ============================================
   HR PEOPLE WIDGET
   ============================================ */
#hr-widget-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }

.hr-widget-stats {
  display: flex; gap: 1rem;
}
.hr-stat-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.1rem 0.5rem; border-radius: 12px; position: relative; overflow: hidden;
  gap: 0.2rem;
}
.hr-stat-chip--blue   { background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%); border: 1px solid #bfdbfe; }
.hr-stat-chip--green  { background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%); border: 1px solid #bbf7d0; }
.hr-stat-chip--amber  { background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%); border: 1px solid #fde68a; }
.hr-stat-value { font-size: 2rem; font-weight: 800; color: var(--text-color); line-height: 1; }
.hr-stat-chip--blue  .hr-stat-value { color: #1d4ed8; }
.hr-stat-chip--green .hr-stat-value { color: #15803d; }
.hr-stat-chip--amber .hr-stat-value { color: #92400e; }
.hr-stat-label { font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }

.hr-widget-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
/* "Send Notice" spans both columns but is capped in width */
.hr-widget-actions .hr-action-btn-soon {
  grid-column: 1 / -1;
  max-width: 240px;
  justify-self: center;
  width: 100%;
}
.hr-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1.1rem; border-radius: 8px; font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--border-color); background: white; color: var(--text-color);
  text-decoration: none; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative; font-family: inherit; box-sizing: border-box;
}
.hr-action-btn:hover { background: var(--light-gray); border-color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.hr-action-btn--primary {
  background: var(--primary-color); color: white; border-color: var(--primary-color);
}
.hr-action-btn--primary:hover { background: var(--primary-dark, #1d4ed8); border-color: var(--primary-dark, #1d4ed8); }
.hr-action-btn--primary .hr-action-icon { color: white; font-size: 1.2rem; font-weight: 300; }
.hr-action-btn-soon { opacity: 0.5; cursor: default; pointer-events: none; }
.hr-action-icon { font-size: 1rem; line-height: 1; }
.hr-soon-badge {
  font-size: 0.6rem; font-weight: 700; background: var(--text-light); color: white;
  border-radius: 4px; padding: 0.1rem 0.35rem; letter-spacing: 0.04em; text-transform: uppercase;
  margin-left: 0.1rem;
}

.inv-widget-site-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px)  { .inv-widget-site-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .inv-widget-site-grid { grid-template-columns: 1fr; } }
.inv-widget-site-card-v2 { background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.1rem 1rem 0.9rem; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; }
.inv-gauge-center { display: flex; justify-content: center; margin: 0.6rem 0 0; }
.inv-gauge-svg { width: 110px; height: 110px; overflow: visible; }
.inv-gauge-num { font-size: 16px; font-weight: 700; fill: var(--text-color); font-family: inherit; }
.inv-gauge-lbl { font-size: 8px; fill: var(--text-light); font-family: inherit; }
/* Fade-in animation */
.inv-gauge-card-fade { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
.inv-gauge-card-visible { opacity: 1; transform: translateY(0); }
/* Inventory health pills (shared: dashboard widget + inventory page) */
.inv-pill { padding: 0.2rem 0.55rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.inv-pill.pill-exact  { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.inv-pill.pill-under  { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.inv-pill.pill-over   { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.inv-pill.pill-dmg    { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.inv-pill.pill-none   { background: var(--light-gray); color: var(--text-light); border-color: var(--border-color); }

/* Assignment cards (Settings → Inventory Assignments) */
.inv-asgn-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; margin-bottom: 0.85rem; box-shadow: var(--shadow); }
.inv-asgn-card-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1.1rem; background: var(--light-gray); border-bottom: 1px solid var(--border-color); gap: 0.75rem; }
.inv-asgn-card-title { display: flex; align-items: center; gap: 0.6rem; }
.inv-asgn-site-name { font-weight: 700; font-size: 0.95rem; color: var(--text-color); }
.inv-asgn-card-count { font-size: 0.78rem; color: var(--text-light); white-space: nowrap; }
.inv-asgn-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem 1.1rem; min-height: 2.5rem; align-items: center; }
.inv-asgn-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 20px; padding: 0.3rem 0.5rem 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 500; }
.inv-asgn-pill-meta { font-size: 0.7rem; color: #3b82f6; background: #dbeafe; border-radius: 10px; padding: 0.1rem 0.4rem; }
.inv-asgn-pill-remove { background: none; border: none; cursor: pointer; color: #93c5fd; font-size: 1rem; line-height: 1; padding: 0 0.1rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; }
.inv-asgn-pill-remove:hover { color: #1e40af; background: #bfdbfe; }
.inv-asgn-empty { font-size: 0.82rem; color: var(--text-light); font-style: italic; }
.inv-asgn-add { padding: 0.6rem 1.1rem; border-top: 1px solid var(--border-color); background: var(--white); }
.inv-asgn-add-select { width: 100%; max-width: 360px; padding: 0.45rem 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.85rem; color: var(--text-color); background: var(--white); cursor: pointer; outline: none; }
.inv-asgn-add-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

.service-detail-header { display: flex; gap: 20px; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid var(--border-color); }
.service-detail-icon { font-size: 4rem; flex-shrink: 0; }
.service-detail-info h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-color); margin: 0 0 8px 0; }
.service-detail-info p { font-size: 1rem; color: var(--text-light); margin: 0 0 12px 0; }
.service-status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 16px; font-size: 0.875rem; font-weight: 600; background: var(--light-gray); }
.service-status-badge .status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); }
.service-status-badge .status-dot.enabled { background: var(--success-color); }
.service-detail-content { display: grid; gap: 24px; }
.service-features h4, .service-pricing h4, .service-requirements h4 { font-size: 1.125rem; font-weight: 600; color: var(--text-color); margin: 0 0 12px 0; }
.service-features ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.service-features li { display: flex; align-items: flex-start; gap: 12px; color: var(--text-light); }
.service-features li::before { content: "✓"; color: var(--success-color); font-weight: 700; font-size: 1.125rem; flex-shrink: 0; }
.pricing-info, .requirements-info { background: var(--light-gray); padding: 16px; border-radius: 12px; color: var(--text-light); }
.pricing-info .pricing-tier { margin-bottom: 12px; }
.pricing-info .pricing-tier:last-child { margin-bottom: 0; }
.pricing-tier strong { color: var(--text-color); font-weight: 600; }

/* ============================================
   TIMECLOCK — EMPLOYEE WIDGET
   ============================================ */
.timeclock-card { max-width: 100%; margin: 0 auto; }
.timeclock-container { padding: 2rem; max-width: 600px; margin: 0 auto; }
.timeclock-header { display: flex; justify-content: center; margin-bottom: 2rem; }
.status-indicator { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1.25rem; background: var(--light-gray); border-radius: 50px; border: 2px solid var(--border-color); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gray); transition: all 0.3s ease; }
.status-indicator.active .status-dot { background: var(--success-color); box-shadow: 0 0 0 4px rgba(5,150,105,0.2); animation: pulse-dot 2s ease-in-out infinite; }
#status-label { font-weight: 600; font-size: 0.875rem; color: var(--text-color); text-transform: uppercase; letter-spacing: 0.05em; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.timeclock-display { background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%); border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow-lg); }
.clock-main { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.2); }
.clock-time { font-size: 3rem; font-weight: 700; color: white; font-family: 'Courier New', 'Monaco', monospace; letter-spacing: 0.1em; line-height: 1.2; margin-bottom: 0.5rem; }
.clock-label { font-size: 0.875rem; color: rgba(255,255,255,0.9); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.clock-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.clock-info-item { text-align: center; }
.clock-info-label { font-size: 0.75rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; font-weight: 500; }
.clock-info-value { font-size: 1.125rem; color: white; font-weight: 600; font-family: 'Courier New', 'Monaco', monospace; }

.timeclock-action { display: flex; justify-content: center; }
.btn-clock { padding: 1rem 2.5rem; font-size: 1.125rem; font-weight: 600; border-radius: 8px; min-width: 200px; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.clock-btn-emoji { display: inline-flex; align-items: center; line-height: 1; font-style: normal; }
.btn-clock-in  { background: var(--success-color); color: white; border: none; }
.btn-clock-in:hover  { background: #047857; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-clock-out { background: var(--danger-color); color: white; border: none; }
.btn-clock-out:hover { background: #b91c1c; transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.active-entry { background-color: #dbeafe; }
.entry-row-editable:hover { background-color: #f8fafc; transition: background-color 0.2s ease; }

/* ============================================
   TIMECLOCK — MANAGER DASHBOARD
   ============================================ */
.pay-period-banner { margin-bottom: 1.5rem; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%); color: white; border-radius: 12px; padding: 1.5rem; }
.pay-period-content { display: flex; justify-content: space-between; align-items: center; }
.pay-period-info h3 { margin: 0; color: white; font-size: 1.25rem; font-weight: 600; }
.pay-period-info p { margin: 0.5rem 0 0 0; opacity: 0.9; font-size: 0.95rem; }
.pay-period-cost { text-align: right; }
.pay-period-cost-amount { font-size: 2rem; font-weight: bold; margin: 0; }
.pay-period-cost-label { opacity: 0.9; font-size: 0.875rem; margin: 0; }

.timeclock-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.chart-container { padding: 1.5rem; min-height: 300px; position: relative; display: flex; align-items: center; justify-content: center; }
.chart-canvas { max-height: 320px; width: 100% !important; height: auto !important; max-width: 500px; margin: 0 auto; }

.timeclock-table-card { margin-bottom: 2rem; overflow: hidden; padding: 0; }
.timeclock-table-card .card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.timeclock-table-card .scroll-hint { padding: 0 1.5rem; }
.timeclock-table-card .card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.timeclock-table-card .card-header h2, .timeclock-table-card .card-header h3 { margin: 0; font-size: 1.25rem; color: var(--text-color); }
.timeclock-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.timeclock-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.timeclock-table thead { background: var(--light-gray); position: sticky; top: 0; z-index: 10; }
.timeclock-table th { padding: 0.875rem 1rem; text-align: left; font-weight: 600; color: var(--text-color); border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.timeclock-table th.sortable { cursor: pointer; user-select: none; transition: background-color 0.15s ease; }
.timeclock-table th.sortable:hover { background: var(--light-gray); }
.timeclock-table th.sortable .sort-indicator { font-size: 0.75em; color: var(--primary-color); }
.timeclock-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.timeclock-table tbody tr { transition: background-color 0.15s ease; }
.timeclock-table tbody tr:nth-child(even) td { background: var(--bg-subtle, #f9fafb); }
.timeclock-table tbody tr:hover td { background: var(--bg-hover, #eef2ff); }
.timeclock-table tbody tr:last-child td { border-bottom: none; }
.timeclock-table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.cost-highlight { font-weight: 600; color: var(--success-color); }
.overtime-highlight { color: var(--warning-color); font-weight: 500; }
.table-empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.table-empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.table-empty-state-text { font-size: 1rem; margin: 0; }

.filter-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding-bottom: 10px; }

/* Refresh button spin animation */
@keyframes tc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tc-refresh-spinning svg { animation: tc-spin 0.6s ease-in-out; }

/* Timeclock custom select dropdown (replaces native <select> for Android) */
.tc-cs-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.9rem; border: 1px solid var(--border-color); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 0.875rem; color: var(--text-color);
  user-select: none; transition: border-color 0.2s, box-shadow 0.2s; white-space: nowrap;
}
.tc-cs-btn:hover { border-color: #cbd5e1; }
.tc-cs-arrow { font-size: 0.6rem; color: #6b7280; margin-left: 0.5rem; flex-shrink: 0; }
.tc-cs-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px);
  background: #fff; border: 1px solid var(--border-color); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 200;
  max-height: 240px; overflow-y: auto;
}
.tc-cs-opt {
  padding: 0.6rem 0.9rem; font-size: 0.875rem; color: #111827; cursor: pointer;
  border-bottom: 1px solid #f3f4f6; transition: background 0.1s;
}
.tc-cs-opt:last-child { border-bottom: none; }
.tc-cs-opt:hover { background: #f0f9ff; }
.tc-cs-opt.tc-cs-sel { background: #eff6ff; color: var(--primary-color); font-weight: 600; }
.filter-controls .form-control { width: auto; min-width: 150px; }
.filter-controls .tc-filter-employee { max-width: 200px; }
.employee-filter { display: flex; gap: 0.75rem; align-items: center; flex: 1; justify-content: flex-end; }
.filter-separator { color: var(--text-light); font-weight: 500; padding: 0 0.25rem; }
.filter-actions { display: flex; gap: 0.5rem; margin-left: 0.5rem; }
.scroll-hint { display: none; text-align: center; padding: 0.5rem 1rem; color: var(--text-light); font-size: 0.75rem; font-style: italic; }

/* ============================================
   NFC TIMECLOCK KIOSK
   ============================================ */
.nfc-timeclock-page { background: var(--light-gray); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.nfc-container { background: white; border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-width: 600px; width: 100%; padding: 40px; text-align: center; }
.nfc-header { margin-bottom: 40px; }
.nfc-header h1 { font-size: 2.5rem; font-weight: 700; color: var(--text-color); margin-bottom: 16px; }
.nfc-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; background: var(--light-gray); }

/* NFC status-dot (extends base .status-dot) */
.status-dot.ready      { background: var(--success-color); animation: none; }
.status-dot.loading    { background: var(--primary-color); animation: pulse 1s infinite; }
.status-dot.processing { background: var(--warning-color); animation: pulse 0.5s infinite; }
.status-dot.success    { background: var(--success-color); animation: none; }
.status-dot.error      { background: var(--danger-color); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.status-text { font-size: 0.875rem; font-weight: 500; color: var(--text-color); }
.nfc-action-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.nfc-action-btn { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 20px; background: var(--light-gray); border: 3px solid transparent; border-radius: 16px; cursor: pointer; transition: all 0.3s ease; font-size: 1.125rem; font-weight: 600; color: var(--text-color); }
.nfc-action-btn:hover { background: #e2e8f0; transform: translateY(-2px); }
.nfc-action-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-hover); }
.nfc-action-btn svg { width: 48px; height: 48px; }

.nfc-scan-area { padding: 60px 20px; transition: opacity 0.3s ease; }
.nfc-scan-area.hidden { display: none; }
.scan-animation { margin-bottom: 32px; }
.scan-animation svg { color: var(--primary-color); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.nfc-scan-area h2 { font-size: 1.875rem; font-weight: 700; color: var(--text-color); margin-bottom: 8px; }
.nfc-scan-area p { font-size: 1.125rem; color: var(--text-light); margin-bottom: 32px; }
.nfc-input-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.scan-instruction { font-size: 1.25rem !important; color: var(--text-light) !important; font-weight: 500; }

.nfc-confirmation { padding: 40px 20px; transition: opacity 0.3s ease; }
.nfc-confirmation.hidden { display: none; }
.employee-avatar { width: 120px; height: 120px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-color); color: white; }
.employee-name { font-size: 2.5rem; font-weight: 700; color: var(--text-color); margin-bottom: 24px; }
.confirmation-icon { width: 120px; height: 120px; margin: 0 auto 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; animation: scaleIn 0.5s ease; }
.confirmation-icon.success { background: rgba(5,150,105,0.1); color: var(--success-color); }
.confirmation-icon.error   { background: rgba(220,38,38,0.1); color: var(--danger-color); }
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-details { margin-bottom: 32px; }
.confirm-action { font-size: 1.75rem; font-weight: 700; color: var(--primary-color); margin-bottom: 12px; }
.confirm-time { font-size: 1.5rem; font-weight: 600; color: var(--text-color); margin-bottom: 24px; }
.hours-worked { background: var(--light-gray); border-radius: 12px; padding: 20px; margin-top: 24px; }
.time-detail { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 1.125rem; }
.time-detail.total-hours { margin-top: 12px; padding-top: 16px; border-top: 2px solid var(--border-color); font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.time-label { color: var(--text-light); font-weight: 500; }
.time-value { color: var(--text-color); font-weight: 600; }
.total-hours .time-value { color: var(--primary-color); font-weight: 700; }
.confirm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 500px; margin: 0 auto; }

.nfc-result { padding: 40px 20px; transition: opacity 0.3s ease; }
.nfc-result.hidden { display: none; }
.result-message { font-size: 1.5rem; font-weight: 600; color: var(--text-color); margin: 16px 0; }
.result-time { font-size: 1.25rem; color: var(--text-light); }

.tag-data-container { background: var(--light-gray); border-radius: 12px; padding: 24px; min-height: 200px; }
.tag-data-status { text-align: center; padding: 40px 20px; color: var(--text-light); font-size: 1.125rem; }
.tag-data-content { display: flex; flex-direction: column; gap: 16px; }
.tag-data-content.hidden { display: none; }
.tag-data-field { background: white; padding: 16px; border-radius: 8px; border: 1px solid var(--border-color); }
.tag-data-field strong { display: block; margin-bottom: 8px; color: var(--text-color); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; }
.tag-data-field code { display: block; background: var(--light-gray); padding: 12px; border-radius: 6px; font-family: 'Courier New', monospace; font-size: 1rem; color: var(--text-color); word-break: break-all; white-space: pre-wrap; }

.nfc-settings-btn { position: fixed; bottom: 32px; right: 32px; width: 56px; height: 56px; background: white; border: none; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; color: var(--text-color); }
.nfc-settings-btn:hover { background: var(--light-gray); transform: rotate(90deg); }

/* ============================================
   PROFILE & ICE CONTACTS
   ============================================ */
.ice-contact-card { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 0.75rem; transition: all 0.2s ease; }
.ice-contact-card:hover { border-color: var(--primary-color); background: rgba(37,99,235,0.02); }
.ice-contact-info { flex: 1; }
.ice-contact-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; font-size: 1rem; color: var(--text-color); }
.ice-contact-relationship { font-size: 0.875rem; color: var(--text-light); margin-bottom: 0.25rem; }
.ice-contact-phone { font-size: 0.875rem; color: var(--text-color); font-weight: 500; }
.ice-contact-actions { display: flex; gap: 0.5rem; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet — 1024px */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .timeclock-charts { grid-template-columns: 1fr; }
  .hide-tablet { display: none !important; }
  .chart-container { padding: 1rem; min-height: 250px; }
  .chart-canvas { max-height: 260px; max-width: 100%; }
}

/* Tablet — show scroll hint when content area is too narrow for wide tables */
@media (max-width: 1100px) {
  .scroll-hint { display: block; }
}

/* Mobile — 768px */
@media (max-width: 768px) {
  /* Landing header */
  header .container { flex-wrap: wrap; }
  header nav { flex-direction: column; width: 100%; display: none; padding: 1rem 0 0.5rem; }
  header nav.active { display: flex; }
  header nav a { width: 100%; text-align: center; padding: 0.75rem 1rem; }
  .mobile-menu-toggle { display: block; }

  /* Footer */
  footer { padding: 2rem 0 1rem; margin-top: 3rem; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  /* Sidebar */
  .sidebar { transform: translateX(-100%); width: 280px; overflow-x: hidden; height: 100dvh; overflow-y: auto; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-100%); width: 280px; }
  .sidebar.mobile-open .nav-text { opacity: 1; width: auto; }
  .sidebar .logo { margin-top: 4rem; padding: 0 1.5rem; }
  .sidebar-overlay.active { display: block; }
  .mobile-menu-btn { display: flex; }

  /* Main content */
  .main-content { margin-left: 0; padding: 1rem; padding-top: 6rem; width: 100%; }
  .sidebar.collapsed + .main-content { margin-left: 0; width: 100%; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-card { flex-direction: column; text-align: center; padding: 1.25rem; }
  .stat-icon { width: 50px; height: 50px; font-size: 2rem; }
  .stat-details h3 { font-size: 1.25rem; }

  /* User cards */
  .user-card { grid-template-columns: 1fr; gap: 1rem; }
  .user-info { order: 1; }
  .user-role-badge { order: 2; justify-self: start; }
  .user-actions { order: 3; justify-content: flex-start; }

  /* Modals */
  .modal { padding: 0; align-items: flex-end; }
  .modal-content { max-width: 100%; max-height: 95vh; border-radius: 12px 12px 0 0; animation: slideUp 0.3s ease-out; }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .alert.success, .alert.error, .alert.warning, .alert.info { top: 4.5rem; right: 1rem; left: 1rem; min-width: auto; }

  /* Text helpers */
  .text-short { display: inline; }
  .text-full { display: none; }

  /* Card header */
  .card-header-actions { flex-direction: column; gap: 1rem; }
  .card-header-actions > div { width: 100%; }
  .card-header-actions .btn { width: 100%; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr; }
  .settings-tabs { flex-wrap: wrap; overflow-x: visible; }
  .settings-tab { white-space: nowrap; padding: 0.6rem 0.9rem; font-size: 0.9rem; }
  .color-picker-group { flex-direction: column; align-items: stretch; }
  .color-picker-group input[type="color"] { width: 100%; }
  .form-actions { flex-direction: column; }
  .form-actions button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: 1; }

  /* Timeclock manager */
  .pay-period-content { flex-direction: column; text-align: center; }
  .pay-period-cost { text-align: center; margin-top: 1rem; }
  .filter-controls { flex-direction: column; align-items: stretch; }
  .filter-controls .form-control { width: 100%; max-width: 100%; }
  .timeclock-table-card .card-header { flex-direction: column; align-items: flex-start; }
  .timeclock-table { font-size: 0.85rem; }
  .timeclock-table th, .timeclock-table td { padding: 0.75rem 0.5rem; }

  /* Timeclock card headers — allow wrapping so badge/buttons don't smush title */
  .card-header { flex-wrap: wrap; }
  #active-employees-section .card-header { align-items: center; }
  #active-employees-section .card-header > div { flex-shrink: 0; }
  .cost-range-pills { justify-content: flex-start; }

  /* Charts single column */
  .timeclock-charts { grid-template-columns: 1fr; }

  /* Pay period banner tighter padding */
  .pay-period-banner { padding: 1.1rem; }

  /* Manager clock section */
  .manager-clock-header { flex-wrap: wrap; }
  .manager-clock-section { padding: 1.25rem; }

  /* Stacked table */
  .timeclock-table-stacked { display: block; }
  .timeclock-table-stacked thead { display: none; }
  .timeclock-table-stacked tbody, .timeclock-table-stacked tr, .timeclock-table-stacked td { display: block; width: 100%; }
  .timeclock-table-stacked tr { margin-bottom: 1rem; border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; background: white; }
  .timeclock-table-stacked td { padding: 0.5rem 0; border: none; text-align: left !important; }
  .timeclock-table-stacked td:before { content: attr(data-label); font-weight: 600; display: inline-block; width: 120px; color: var(--text-light); }

  /* Responsive table generic */
  .hide-mobile { display: none !important; }
  .responsive-table tbody tr { display: block; margin-bottom: 1rem; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
  .responsive-table thead { display: none; }
  .responsive-table tbody td { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border: none; border-bottom: 1px solid var(--border-color); }
  .responsive-table tbody td:last-child { border-bottom: none; }
  .responsive-table tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text-light); margin-right: 1rem; }
  .responsive-table tbody tr.active-entry { border-left: 4px solid var(--success-color); }

  /* Employee filter */
  .employee-filter { flex-direction: column; align-items: stretch; width: 100%; }
  .filter-separator { text-align: center; }
  .employee-filter .form-control { width: 100%; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions button { flex: 1; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }
  .service-detail-header { flex-direction: column; text-align: center; }
  .service-detail-icon { font-size: 3rem; }
  .alert-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* NFC kiosk */
  .nfc-container { padding: 24px; }
  .nfc-header h1 { font-size: 2rem; }
  .nfc-action-selector { grid-template-columns: 1fr; }
  .nfc-scan-area { padding: 40px 20px; }

  /* Timeclock widget */
  .timeclock-container { padding: 1.5rem; }
  .timeclock-display { padding: 1.5rem; }
  .clock-time { font-size: 2.25rem; }
  .clock-info { gap: 1rem; }
  .clock-info-value { font-size: 1rem; }
  .btn-clock { padding: 0.875rem 2rem; font-size: 1rem; min-width: 160px; }
  .clock-actions { flex-direction: column; }
  .btn-lg { width: 100%; }

  /* ICE contacts */
  .ice-contact-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .ice-contact-actions { width: 100%; justify-content: flex-end; }
}

/* Small Mobile — 480px */
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  .timeclock-stats, .employee-timeclock-stats { display: grid; grid-template-columns: 1fr; gap: 1rem; }
  .timeclock-stats .stat-card, .employee-timeclock-stats .stat-card { grid-column: 1 / -1; }

  .timeclock-page-stats { grid-template-columns: repeat(2, 1fr); }
  .timeclock-page-stats .stat-card:nth-child(1) { order: 1; }
  .timeclock-page-stats .stat-card:nth-child(4) { order: 2; }
  .timeclock-page-stats .stat-card:nth-child(3) { order: 3; }
  .timeclock-page-stats .stat-card:nth-child(2) { order: 4; }

  .card-header-actions { flex-direction: column; gap: 1rem; }
  .card-header-actions > div { width: 100%; }
  .card-header-actions .btn { width: 100%; }

  .modal-content { border-radius: 0; max-height: 100vh; }
  .modal-header { padding: 1rem; position: sticky; top: 0; background: white; z-index: 10; }
  .modal-content form { padding: 1rem; }

  .timeclock-container { padding: 1rem; }
  .clock-time { font-size: 1.875rem; }
  .clock-info { grid-template-columns: 1fr; gap: 0.75rem; }
  .btn-clock { width: 100%; min-width: auto; }
  .status-indicator { font-size: 0.8125rem; }

  .pay-period-cost-amount { font-size: 1.5rem; }
  .chart-container { padding: 0.75rem; min-height: 220px; }
  .chart-canvas { max-height: 220px; max-width: 100%; }
}

/* Desktop only */
@media (min-width: 769px) {
  .mobile-menu-toggle { display: none; }
  .responsive-table tbody tr.active-entry { background: rgba(5,150,105,0.05); border-left: 4px solid var(--success-color); }
  .stats-grid-desktop { display: inline-flex !important; }
}

/* ── Backups Settings Tab ── */
/* Toggle switch (reusable, aligned with widget-toggle style) */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 26px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--primary-color); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }
/* Provider row */
.backup-provider-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--light-gray); margin-top: 1rem; }
.backup-provider-info { display: flex; align-items: center; gap: 0.85rem; }
.backup-provider-icon-emoji { font-size: 1.75rem; line-height: 1; }
.backup-provider-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 0.15rem; }
/* Sheet cards */
.backup-sheet-card { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border: 1px solid var(--border-color); border-radius: 10px; background: #fff; margin-bottom: 0.75rem; gap: 1rem; transition: box-shadow 0.15s; }
.backup-sheet-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.backup-sheet-card-info { display: flex; align-items: center; gap: 0.85rem; }
.backup-sheet-icon { font-size: 1.5rem; line-height: 1; }
.backup-sheet-status { font-size: 0.82rem; margin-top: 0.2rem; }
.backup-badge-active { color: var(--success-color); font-weight: 600; }
.backup-badge-pending { color: var(--text-light); font-style: italic; }
.backup-dots-wrap { display: inline; }
.backup-dots { display: inline-block; letter-spacing: -0.05em; }
.backup-dots::after {
  content: '\2219\2219\2219';
  display: inline-block;
  animation: backup-dot-cycle 1.2s steps(3, end) infinite;
  clip-path: inset(0 67% 0 0);
}
@keyframes backup-dot-cycle {
  0%   { clip-path: inset(0 67% 0 0); }
  33%  { clip-path: inset(0 34% 0 0); }
  66%  { clip-path: inset(0 0%  0 0); }
  100% { clip-path: inset(0 67% 0 0); }
}
.backup-pending-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.3rem; font-style: normal; }
.backup-sheet-link { white-space: nowrap; flex-shrink: 0; }
.backup-sheet-pending { opacity: 0.75; }
/* Action button group on export cards */
.backup-sheet-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.btn-ghost { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); cursor: pointer; border-radius: 6px; font-size: 0.8rem; padding: 0.3rem 0.65rem; transition: background 0.15s, border-color 0.15s; }
.btn-ghost:hover { background: var(--hover-bg, #f5f5f5); border-color: var(--text-light); }

/* ============================================
   CUSTOM TIME PICKER (timepicker.js)
   ============================================ */

/* ── split date+time widget ── */
.tc-dt-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
}
.tc-dt-date {
  flex: 1 1 0;
  min-width: 0;
}
.tc-dt-time-btn {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
  min-width: 100px;
  text-align: center;
}
.tc-dt-time-btn:hover { border-color: #cbd5e1; }
.tc-dt-time-btn:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
/* Once a time has been set, show it in the normal text colour */
.tc-dt-time-btn.tc-tp-btn-set { color: var(--text-color); }

/* ── time picker popup ── */
.tc-timepicker {
  position: fixed;
  z-index: 20000;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 12px 32px -4px rgba(0,0,0,0.18), 0 4px 10px -2px rgba(0,0,0,0.1);
  width: 288px;
  padding: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
  user-select: none;
}
.tc-timepicker.tc-tp-open { display: flex; }

/* Date picker grid */
.tc-dp-grid-header { display:grid;grid-template-columns:repeat(7,1fr);background:var(--light-gray);border-bottom:1px solid var(--border-color); }
.tc-dp-dow { text-align:center;font-size:0.7rem;font-weight:700;color:var(--text-light);padding:0.35rem 0; }
.tc-dp-grid { display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:0.5rem; }
.tc-dp-cell { text-align:center;padding:0.45rem 0;font-size:0.875rem;border-radius:6px;cursor:pointer;color:var(--text-color);transition:background 0.1s; }
.tc-dp-cell:hover { background:#f0f9ff; }
.tc-dp-cell.tc-dp-sel { background:var(--primary-color);color:#fff;font-weight:700; }
.tc-dp-cell.tc-dp-today { border:1.5px solid var(--primary-color);color:var(--primary-color);font-weight:600; }
.tc-dp-cell.tc-dp-today.tc-dp-sel { border-color:transparent;color:#fff; }
.tc-dp-cell.tc-dp-empty { cursor:default; }
.tc-dp-nav { background:none;border:none;font-size:1.4rem;color:var(--text-light);cursor:pointer;padding:0 0.4rem;line-height:1;border-radius:6px;transition:color 0.1s; }
.tc-dp-nav:hover { color:var(--primary-color); }

/* large live-preview display */
.tc-tp-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.85rem 1rem 0.65rem;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border-color);
}
.tc-tp-display-hour,
.tc-tp-display-minute {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
  min-width: 2.5ch;
  text-align: center;
}
.tc-tp-display-colon { font-size: 2rem; font-weight: 700; color: var(--primary-color); }
.tc-tp-display-ampm  {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-left: 0.4rem;
  align-self: flex-end;
  padding-bottom: 0.3rem;
}

/* columns */
.tc-tp-columns {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
}
.tc-tp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.tc-tp-col-sep {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 0 0.2rem;
  align-self: center;
}
.tc-tp-col-ampm {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-left: 0.75rem;
}

/* arrow buttons */
.tc-tp-arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-light);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.tc-tp-arrow:hover { color: var(--primary-color); background: rgba(37,99,235,0.08); }

/* scrollable item list */
.tc-tp-scroll {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 140px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  text-align: center;
}
.tc-tp-scroll::-webkit-scrollbar { display: none; }

.tc-tp-item {
  scroll-snap-align: center;
  padding: 0.45rem 0.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 7px;
  margin: 1px 4px;
  transition: background 0.12s, color 0.12s;
}
.tc-tp-item:hover    { background: rgba(37,99,235,0.07); color: var(--primary-color); }
.tc-tp-item.selected { background: var(--primary-color); color: #fff; font-weight: 700; }
.tc-tp-item:focus    { outline: 2px solid var(--primary-color); outline-offset: -2px; }

/* AM / PM toggle */
.tc-tp-ampm-btn {
  padding: 0.45rem 0.75rem;
  border: 2px solid var(--border-color);
  background: #fff;
  color: var(--text-light);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 48px;
  text-align: center;
}
.tc-tp-ampm-btn:hover    { border-color: var(--primary-color); color: var(--primary-color); }
.tc-tp-ampm-btn.selected { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* footer */
.tc-tp-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--light-gray);
  justify-content: flex-end;
}
.tc-tp-footer .btn { font-size: 0.875rem; padding: 0.5rem 1.1rem; }

/* Bottom-sheet on very small screens */
@media (max-width: 380px) {
  .tc-timepicker {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0;
  }
  .tc-dt-wrapper { flex-direction: column; }
  .tc-dt-time-btn { width: 100%; }
}

/* ── Documents widget section dividers ───────────────────────────────────── */
.docs-folder-divider {
  height: 1px;
  background: var(--border-color, #e5e7eb);
  margin: 0.75rem 0 0.5rem;
}
.docs-widget-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #9ca3af);
  padding: 0.75rem 0 0.4rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  margin-top: 0.5rem;
}
#docs-widget-personal-section:first-of-type .docs-widget-section-label,
#docs-widget-team-section:first-of-type .docs-widget-section-label {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* ── Raise Scratch-to-Reveal Modal ──────────────────────────────────────────── */
#raise-scratch-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#raise-scratch-modal:not(.hidden) { display: flex; }

.raise-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  animation: raise-fade-in 0.35s ease;
}

.raise-modal-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 2rem 2rem 1.5rem;
  max-width: 360px;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: raise-pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  z-index: 1;
}

.raise-modal-close {
  position: absolute;
  top: 0.75rem; right: 0.9rem;
  background: none; border: none;
  font-size: 1rem; color: #94a3b8;
  cursor: pointer; line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.raise-modal-close:hover { background: #f1f5f9; color: #475569; }

.raise-modal-emoji { font-size: 2.8rem; line-height: 1; margin-bottom: 0.4rem; }
.raise-modal-title { font-size: 1.5rem; font-weight: 800; color: #1e293b; margin: 0 0 0.25rem; }
.raise-modal-sub   { font-size: 0.875rem; color: #64748b; margin: 0 0 1.2rem; }

/* Scratch area — layered canvas over reveal panel */
.raise-scratch-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(99,102,241,0.35);
  user-select: none;
}

.raise-reveal-btn {
  display: block;
  width: 100%;
  padding: 1.6rem 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px dashed #86efac;
  border-radius: 14px;
  color: #15803d;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(5, 150, 105, 0.15);
}
.raise-reveal-btn:hover  { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); box-shadow: 0 6px 22px rgba(5,150,105,0.22); }
.raise-reveal-btn:active { transform: scale(0.97); }
/* Hide the button once revealed */
#raise-scratch-modal.revealed .raise-reveal-btn { display: none; }

.raise-reveal-panel {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 14px;
}
/* Show the reveal panel once tapped */
#raise-scratch-modal.revealed .raise-reveal-panel {
  display: flex;
}

.raise-reveal-amount {
  font-size: 2rem;
  font-weight: 900;
  color: #16a34a;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

/* When revealed (55% scratched) fade-in the amount */
#raise-scratch-modal.revealed .raise-reveal-amount {
  opacity: 1;
  transform: scale(1);
}

.raise-modal-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0.9rem 0 0;
}

@keyframes raise-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes raise-pop-in   {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── NFC Enroll — waiting-for-scan card ─────────────────────────────────────── */
.nfc-enroll-waiting-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  margin: 0.25rem 0 0.75rem;
}
.nfc-enroll-waiting-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.nfc-enroll-waiting-pulse {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
  animation: nfc-pulse-text 1.6s ease-in-out infinite;
}
.nfc-enroll-waiting-hint {
  font-size: 0.825rem;
  color: #3b82f6;
  margin: 0;
  line-height: 1.45;
}
@keyframes nfc-pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ── NFC Badge Enrollment — inline section inside Edit User modal ────────────── */
#nfc-badge-group {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  background: var(--bg-secondary, #f8fafc);
  transition: border-color 0.2s, background 0.2s;
}
#nfc-badge-group.nfc-waiting {
  border-color: #93c5fd;
  background: #eff6ff;
}
#nfc-badge-group.nfc-success {
  border-color: #86efac;
  background: #f0fdf4;
}
#nfc-badge-group.nfc-error {
  border-color: #fca5a5;
  background: #fff1f2;
}

#nfc-badge-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
  min-height: 1.2em;
  transition: color 0.2s;
}
#nfc-badge-hint.nfc-hint-waiting {
  color: #1d4ed8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
#nfc-badge-hint.nfc-hint-success { color: #15803d; font-weight: 600; }
#nfc-badge-hint.nfc-hint-error   { color: #dc2626; }

.nfc-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  flex-shrink: 0;
  animation: nfc-badge-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes nfc-badge-dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.3; transform: scale(0.7);  }
}

/* Fleet vehicle NFC group — reuses same state classes */
#fv-nfc-group.nfc-waiting { border-color: #93c5fd; background: #eff6ff; }
#fv-nfc-group.nfc-success { border-color: #86efac; background: #f0fdf4; }
#fv-nfc-group.nfc-error   { border-color: #fca5a5; background: #fff1f2; }

#fv-nfc-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
  min-height: 1.2em;
  transition: color 0.2s;
}
#fv-nfc-hint.nfc-hint-waiting {
  color: #1d4ed8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
#fv-nfc-hint.nfc-hint-success { color: #15803d; font-weight: 600; }
#fv-nfc-hint.nfc-hint-error   { color: #dc2626; }
