/* Algotix HR — brand tokens & component overrides */
:root {
  --primary: #FF5500;
  --primary-dark: #E64A00;
  --primary-hover: #FF6B35;
  --black: #0D0D0D;
  --white: #FFFFFF;
  --bg-light: #F9F9F9;
  --text-primary: #0D0D0D;
  --text-secondary: #666666;
  --border: #EEEEEE;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  --tint: #FFF5F0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-radius: 50px;
  padding: 12px 28px;
  font-weight: 600;
  transition: background 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 50px;
  padding: 10px 26px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--primary); color: var(--white); }

.btn-danger {
  border: 2px solid var(--error);
  color: var(--error);
  background: transparent;
  border-radius: 50px;
  padding: 10px 26px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.btn-danger:hover { background: var(--error); color: var(--white); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Loading primitives ---- */
@keyframes app-spin { to { transform: rotate(360deg); } }
@keyframes app-shimmer {
  from { background-position: -200px 0; }
  to   { background-position: 200px 0; }
}

.app-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: app-spin 0.7s linear infinite;
  vertical-align: middle;
}
.app-spinner.lg { width: 36px; height: 36px; border-width: 3px; }

/* Spinner sized to fit inline within a button while preserving label
   spacing. Use ``btn.classList.add('is-loading')`` to show. */
.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-primary.is-loading::after,
.btn-secondary.is-loading::after,
.btn-danger.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: app-spin 0.7s linear infinite;
  color: var(--primary);
}
.btn-primary.is-loading::after { color: var(--white); }
.btn-secondary.is-loading::after { color: var(--primary); }
.btn-danger.is-loading::after { color: var(--error); }

/* Skeleton row — a shimmering bar that hints "content loading here". */
.skeleton {
  background: linear-gradient(90deg, #F1F1F1 0px, #E8E8E8 40px, #F1F1F1 80px);
  background-size: 800px 100%;
  animation: app-shimmer 1.2s infinite linear;
  border-radius: 6px;
  display: inline-block;
  height: 1em;
  width: 100%;
}

/* Top-of-page indeterminate progress bar — show on link click so a
   slow page swap doesn't look frozen. */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.3s ease-out, opacity 0.2s 0.2s;
  z-index: 9999;
  pointer-events: none;
}
.nav-progress.show { transform: scaleX(0.9); }
.nav-progress.done { transform: scaleX(1); opacity: 0; }


/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Inputs (default — large for forms) */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  width: 100%;
  font-size: 0.95rem;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.15);
}

/* Compact filter bar (per spec) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.filter-bar .filter-input,
input.filter-input,
select.filter-input {
  height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 120px;
  max-width: 180px;
  width: auto;
  outline: none;
  background: var(--white);
}
.filter-input:focus { border-color: var(--primary); box-shadow: none; }
.btn-filter-apply {
  height: 36px;
  padding: 0 16px;
  font-size: 0.8rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
}
.btn-filter-apply:hover { background: var(--primary-dark); }
.btn-filter-reset {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  padding: 0 8px;
}
.btn-filter-reset:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .filter-bar .filter-input,
  input.filter-input,
  select.filter-input { min-width: calc(50% - 4px); max-width: none; flex: 1 1 calc(50% - 4px); }
}

/* Icon-only action buttons (used in tables) */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--tint); color: var(--primary); }
.btn-icon.icon-success:hover { color: var(--success); }
.btn-icon.icon-error:hover { color: var(--error); }
.btn-icon svg { width: 18px; height: 18px; }

/* Badges / status pills */
.badge {
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-error   { background: rgba(239,68,68,0.12); color: var(--error); }
.badge-info    { background: rgba(59,130,246,0.12); color: var(--info); }
.badge-primary { background: rgba(255,85,0,0.12); color: var(--primary); }
.badge-muted   { background: var(--border); color: var(--text-secondary); }

/* Sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.sidebar-link:hover { background: var(--tint); color: var(--primary); }
.sidebar-link.active {
  background: var(--tint);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Top nav */
.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* Tables */
.hr-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
.hr-table thead {
  background: var(--bg-light);
}
.hr-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hr-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-primary);
}
.hr-table.compact td { padding: 12px 16px; line-height: 1.4; min-height: 52px; }
.hr-table.compact tbody tr { min-height: 52px; }
.hr-table tbody tr:hover { background: var(--tint); }

/* Per-cell alignment overrides — higher specificity than `.hr-table th`'s
   default `text-align: left` so utility classes on individual <th> /<td>
   actually win and headers stay locked to their column content. */
.hr-table th.text-left,   .hr-table td.text-left   { text-align: left; }
.hr-table th.text-center, .hr-table td.text-center { text-align: center; }
.hr-table th.text-right,  .hr-table td.text-right  { text-align: right; }

/* Bordered action buttons used inside tables */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  justify-content: flex-end;
}
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { border-color: var(--primary); color: var(--primary); }
.action-btn.danger:hover { border-color: var(--error); color: var(--error); }
.action-btn.success:hover { border-color: var(--success); color: var(--success); }

/* Mobile-card transformation */
@media (max-width: 767px) {
  .hr-table thead { display: none; }
  .hr-table, .hr-table tbody, .hr-table tr, .hr-table td {
    display: block;
    width: 100%;
  }
  .hr-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    padding: 8px;
  }
  .hr-table td {
    border: none;
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  .hr-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 12px;
  }
}

/* Stat card grid */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-card .stat-body { flex: 1; min-width: 0; }
.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}
.stat-card .trend {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.trend.up   { color: var(--success); }
.trend.down { color: var(--error); }

/* Headings */
h1.h1, .h1 { font-size: 1.875rem; font-weight: 700; color: var(--text-primary); }
h2.h2, .h2 { font-size: 1.5rem;   font-weight: 700; color: var(--text-primary); }
h3.h3, .h3 { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }
.body { font-size: 1rem; color: var(--text-secondary); }
.small { font-size: 0.8rem; color: var(--text-secondary); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-link {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.5);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-card header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-card header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.modal-card .modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-card .modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card { max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
}

/* Sidebar collapsed (tablet) */
@media (min-width: 768px) and (max-width: 1023px) {
  .sidebar { width: 64px; }
  .sidebar .label { display: none; }
  .sidebar:hover { width: 240px; }
  .sidebar:hover .label { display: inline; }
}

.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ========== Permission Section A — assignment panels ========== */

.assign-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 767px) {
  .assign-panels { grid-template-columns: 1fr; }
}

.assign-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.assign-panel-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-search { position: relative; margin-bottom: 8px; }
.panel-search-input,
input.panel-search-input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 32px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--white);
}
.panel-search-input:focus { border-color: var(--primary); box-shadow: none; }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.panel-dept-filter {
  height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  width: 100%;
  background: var(--white);
}

.select-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg-light);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
}
.select-all-label input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0;
}
.selected-count { color: var(--primary); font-weight: 600; margin-left: 4px; }

.btn-assign-selected,
.btn-remove-selected {
  height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  opacity: 0.4;
  pointer-events: none;
  transition: all 0.2s;
}
.btn-assign-selected { background: var(--primary); color: white; }
.btn-remove-selected {
  background: white;
  color: var(--error);
  border: 1px solid var(--error);
}
.btn-assign-selected.active,
.btn-remove-selected.active {
  opacity: 1;
  pointer-events: all;
}

.employee-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  position: relative;
}
.employee-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, opacity 0.25s, transform 0.25s;
  font-size: 0.85rem;
  min-height: 44px;
}
.employee-row:last-child { border-bottom: none; }
.employee-row:hover { background: var(--tint); }
.employee-row.selected { background: var(--tint); }
.employee-row input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0;
  accent-color: var(--primary);
}
.employee-row.row-leave-right { opacity: 0; transform: translateX(40px); }
.employee-row.row-leave-left  { opacity: 0; transform: translateX(-40px); }

.emp-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.emp-name { flex: 1; min-width: 0; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-dept {
  font-size: 0.7rem;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 2px 8px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  gap: 4px;
}
.empty-state.show { display: flex; }
.empty-state .icon { font-size: 2rem; line-height: 1; }
.empty-state .title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.empty-state .subtitle { font-size: 0.75rem; }

/* iOS-style toggle */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-right: 6px;
  user-select: none;
}

/* Inline confirm warning */
.inline-confirm {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
}
.inline-confirm.show { display: flex; }
.inline-confirm .msg { flex: 1; color: var(--text-primary); }
.inline-confirm .btn-yes,
.inline-confirm .btn-no {
  height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.inline-confirm .btn-yes { background: var(--error); color: white; }
.inline-confirm .btn-no { background: white; color: var(--text-secondary); border: 1px solid var(--border); }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.toast {
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.8rem;
  color: white;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toast.toast-success { background: var(--success); }
.toast.toast-warning { background: var(--primary); }
.toast.toast-error   { background: var(--error); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Save bar below assignment panels */
.assign-save-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.btn-save-changes {
  height: 38px;
  padding: 0 22px;
  font-size: 0.85rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: var(--border);
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.2s;
}
.btn-save-changes.dirty {
  background: var(--primary);
  color: white;
  pointer-events: all;
}
.btn-save-changes.saving {
  background: var(--primary-dark);
  color: white;
  pointer-events: none;
}
.btn-save-changes.saved {
  background: var(--success);
  color: white;
}

/* ========== Announcements ========== */
.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.announce-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 85, 0, 0.08);
}
.announce-card.pinned {
  background: var(--tint);
  border-color: rgba(255, 85, 0, 0.4);
}
.announce-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.75rem;
}
.announce-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.prio-low    { background: var(--border); color: var(--text-secondary); }
.prio-normal { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.prio-high   { background: rgba(255, 85, 0, 0.12); color: var(--primary); }
.prio-urgent {
  background: rgba(239, 68, 68, 0.14);
  color: var(--error);
  animation: urgent-pulse 1.6s ease-in-out infinite;
}
@keyframes urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.announce-audience { background: var(--bg-light); color: var(--text-secondary); border: 1px solid var(--border); }
.announce-status   { background: var(--border);    color: var(--text-secondary); }
.announce-archived { background: var(--bg-light); color: #999; }
.announce-ack-pill { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.announce-time { color: #999; }
.announce-pinned {
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 700;
  margin-left: auto;
}
.announce-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}
.announce-title a { color: inherit; text-decoration: none; }
.announce-title a:hover { color: var(--primary); }
.announce-body { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.announce-body-full { color: var(--text-primary); font-size: 0.95rem; line-height: 1.65; white-space: pre-wrap; }
.announce-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.announce-foot .announce-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.announce-foot .announce-actions .btn-secondary {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-width: 1px;
}

/* Form layout */
.announce-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}
@media (max-width: 1023px) { .announce-form-grid { grid-template-columns: 1fr; } }
.announce-sidebar { position: sticky; top: 80px; align-self: start; }
@media (max-width: 1023px) { .announce-sidebar { position: static; } }

.audience-block { display: none; }

/* Employee picker — long lists with search + select-all */
.employee-picker-wrapper { display: flex; flex-direction: column; }
.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-light);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.picker-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
}
.picker-select-all input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0;
  accent-color: var(--primary);
}
.picker-count { color: var(--primary); font-weight: 600; }

.employee-picker {
  max-height: 360px;
  min-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 4px;
}
.employee-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.employee-picker-item:hover  { background: var(--tint); }
.employee-picker-item.selected { background: var(--tint); }
.employee-picker-item input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0;
  accent-color: var(--primary);
}
.employee-picker-item .emp-avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.employee-picker-item .emp-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
}
.employee-picker-item .emp-name .small { display: block; color: #999; font-weight: 400; font-size: 0.7rem; }
.employee-picker-item .emp-dept {
  font-size: 0.7rem;
  color: #999;
  background: var(--bg-light);
  border-radius: 50px;
  padding: 2px 8px;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .employee-picker { max-height: 280px; min-height: 200px; }
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  font-size: 0.875rem;
}
.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.audience-preview {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-top: 8px;
}
.preview-card { box-shadow: none; border-color: var(--border); }
.preview-card:hover { border-color: var(--border); box-shadow: none; }

/* ========== Employee Detail Page — clean white hero + plain stats + tabs + sidebar ========== */

/* Hero header — white card with thin orange left accent */
.emp-hero-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.emp-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.emp-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}
.emp-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.emp-hero-info { min-width: 0; }
.emp-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.emp-hero-name-row h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.status-pill {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.status-active   { background: #DCFCE7; color: #166534; }
.status-inactive { background: #FEE2E2; color: #991B1B; }
.emp-hero-subtitle {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 4px;
}
.emp-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #CCC;
}
.meta-tag {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.emp-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.more-actions-wrap { position: relative; }
.more-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  min-width: 220px;
  overflow: hidden;
  z-index: 20;
}
.more-actions-menu.open { display: block; }
.more-actions-menu a,
.more-actions-menu form button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  text-align: left;
  background: white;
  border: none;
  cursor: pointer;
}
.more-actions-menu a:hover,
.more-actions-menu form button:hover { background: var(--tint); color: var(--primary); }
.more-actions-menu .danger-link,
.more-actions-menu form button.danger-link { color: var(--error); }
.more-actions-menu .danger-link:hover,
.more-actions-menu form button.danger-link:hover { background: #FEF2F2; }
.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Stats row — plain typography, no icons, no hover */
.emp-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.emp-stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.emp-stat-card .stat-label {
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.emp-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}
.emp-stat-card .stat-progress {
  height: 4px;
  background: #F5F5F5;
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 6px;
}
.emp-stat-card .stat-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 50px;
}
.emp-stat-card .stat-sub {
  font-size: 0.72rem;
  color: #999;
}

/* Inline edit link (replaces the bordered pencil button) */
.btn-link-edit {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
}
.btn-link-edit:hover { background: var(--tint); }

/* 2-column main + sidebar layout */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

/* Tabs */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.detail-tab {
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.detail-tab:hover { color: var(--primary); }
.detail-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; }

/* Info cards */
.info-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F5F5F5;
}
.info-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.info-field {
  padding: 14px 0;
  border-bottom: 1px solid #F5F5F5;
}
.info-field.col-r {
  padding-left: 16px;
  border-left: 1px solid #F5F5F5;
}
.info-field.col-l {
  padding-right: 16px;
}
.info-grid .info-field:nth-last-child(-n+2) { border-bottom: none; }
.info-field-label {
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.info-field-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}
.info-field-value.muted { color: #999; font-weight: 400; }

/* Two-card row inside Overview tab */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 1023px) { .overview-grid { grid-template-columns: 1fr; } }

/* Sidebar cards */
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
@media (max-width: 1023px) { .detail-sidebar { position: static; } }
.sidebar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.sidebar-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.action-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.action-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CCC;
  flex-shrink: 0;
  transition: background 0.15s;
}
.action-item:hover {
  background: var(--tint);
  color: var(--primary);
}
.action-item:hover .dot { background: var(--primary); }
.action-item.danger { color: var(--error); }
.action-item.danger .dot { background: #FCA5A5; }
.action-item.danger:hover { background: #FEF2F2; color: var(--error); }
.action-item.danger:hover .dot { background: var(--error); }
.action-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Activity timeline */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
  position: relative;
}
.activity-item:not(:last-child) .activity-dot::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: calc(100% + 4px);
  background: var(--border);
}
.activity-content { flex: 1; min-width: 0; }
.activity-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
}
.activity-time {
  font-size: 0.7rem;
  color: #999;
  margin-top: 2px;
}

/* Compliance checklist */
.compliance-list { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.compliance-item { display: flex; align-items: center; gap: 8px; }
.compliance-item .check { color: var(--success); font-weight: 700; }
.compliance-item .warn  { color: var(--warning); font-weight: 700; }
.compliance-item .fail  { color: var(--error);   font-weight: 700; }

/* Calendar (Attendance tab) */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 0.85rem;
}
.cal-day-head {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cal-day {
  min-height: 64px;
  border-radius: 8px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
  position: relative;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
a.cal-day:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.cal-day-num {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}
.cal-day-meta {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  align-self: flex-end;
  margin-top: auto;
}
.cal-day.empty { background: transparent; min-height: 0; }
.cal-day.empty .cal-day-num,
.cal-day.empty .cal-day-meta { display: none; }
.cal-day.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-day.present { background: rgba(34,197,94,0.18); color: var(--success); font-weight: 600; }
.cal-day.late    { background: rgba(245,158,11,0.18); color: var(--warning); font-weight: 600; }
.cal-day.absent  { background: rgba(239,68,68,0.18); color: var(--error); font-weight: 600; }
.cal-day.leave   { background: rgba(59,130,246,0.18); color: var(--info); font-weight: 600; }
.cal-day.half    { background: rgba(245,158,11,0.10); color: var(--warning); font-weight: 600; }
.cal-day.weekend { background: #F0F0F0; color: #999; }
.cal-day.future  { background: white; border: 1px dashed var(--border); color: #BBB; }
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cal-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Month summary chips above the calendar grid */
.cal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}
.cal-summary-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text-secondary);
  line-height: 1;
}
.cal-summary-num {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cal-summary-label {
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.66rem;
}
.cal-summary-present { background: rgba(34,197,94,0.14); color: var(--success); }
.cal-summary-late    { background: rgba(245,158,11,0.16); color: var(--warning); }
.cal-summary-half    { background: rgba(245,158,11,0.10); color: var(--warning); }
.cal-summary-absent  { background: rgba(239,68,68,0.14); color: var(--error); }
.cal-summary-leave   { background: rgba(59,130,246,0.14); color: var(--info); }
.cal-summary-weekend { background: #F0F0F0; color: #6B7280; }

/* Documents tab grid */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.doc-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.doc-tile .doc-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.doc-tile .doc-meta { font-size: 0.75rem; color: #999; }
.doc-tile.empty { background: var(--bg-light); border-style: dashed; color: var(--text-secondary); }

/* Leave-balance tiles */
.leave-balance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 767px) { .leave-balance-row { grid-template-columns: 1fr; } }
.leave-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.leave-tile .lt-name { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.leave-tile .lt-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 4px 0 8px; }
.leave-tile .lt-bar { height: 6px; background: var(--border); border-radius: 50px; overflow: hidden; }
.leave-tile .lt-fill { height: 100%; background: var(--primary); border-radius: 50px; transition: width 0.5s; }

/* Responsive */
@media (max-width: 1023px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .hero-content { flex-direction: column; align-items: flex-start; }
  .hero-actions { flex-direction: row; width: 100%; }
  .btn-hero-primary, .btn-hero-secondary { flex: 1; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-field.col-r { padding-left: 0; border-left: none; }
  .info-field.col-l { padding-right: 0; }
  .employee-hero { padding: 24px; }
  .hero-info h1 { font-size: 1.4rem; }
}

/* ========== Reports page ========== */

/* Neutral banner (replaces the orange-tinted .date-range-info on this page). */
.date-range-banner {
  padding: 10px 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.date-range-banner strong { color: var(--text-primary); font-weight: 600; }
.date-range-banner .muted { color: #999; }

/* Simplified stats row — label + number, no icons, no hover. */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  .stats-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.report-stat-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.report-stat-tile .stat-label {
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.report-stat-tile .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* Plain text caret on the Export trigger (scoped to this dropdown only). */
.export-dropdown .btn-caret::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 8px;
  vertical-align: middle;
}

/* Empty state inside the data table — text only, no big icon. */
.empty-row {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.empty-row .reset-link {
  display: inline-block;
  margin-left: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.empty-row .reset-link:hover { text-decoration: underline; }

/* Legacy orange-tint banner kept for any other page that still uses it. */
.date-range-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tint);
  border: 1px solid #FFE0CC;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 12px 0 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.date-range-info .day-count { color: var(--primary); font-weight: 600; }
.filter-separator {
  color: #999;
  font-size: 0.9rem;
  padding: 0 4px;
  align-self: center;
}

.export-dropdown {
  position: relative;
  display: inline-block;
}
.export-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  min-width: 180px;
  z-index: 20;
  overflow: hidden;
}
.export-dropdown:hover .export-menu,
.export-dropdown:focus-within .export-menu,
.export-menu.open { display: block; }
.export-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
}
.export-menu a:hover { background: var(--tint); color: var(--primary); }

.report-tabs,
.section-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.report-tabs .tab,
.section-tabs .tab {
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.report-tabs .tab:hover,
.section-tabs .tab:hover { color: var(--primary); }
.report-tabs .tab.active,
.section-tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.punctuality-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.punctuality-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.punctuality-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 50px;
}
.punctuality-text { font-size: 0.8rem; font-weight: 600; }

.text-green  { color: var(--success); font-weight: 600; }
.text-orange { color: var(--primary); font-weight: 600; }
.text-red    { color: var(--error);   font-weight: 600; }

.stat-icon.icon-blue { background: rgba(59,130,246,0.12); color: var(--info); }
.stat-icon.icon-orange { background: var(--tint); color: var(--primary); }

.report-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
.report-empty .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ========== 403 / error page ========== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--bg-light);
}
.error-logo {
  width: 140px;
  margin-bottom: 32px;
}
.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}
.error-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.error-message {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ========== Settings page — editable inputs ========== */
.settings-input,
input.settings-input,
select.settings-input,
textarea.settings-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}
textarea.settings-input { height: auto; padding: 10px 12px; }
.settings-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.10);
}
.settings-input:read-only,
.settings-input[readonly],
.settings-input:disabled {
  background: var(--bg-light);
  color: #999;
  cursor: not-allowed;
}
.settings-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}
.settings-helper {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

/* "URL or upload" row used by Settings → Apps to give HR a choice
   between pasting an external link or uploading the installer/APK
   directly to the VPS (saved under /media/installers/). */
.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: #FAFAFA;
  border: 1px dashed #DDD;
  border-radius: 8px;
}
.upload-row:hover {
  border-color: #FF5500;
  background: #FFF8F4;
}
.upload-or {
  font-size: 0.74rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.upload-input {
  font-size: 0.82rem;
  color: #444;
  flex: 1;
  min-width: 0;
}
.upload-input::file-selector-button {
  background: #fff;
  border: 1px solid #DDD;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0D0D0D;
  cursor: pointer;
  margin-right: 8px;
}
.upload-input::file-selector-button:hover {
  border-color: #FF5500;
  color: #FF5500;
}


/* "How to find your office WiFi info" collapsible panel on the
   General settings tab. Sits above the three network-allowlist fields
   so HR can copy commands per OS to populate them. */
.net-help {
  background: #FFF5F0;
  border: 1px solid rgba(255, 85, 0, 0.18);
  border-radius: 10px;
  margin-bottom: 18px;
}
.net-help summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.net-help summary::-webkit-details-marker { display: none; }
.net-help summary::after {
  content: "▾";
  margin-left: auto;
  color: #FF5500;
  transition: transform 0.15s;
}
.net-help[open] summary::after { transform: rotate(180deg); }
.net-help-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #FF5500;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}
.net-help-body {
  padding: 4px 16px 18px;
}
.net-help-intro {
  font-size: 0.82rem;
  color: #555;
  margin: 0 0 14px;
  line-height: 1.55;
}
.net-help-intro strong { color: #0D0D0D; }

.net-help-block {
  background: #fff;
  border: 1px solid #F0E0D2;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.net-help-block-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0D0D0D;
  margin-bottom: 8px;
}
.net-help-block-sub {
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
}
.net-help-block-body p {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.55;
}
.net-help-block-body p code,
.net-help-intro code,
.net-help-hint code {
  background: #F4F4F4;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.78rem;
  color: #C2410C;
}
.net-help-os {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}
.net-help-os-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.net-help-cmd {
  display: block;
  background: #0D0D0D;
  color: #FDF6F0;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  overflow-x: auto;
  white-space: nowrap;
}
.net-help-hint {
  margin-top: 8px !important;
  font-size: 0.75rem !important;
  color: #777 !important;
  font-style: italic;
}
.net-help-tip {
  background: #FFF8F4;
  border-color: rgba(255, 85, 0, 0.25);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #444;
}
.net-help-tip strong { color: #FF5500; }
.input-with-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-with-suffix .settings-input { flex: 1; }
.input-suffix {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Tab panels — switched by JS */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sticky save bar */
.settings-save-bar {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  margin: 24px -24px -24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 5;
}
.unsaved-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}
.unsaved-indicator.show { display: inline-flex; }
.unsaved-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

#map-preview {
  height: 300px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 12px;
  overflow: hidden;
  background: var(--bg-light);
}
#map-preview iframe { width: 100%; height: 100%; border: none; display: block; }

/* ========== Payroll list — polished components ========== */

/* Period info strip below page header */
.period-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,85,0,0.04) 0%, rgba(255,85,0,0.02) 100%);
  border: 1px solid rgba(255,85,0,0.15);
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.period-strip .period-label {
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.period-strip .period-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}
.period-strip-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.period-strip-stats strong { color: var(--text-primary); font-weight: 700; }
.period-strip-stats .dot { width: 3px; height: 3px; border-radius: 50%; background: #CCC; }

/* Stat-tile left-border accent */
.report-stat-tile.accent-orange,
.report-stat-tile.accent-amber,
.report-stat-tile.accent-red,
.report-stat-tile.accent-green { border-left: 3px solid var(--border); }
.report-stat-tile.accent-orange { border-left-color: var(--primary); }
.report-stat-tile.accent-amber  { border-left-color: var(--warning); }
.report-stat-tile.accent-red    { border-left-color: var(--error); }
.report-stat-tile.accent-green  { border-left-color: var(--success); }

/* Inline attendance pills (Present / Late / Absent) */
.att-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.att-pill.pill-green   { background: #DCFCE7; color: #166534; min-width: 28px; height: 26px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.att-pill.pill-orange  { background: #FEF3C7; color: #92400E; min-width: 28px; height: 26px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.att-pill.pill-red     { background: #FEE2E2; color: #991B1B; min-width: 28px; height: 26px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Earnings / Deductions cells — right-aligned, tabular */
.earning-cell, .deduction-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 500;
}
.earning-cell   { color: #166534; }
.deduction-cell { color: #B91C1C; }

/* Net salary cell */
.net-salary-cell { text-align: right; }
.net-salary-cell .currency {
  font-size: 0.7rem;
  color: #999;
  font-weight: 500;
  margin-right: 4px;
}
.net-salary-cell .amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Status pills with soft dot indicator */
.status-pill.status-processed,
.status-pill.status-pending,
.status-pill.status-failed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-pill.status-processed::before,
.status-pill.status-pending::before,
.status-pill.status-failed::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-pill.status-processed::before { background: #22C55E; }
.status-pill.status-pending::before   { background: #F59E0B; }
.status-pill.status-failed::before    { background: #EF4444; }

/* Employee cell */
.employee-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.emp-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.employee-cell .emp-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.employee-cell .emp-id {
  font-size: 0.7rem;
  color: #999;
  margin-top: 2px;
}

/* Polished empty state */
.empty-row .empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-row .empty-sub {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 16px;
}

/* ---------- Generate Payroll form ---------- */
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.form-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F5F5F5;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; }
.form-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-input,
input.form-input,
select.form-input,
textarea.form-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  background: white;
  width: 100%;
  box-sizing: border-box;
}
textarea.form-input { height: auto; padding: 10px 12px; }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.10);
}

.scope-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.scope-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: white;
}
.scope-radio:hover {
  border-color: var(--primary);
  background: #FFF8F4;
}
.scope-radio input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: auto !important;
  padding: 0 !important;
  flex-shrink: 0;
}
.scope-radio input[type="radio"]:checked ~ .scope-content .scope-title {
  color: var(--primary);
}
.scope-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.scope-sub { font-size: 0.75rem; color: #999; }
.scope-picker {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F5F5F5;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 0;
}

/* ========== Payroll list — legacy compact attendance numbers ========== */

.attendance-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}
.att-num { font-weight: 600; }
.att-sep { color: #DDD; font-weight: 400; }
.att-legend {
  font-size: 0.65rem;
  color: #999;
  letter-spacing: 1px;
  margin-top: 2px;
  text-align: center;
}

/* Payroll-row status pills (separate modifiers from .status-active/.status-inactive) */
.status-pill.status-processed { background: #DCFCE7; color: #166534; }
.status-pill.status-pending   { background: #FEF3C7; color: #92400E; }
.status-pill.status-failed    { background: #FEE2E2; color: #991B1B; }

/* Disabled action button (Recalculate when already processed) */
.action-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.action-btn.disabled:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ========== Payroll list — stat-card icon colour variants ========== */
.stat-card.hover-rise {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card.hover-rise:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,85,0,0.10);
}
.stat-icon.icon-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.icon-error   { background: rgba(239,68,68,0.12); color: var(--error); }
.stat-icon.icon-success { background: rgba(34,197,94,0.12); color: var(--success); }

/* ========== Mini attendance pills (used in payroll list table) ========== */
.att-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 4px;
}
.att-pill.present { background: rgba(34,197,94,0.12);  color: var(--success); }
.att-pill.late    { background: rgba(245,158,11,0.12); color: var(--warning); }
.att-pill.absent  { background: rgba(239,68,68,0.12);  color: var(--error); }

.text-net {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.text-earning   { color: var(--success); font-weight: 600; }
.text-deduction { color: var(--error);   font-weight: 600; }

/* ========== Bulk action bar (sticky, slides in) ========== */
.bulk-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0 0 12px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 22px rgba(255,85,0,0.25);
  transform: translateY(-12px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.bulk-bar.show {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.bulk-bar .count { font-weight: 700; }
.bulk-bar .btn-bulk {
  background: white;
  color: var(--primary);
  border: none;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.bulk-bar .btn-bulk:hover { background: rgba(255,255,255,0.9); }
.bulk-bar .btn-bulk.outline {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.6);
}

/* ========== Payslip — orange gradient header + 2-col + leave bar ========== */
.payslip-grid {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
  gap: 16px;
}
@media (max-width: 1023px) { .payslip-grid { grid-template-columns: 1fr; } }

.payslip-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.payslip-card-body { padding: 28px; }

.payslip-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.payslip-header .brand { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; }
.payslip-header .brand-sub { font-size: 0.7rem; opacity: 0.85; margin-top: 2px; }
.payslip-header .label { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.04em; }
.payslip-header .label-sub { font-size: 0.75rem; opacity: 0.85; margin-top: 2px; text-align: right; }

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.payslip-table .att-num.present { color: var(--success); }
.payslip-table .att-num.absent  { color: var(--error); }
.payslip-table .att-num.late    { color: var(--warning); }
.payslip-table .att-num {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
}

.deduct-divider td {
  background: var(--bg-light);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  letter-spacing: 0.04em;
}
.payslip-table .total-deductions-row {
  background: rgba(239,68,68,0.10);
  font-weight: 700;
}
.payslip-table .total-deductions-row .deduction { color: var(--error); }
.payslip-table .net-row-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}
.payslip-table .net-row-gradient td { color: white; height: 52px; padding: 14px 16px; }
.payslip-table .net-row-gradient td.amount-col { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.leave-bar-track {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 50px;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  overflow: hidden;
}
.leave-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 50px;
  transition: width 0.5s ease;
}

.payslip-footer {
  background: var(--bg-light);
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  padding: 16px;
}

.sidebar-stack {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 1023px) { .sidebar-stack { position: static; } }
.sidebar-stack .card { padding: 20px; }
.sidebar-stack h4 {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  margin: 0 0 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-secondary); }

/* ========== Payslip preview tables ========== */
.payslip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.payslip-table th {
  background: var(--bg-light);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.payslip-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.payslip-table .earning   { color: var(--success); font-weight: 600; }
.payslip-table .deduction { color: var(--error);   font-weight: 600; }
.payslip-table .deduct-row { background: #FFF5F5; }
.payslip-table .total-row {
  background: var(--bg-light);
  font-weight: 700;
}
.payslip-table .net-row {
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
}
.payslip-table .net-row td { color: white; }
.payslip-table .att-totals td { font-weight: 700; font-size: 1.05rem; }
.payslip-table .remaining { color: var(--success); font-weight: 700; }
.payslip-table .orange-header th {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.amount-col { text-align: right; font-family: monospace; }
.text-center { text-align: center; }

/* FAB for mobile primary action */
.fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(255,85,0,0.4);
  z-index: 30;
}
.fab:hover { background: var(--primary-dark); }
.fab svg { width: 22px; height: 22px; }
@media (max-width: 767px) {
  .fab { display: inline-flex; }
  .desktop-only { display: none !important; }
}

/* ---- In-app toast for foreground FCM web pushes ---- */
.inapp-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #FFFFFF;
  border: 1px solid var(--border-soft, #EEEEEE);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 340px;
  max-width: calc(100vw - 48px);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  z-index: 10000;
  cursor: pointer;
}
.inapp-toast.show { transform: translateX(0); }
.inapp-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #FF5500);
  margin-top: 6px;
  flex-shrink: 0;
}
.inapp-toast-content { flex: 1; min-width: 0; }
.inapp-toast-title {
  font-weight: 600;
  color: var(--black, #0D0D0D);
  font-size: 0.9rem;
  margin-bottom: 2px;
  word-break: break-word;
}
.inapp-toast-body {
  font-size: 0.8rem;
  color: var(--text-secondary, #666666);
  line-height: 1.4;
  word-break: break-word;
}
.inapp-toast-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-secondary, #666666);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  line-height: 1;
}

/* line-clamp helper used by the bell list (Tailwind already supplies this
   in newer versions, but include a fallback). */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Nudge modal ============ */
.nudge-modal {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  animation: nudgeFadeIn 0.15s ease;
}
.nudge-modal.hidden { display: none; }

@keyframes nudgeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.nudge-modal-card {
  background: #FFFFFF;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  animation: nudgeSlideIn 0.18s ease;
}
@keyframes nudgeSlideIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.nudge-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 8px;
  border-bottom: 1px solid var(--border);
}
.nudge-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 4px;
}
.nudge-modal-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  max-width: 420px;
}
.nudge-icon-btn {
  background: none;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nudge-icon-btn:hover {
  background: var(--bg-light);
  color: var(--black);
}

.nudge-section {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}
.nudge-section:last-of-type { border-bottom: 0; }

.nudge-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.nudge-label-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Recipients picker — section header with counter pill */
.nudge-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.nudge-counter {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--tint, #FFF5F0);
  padding: 2px 10px;
  border-radius: 50px;
}
.nudge-counter--zero {
  color: var(--text-secondary);
  background: var(--bg-light, #F9F9F9);
}

/* Suggested-bar — appears when a template has matching emps */
.nudge-suggested-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--tint, #FFF5F0);
  border: 1px solid #FFE0CC;
  border-radius: 8px;
  margin-bottom: 8px;
}
.nudge-suggested-bar[hidden] { display: none; }
.nudge-suggested-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.nudge-suggested-info svg { color: var(--primary); flex-shrink: 0; }
.nudge-suggested-info strong {
  color: var(--black);
  font-weight: 700;
}
.btn-link-orange {
  background: none;
  border: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-link-orange:hover { background: #FFE0CC; }

/* Chips area + empty placeholder */
.nudge-chips-area {
  min-height: 56px;
  padding: 8px;
  background: var(--bg-light, #F9F9F9);
  border: 1px dashed #DDDDDD;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  align-content: flex-start;
  margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.nudge-chips-area.has-chips {
  background: white;
  border: 1px solid var(--border);
  border-style: solid;
}
.nudge-empty-chips {
  flex: 1;
  text-align: center;
  color: #BBBBBB;
  font-size: 0.78rem;
  padding: 10px 6px;
  align-self: center;
}

.nudge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tint, #FFF5F0);
  border: 1px solid #FFE0CC;
  color: var(--black);
  border-radius: 50px;
  padding: 3px 4px 3px 4px;
  font-size: 0.78rem;
  font-weight: 500;
  animation: nudgeChipIn 0.15s ease;
}
@keyframes nudgeChipIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.nudge-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nudge-chip-name {
  white-space: nowrap;
  padding: 0 2px;
}
.nudge-chip-remove {
  background: none;
  border: 0;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nudge-chip-remove:hover { background: #FFE0CC; color: var(--black); }

/* Search bar + dropdown */
.nudge-search-wrap { position: relative; }
.nudge-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.nudge-search-icon {
  position: absolute;
  left: 12px;
  color: #999;
  pointer-events: none;
}
.nudge-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--black);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}
.nudge-search-input:focus { border-color: var(--primary); }
.nudge-search-input::placeholder { color: #BBBBBB; }

/* On a regular page (no clipping container) ``position: absolute``
   anchored to ``.nudge-search-wrap`` is the natural fit. */
.nudge-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
}
.nudge-search-results.active { display: block; }

/* Page sections — same visual rhythm the modal had, but full-width. */
.nudge-page-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.nudge-page-section:last-of-type { border-bottom: 0; }
.nudge-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-light, #F9F9F9);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.nudge-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: white;
  border: 0;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #F5F5F5;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--black);
  transition: background 0.15s;
}
.nudge-search-result:last-child { border-bottom: none; }
.nudge-search-result:hover { background: var(--tint, #FFF5F0); }
.nudge-search-result.already-added {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.nudge-search-result.already-added::after {
  content: "Added";
  margin-left: auto;
  font-size: 0.7rem;
  color: #15803D;
  font-weight: 600;
  background: #DCFCE7;
  padding: 2px 8px;
  border-radius: 50px;
}
.nudge-search-info { flex: 1; min-width: 0; }
.nudge-search-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
}
.nudge-search-meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 1px;
}
.nudge-search-empty,
.nudge-search-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.nudge-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 480px) {
  .nudge-template-grid { grid-template-columns: 1fr; }
}
.nudge-template-card {
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.nudge-template-card:hover {
  border-color: var(--primary);
  background: var(--tint, #FFF5F0);
}
.nudge-template-card.selected {
  border-color: var(--primary);
  background: var(--tint, #FFF5F0);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.nudge-template-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 2px;
}
.nudge-template-preview {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nudge-loading {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 12px;
  text-align: center;
}
.nudge-loading.nudge-error { color: #B91C1C; }

.nudge-note {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
}
.nudge-note:focus {
  outline: none;
  border-color: var(--primary);
}

.nudge-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
}
.nudge-foot-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.nudge-foot-msg--ok    { color: #047857; }
.nudge-foot-msg--warn  { color: #B45309; }
.nudge-foot-msg--error { color: #B91C1C; }
.nudge-foot-buttons {
  display: flex;
  gap: 8px;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-with-icon svg {
  flex-shrink: 0;
}
.action-btn.nudge-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--tint, #FFF5F0);
}

/* ========== Pagination (server-rendered list pages) ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 1px solid var(--border, #EEE);
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card, #FFF);
}
.pagination-single-page { justify-content: flex-end; }
.pagination-info {
  color: var(--text-secondary, #666);
  font-size: 0.85rem;
}
.pagination-info strong {
  color: var(--ink, #0D0D0D);
  font-weight: 600;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.page-size-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
}
.page-size-selector label { white-space: nowrap; }
.page-size-selector select {
  padding: 5px 8px;
  border: 1px solid var(--border, #EEE);
  border-radius: 6px;
  background: white;
  font-size: 0.8rem;
  cursor: pointer;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: white;
  border: 1px solid var(--border, #EEE);
  border-radius: 6px;
  color: var(--text-secondary, #666);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.page-btn:hover:not([aria-disabled="true"]):not(.active) {
  border-color: var(--primary, #FF5500);
  color: var(--primary, #FF5500);
}
.page-btn.active {
  background: var(--primary, #FF5500);
  border-color: var(--primary, #FF5500);
  color: white;
  font-weight: 700;
}
.page-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  color: var(--text-light, #999);
  padding: 0 4px;
  font-size: 0.85rem;
  align-self: center;
}
@media (max-width: 600px) {
  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-size-selector { margin-right: 0; }
}
