/* ==========================================================================
   Auxilium Pulse — Enterprise Theme v2.6.0
   Design language: Light #f0f4ff bg · White sidebar · Blue #2563eb accent
   Matches portal__7_.html exactly
   Fonts: Sora (UI) · JetBrains Mono (numbers/code)
   ========================================================================== */

/* NOTE: Google Fonts (Sora + JetBrains Mono) are enqueued via wp_enqueue_style('ap-fonts-pre')
   in functions.php. Do NOT @import them here — that causes a double request and
   blocks CSS parsing on every page load. */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --ap-bg:      #f0f4ff;
  --ap-bg2:     #ffffff;
  --ap-bg3:     #f7f9ff;
  --ap-bg4:     #eef1f8;
  --ap-card:    #ffffff;

  /* Borders */
  --ap-border:  #e2e8f4;
  --ap-border2: #c8d4f0;

  /* Brand */
  --ap-accent:      #2563eb;
  --ap-accent-dark: #1d4ed8;
  --ap-accent-glow: rgba(37,99,235,0.10);
  --ap-accent2:     #0891b2;

  /* Color palette */
  --ap-blue:   #2563eb;
  --ap-cyan:   #0891b2;
  --ap-green:  #059669;
  --ap-yellow: #d97706;
  --ap-red:    #dc2626;
  --ap-purple: #7c3aed;
  --ap-orange: #ea580c;
  --ap-pink:   #db2777;

  /* Text */
  --ap-text:  #1e293b;
  --ap-text2: #475569;
  --ap-text3: #94a3b8;

  /* Typography */
  --ap-sans: 'Sora', system-ui, -apple-system, sans-serif;
  --ap-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Radii */
  --ap-radius:    14px;
  --ap-radius-sm:  8px;
  --ap-radius-lg: 18px;

  /* Shadows */
  --ap-shadow-sm: 0 1px 3px rgba(37,99,235,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --ap-shadow:    0 4px 16px rgba(37,99,235,0.10), 0 2px 6px rgba(0,0,0,0.05);
  --ap-shadow-lg: 0 12px 40px rgba(37,99,235,0.13), 0 4px 12px rgba(0,0,0,0.07);

  /* Layout */
  --ap-sidebar-w: 260px;
  --ap-topnav-h:  62px;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body.ap-dashboard-body,
body.ap-login-body {
  font-family: var(--ap-sans);
  background: var(--ap-bg);
  color: var(--ap-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--ap-bg3); }
::-webkit-scrollbar-thumb { background: var(--ap-border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8b8d8; }

/* ── Dashboard Shell ───────────────────────────────────────────── */
.ap-dashboard-wrap {
  display: flex;
  min-height: 100vh;
}

/* ════════════════════════════════════
   SIDEBAR — white, light border
   ════════════════════════════════════ */
.ap-sidebar {
  width: var(--ap-sidebar-w);
  flex-shrink: 0;
  background: var(--ap-bg2);
  border-right: 1px solid var(--ap-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 20px rgba(37,99,235,0.06);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Sidebar Logo */
.ap-sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ap-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  flex-shrink: 0;
}
.ap-sidebar-logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--ap-accent), var(--ap-accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff;
  font-family: var(--ap-mono); font-size: 15px;
  box-shadow: 0 3px 10px rgba(37,99,235,0.30);
}
.ap-sidebar-logo-text { display: flex; flex-direction: column; gap: 1px; }
.ap-sidebar-logo-name {
  font-size: 13px; font-weight: 700;
  color: var(--ap-text); line-height: 1.2;
  white-space: nowrap;
}
.ap-sidebar-logo-name strong {
  background: linear-gradient(105deg, var(--ap-accent), var(--ap-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}
.ap-sidebar-logo-sub {
  font-size: 9.5px; color: var(--ap-text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Sidebar User */
.ap-sidebar-user {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ap-border);
  display: flex; align-items: center; gap: 10px;
  background: var(--ap-bg3);
  flex-shrink: 0;
}
.ap-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
/* Role-based avatar colors */
.av-admin   { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.av-w2      { background: linear-gradient(135deg, #059669, #34d399); }
.av-1099    { background: linear-gradient(135deg, #d97706, #ea580c); }
.av-c2c     { background: linear-gradient(135deg, #7c3aed, #0891b2); }
.av-auditor { background: linear-gradient(135deg, #e11d48, #fb7185); }

.ap-user-info { flex: 1; min-width: 0; }
.ap-user-name {
  font-size: 13px; font-weight: 600; color: var(--ap-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-user-role { margin-top: 2px; }

.ap-sidebar-logout {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ap-text3); text-decoration: none; font-size: 14px;
  transition: all 0.2s; border: 1.5px solid var(--ap-border);
  background: transparent;
}
.ap-sidebar-logout:hover {
  color: var(--ap-red);
  border-color: #fecaca;
  background: #fff5f5;
}

/* Sidebar Nav */
.ap-sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
}
.ap-nav-section { margin-bottom: 4px; }
.ap-nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ap-text3);
  padding: 8px 12px 5px;
}
.ap-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--ap-radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--ap-text2); text-decoration: none;
  transition: all 0.15s; margin-bottom: 1px;
  user-select: none; position: relative;
}
.ap-nav-item:hover { background: #f0f4ff; color: var(--ap-text); }
.ap-nav-item.active {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--ap-accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--ap-accent);
}
.ap-nav-icon {
  font-size: 16px; width: 20px;
  text-align: center; flex-shrink: 0;
}
.ap-nav-badge {
  margin-left: auto; background: var(--ap-red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px;
  padding: 1px 6px; min-width: 18px; text-align: center;
}

/* Sidebar Bottom */
.ap-sidebar-bottom {
  padding: 10px 10px;
  border-top: 1px solid var(--ap-border);
  background: var(--ap-bg3);
  flex-shrink: 0;
}

/* ════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════ */
.ap-main {
  margin-left: var(--ap-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--ap-bg);
}

/* Top Nav Bar */
.ap-topnav {
  height: var(--ap-topnav-h);
  background: var(--ap-bg2);
  border-bottom: 1px solid var(--ap-border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(37,99,235,0.06);
  flex-shrink: 0;
}
.ap-topnav-title {
  font-size: 16px; font-weight: 700; flex: 1;
  color: var(--ap-text); letter-spacing: -0.02em;
}
.ap-topnav-actions { display: flex; align-items: center; gap: 10px; }

.ap-sidebar-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--ap-text2);
  padding: 4px 6px; border-radius: 6px;
  transition: all 0.15s; line-height: 1;
  display: none;
}
.ap-sidebar-toggle:hover { background: var(--ap-bg3); color: var(--ap-text); }

.ap-icon-btn {
  width: 36px; height: 36px; border-radius: var(--ap-radius-sm);
  background: var(--ap-bg3); border: 1.5px solid var(--ap-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: all 0.2s;
  position: relative; color: var(--ap-text2);
  text-decoration: none;
}
.ap-icon-btn:hover {
  border-color: var(--ap-accent);
  background: #eef2ff;
  color: var(--ap-accent);
}
.ap-badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ap-red); border: 2px solid #fff;
}

/* Page Content */
.ap-page-content { flex: 1; padding: 28px; }

/* Page Header (used in HR pages w/o topnav) */
.ap-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
  padding: 22px 28px 0;
}
.ap-page-header h2 {
  font-size: 20px; font-weight: 800; color: var(--ap-text);
  letter-spacing: -0.03em;
}
.ap-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════════════════
   WELCOME / GREETING
   ════════════════════════════════════ */
.ap-emp-welcome { margin-bottom: 24px; }
.ap-emp-welcome h2 {
  font-size: 22px; font-weight: 800; color: var(--ap-text);
  letter-spacing: -0.03em; margin-bottom: 4px; line-height: 1.2;
}
.ap-emp-welcome p { font-size: 14px; color: var(--ap-text2); }

/* ════════════════════════════════════
   STATS GRID — portal-exact design
   ════════════════════════════════════ */
.ap-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.ap-stat-card {
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 20px 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--ap-shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.ap-stat-card:hover {
  box-shadow: var(--ap-shadow);
  transform: translateY(-2px);
}
/* Top color stripe via ::after — matches portal exactly */
.ap-stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--ap-radius) var(--ap-radius) 0 0;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}
/* Named accent overrides */
.ap-stat-accent-blue::after   { background: linear-gradient(90deg, #2563eb, #06b6d4); }
.ap-stat-accent-green::after  { background: linear-gradient(90deg, #059669, #34d399); }
.ap-stat-accent-yellow::after { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ap-stat-accent-purple::after { background: linear-gradient(90deg, #7c3aed, #c026d3); }
.ap-stat-accent-cyan::after   { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.ap-stat-accent-red::after    { background: linear-gradient(90deg, #dc2626, #f97316); }
.ap-stat-accent-orange::after { background: linear-gradient(90deg, #ea580c, #f59e0b); }
.ap-stat-accent-pink::after   { background: linear-gradient(90deg, #db2777, #f43f5e); }

/* Auto-color 1st–4th cards when no explicit class */
.ap-stats-grid .ap-stat-card:not([class*="ap-stat-accent"]):nth-child(1)::after { background: linear-gradient(90deg, #2563eb, #06b6d4); }
.ap-stats-grid .ap-stat-card:not([class*="ap-stat-accent"]):nth-child(2)::after { background: linear-gradient(90deg, #059669, #34d399); }
.ap-stats-grid .ap-stat-card:not([class*="ap-stat-accent"]):nth-child(3)::after { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ap-stats-grid .ap-stat-card:not([class*="ap-stat-accent"]):nth-child(4)::after { background: linear-gradient(90deg, #7c3aed, #c026d3); }

.ap-stat-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ap-text3);
  margin-bottom: 10px;
}
.ap-stat-value {
  font-size: 32px; font-weight: 700; line-height: 1;
  font-family: var(--ap-mono); color: var(--ap-text);
  margin-bottom: 6px; letter-spacing: -0.02em;
}
.ap-stat-sub  { font-size: 12px; color: var(--ap-text2); }
.ap-stat-icon {
  position: absolute; top: 18px; right: 18px;
  font-size: 26px; opacity: 0.07; pointer-events: none;
}

/* ════════════════════════════════════
   SECTION CARD — portal pattern
   ════════════════════════════════════ */
.ap-section-card {
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  margin-bottom: 24px; overflow: hidden;
  box-shadow: var(--ap-shadow-sm);
}
.ap-section-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--ap-border);
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  background: var(--ap-bg3);
}
.ap-section-head h3 {
  font-size: 14px; font-weight: 700; color: var(--ap-text);
}
.ap-section-head .ap-head-actions,
.ap-section-head .head-actions {
  display: flex; gap: 8px; align-items: center;
}
.ap-section-body { padding: 22px; }

/* Legacy card — backward compat */
.ap-card {
  background: var(--ap-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-sm);
  padding: 22px;
  margin-bottom: 24px;
}
.ap-card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.ap-card-title {
  font-size: 14px; font-weight: 700;
  color: var(--ap-text); letter-spacing: -0.02em;
  margin-bottom: 0;
}
/* Only add bottom margin when card-title is NOT inside a card-header */
.ap-card > .ap-card-title,
.ap-card > .ap-section-body > .ap-card-title {
  margin-bottom: 16px;
}

/* ════════════════════════════════════
   TABLE — portal data-table style
   ════════════════════════════════════ */
.ap-table-wrap { overflow-x: auto; }

.ap-table {
  width: 100%; border-collapse: collapse;
}
.ap-table th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ap-text3);
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--ap-border);
  background: #f8faff; white-space: nowrap;
}
.ap-table td {
  padding: 13px 14px; font-size: 13px;
  border-bottom: 1px solid var(--ap-border);
  color: var(--ap-text); vertical-align: middle;
}
.ap-table tr:last-child td { border-bottom: none; }
.ap-table tr:hover td { background: #f5f8ff; }
.ap-table-actions {
  display: flex; gap: 6px; align-items: center;
  white-space: nowrap;
}

/* ════════════════════════════════════
   BUTTONS
   ════════════════════════════════════ */
.ap-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px;
  border-radius: var(--ap-radius-sm);
  font-family: var(--ap-sans); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  border: none; letter-spacing: 0.01em; line-height: 1;
  white-space: nowrap;
}
.ap-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.ap-btn-primary {
  background: linear-gradient(135deg, var(--ap-accent), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.30);
}
.ap-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.40);
}
.ap-btn-primary:active { transform: translateY(0); }

.ap-btn-secondary {
  background: #fff; color: var(--ap-text);
  border: 1.5px solid var(--ap-border2);
  box-shadow: var(--ap-shadow-sm);
}
.ap-btn-secondary:hover {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
  background: #f0f4ff;
}

.ap-btn-danger {
  background: #fff5f5; color: var(--ap-red);
  border: 1.5px solid #fecaca;
}
.ap-btn-danger:hover { background: #fee2e2; }

.ap-btn-success {
  background: #f0fdf4; color: var(--ap-green);
  border: 1.5px solid #bbf7d0;
}
.ap-btn-success:hover { background: #dcfce7; }

.ap-btn-warning {
  background: #fffbeb; color: var(--ap-yellow);
  border: 1.5px solid #fde68a;
}
.ap-btn-warning:hover { background: #fef9c3; }

.ap-btn-sm  { padding: 6px 13px; font-size: 12px; border-radius: 7px; }
.ap-btn-lg  { padding: 12px 28px; font-size: 15px; }
.ap-btn-xs  { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

/* ════════════════════════════════════
   STATUS TAGS — vibrant, portal-exact
   ════════════════════════════════════ */
.ap-status {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap;
  border: 1px solid transparent;
}
.ap-status-draft      { background: #f8fafc; color: #64748b;  border-color: #e2e8f0; }
.ap-status-pending    { background: #fffbeb; color: #d97706;  border-color: #fde68a; }
.ap-status-submitted  { background: #fffbeb; color: #d97706;  border-color: #fde68a; }
.ap-status-approved   { background: #f0fdf4; color: #059669;  border-color: #bbf7d0; }
.ap-status-paid       { background: #eef2ff; color: #2563eb;  border-color: #c7d2fe; }
.ap-status-rejected   { background: #fff5f5; color: #dc2626;  border-color: #fecaca; }
.ap-status-processing { background: #f5f3ff; color: #7c3aed;  border-color: #ddd6fe; }
.ap-status-active     { background: #f0fdf4; color: #059669;  border-color: #bbf7d0; }
.ap-status-inactive   { background: #f8fafc; color: #94a3b8;  border-color: #e2e8f0; }
.ap-status-invited    { background: #fffbeb; color: #d97706;  border-color: #fde68a; }
.ap-status-used       { background: #eff6ff; color: #2563eb;  border-color: #bfdbfe; }
.ap-status-expired    { background: #fff5f5; color: #dc2626;  border-color: #fecaca; }
.ap-status-cancelled  { background: #f8fafc; color: #94a3b8;  border-color: #e2e8f0; }

/* ════════════════════════════════════
   WORKER TYPE TAGS
   ════════════════════════════════════ */
.ap-tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap;
  border: 1px solid transparent;
}
.ap-tag-w2      { background: #f0fdf4; color: #059669; border-color: #bbf7d0; }
.ap-tag-1099    { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.ap-tag-c2c     { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }
.ap-tag-admin   { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.ap-tag-auditor { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }

/* ════════════════════════════════════
   ROLE BADGES (sidebar + tables)
   ════════════════════════════════════ */
.ap-role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; white-space: nowrap;
}
.ap-role-badge.ap-hr     { background: #eef2ff; color: var(--ap-blue); }
.ap-role-badge.ap-w2     { background: #f0fdf4; color: var(--ap-green); }
.ap-role-badge.ap-1099   { background: #fffbeb; color: var(--ap-yellow); }
.ap-role-badge.ap-c2c    { background: #ecfeff; color: var(--ap-cyan); }
.ap-role-badge.ap-audit  { background: #fff1f2; color: #e11d48; }
.ap-role-badge.ap-admin  { background: #eef2ff; color: var(--ap-blue); }

/* ════════════════════════════════════
   FORMS & INPUTS
   ════════════════════════════════════ */
.ap-form-group,
.ap-field-group { margin-bottom: 16px; }

.ap-form-group label,
.ap-field-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--ap-text2); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 6px;
}

.ap-input,
.ap-select,
.ap-textarea,
.ap-form-group input:not([type=checkbox]):not([type=radio]):not([type=color]),
.ap-form-group select,
.ap-form-group textarea,
.ap-field-group input:not([type=checkbox]):not([type=radio]):not([type=color]),
.ap-field-group select,
.ap-field-group textarea {
  width: 100%;
  background: #f8faff;
  border: 1.5px solid var(--ap-border2);
  border-radius: var(--ap-radius-sm);
  padding: 10px 14px;
  color: var(--ap-text);
  font-family: var(--ap-sans);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.ap-input:focus,
.ap-select:focus,
.ap-textarea:focus,
.ap-form-group input:focus,
.ap-form-group select:focus,
.ap-form-group textarea:focus,
.ap-field-group input:focus,
.ap-field-group select:focus,
.ap-field-group textarea:focus {
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 3px var(--ap-accent-glow);
  background: #fff;
}
.ap-input::placeholder,
.ap-form-group input::placeholder,
.ap-field-group input::placeholder { color: var(--ap-text3); }

.ap-textarea { min-height: 90px; resize: vertical; }

.ap-select-sm {
  font-size: 12px !important;
  padding: 7px 12px !important;
}

/* Filter bar */
.ap-filter-bar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; padding: 14px 22px;
  border-bottom: 1px solid var(--ap-border);
  background: #f8faff;
}
.ap-filter-bar input,
.ap-filter-bar select {
  background: #fff; border: 1.5px solid var(--ap-border2);
  border-radius: 7px; padding: 8px 13px;
  color: var(--ap-text); font-family: var(--ap-sans);
  font-size: 13px; outline: none;
  transition: border-color 0.2s;
}
.ap-filter-bar input:focus,
.ap-filter-bar select:focus { border-color: var(--ap-accent); }
.ap-filter-bar input[type=text] { min-width: 200px; }

/* Grid form helpers */
.ap-field-grid-2,
.ap-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-field-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* Form feedback messages */
.ap-form-error {
  background: #fff5f5; border: 1px solid #fecaca;
  border-radius: var(--ap-radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--ap-red); margin-bottom: 14px;
  font-weight: 600;
}
.ap-form-success {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: var(--ap-radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--ap-green); margin-bottom: 14px;
  font-weight: 600;
}

/* ════════════════════════════════════
   TABS
   ════════════════════════════════════ */
.ap-tabs {
  display: flex; gap: 2px;
  padding: 12px 22px 0;
  background: #f8faff;
  border-bottom: 1px solid var(--ap-border);
  flex-wrap: wrap;
}
.ap-tab {
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--ap-text2); transition: all 0.2s;
  margin-bottom: -1px; background: none;
  border-top: none; border-left: none; border-right: none;
}
.ap-tab:hover { color: var(--ap-text); }
.ap-tab.active { color: var(--ap-accent); border-bottom-color: var(--ap-accent); }

/* ════════════════════════════════════
   TIMESHEET WEEK GRID
   ════════════════════════════════════ */
.ap-ts-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.ap-ts-day-grid .ap-form-group { margin-bottom: 0; }
.ap-ts-day-grid .ap-form-group label {
  font-size: 10px; color: var(--ap-text3);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 5px;
  text-align: center; display: block;
}
.ap-ts-day-grid .ap-input {
  text-align: center;
  font-family: var(--ap-mono);
  font-size: 15px; font-weight: 600;
  padding: 7px 4px;
}

/* Timesheet summary bar */
.ap-ts-summary {
  background: linear-gradient(135deg, #eef2ff, #f0f9ff);
  border: 1px solid #c7d2fe; border-radius: 10px;
  padding: 14px 20px;
  display: flex; align-items: center;
  gap: 28px; flex-wrap: wrap;
  margin: 16px 0;
}
.ap-ts-metric { text-align: center; }
.ap-ts-val {
  font-size: 22px; font-weight: 700;
  font-family: var(--ap-mono); color: var(--ap-accent);
  line-height: 1;
}
.ap-ts-lbl { font-size: 11px; color: var(--ap-text3); margin-top: 3px; }

/* ════════════════════════════════════
   PAYMENT CARDS
   ════════════════════════════════════ */
.ap-payment-card {
  background: var(--ap-bg3);
  border: 1.5px solid var(--ap-border);
  border-radius: 10px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ap-payment-card:hover {
  border-color: var(--ap-accent);
  box-shadow: var(--ap-shadow-sm);
}
.ap-pay-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.ap-pay-info { flex: 1; }
.ap-pay-name { font-size: 14px; font-weight: 600; color: var(--ap-text); margin-bottom: 3px; }
.ap-pay-meta { font-size: 12px; color: var(--ap-text2); }
.ap-pay-amount {
  font-size: 20px; font-weight: 700;
  font-family: var(--ap-mono);
  color: var(--ap-green);
}

/* ════════════════════════════════════
   MODAL
   ════════════════════════════════════ */
.ap-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,41,59,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.ap-modal {
  background: #fff; border: 1px solid var(--ap-border2);
  border-radius: var(--ap-radius-lg);
  width: 520px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--ap-shadow-lg);
}
.ap-modal-head {
  padding: 18px 24px; border-bottom: 1px solid var(--ap-border);
  display: flex; align-items: center;
  justify-content: space-between;
  background: var(--ap-bg3);
}
.ap-modal-head h3 {
  font-size: 16px; font-weight: 700; color: var(--ap-text);
}
.ap-modal-close {
  cursor: pointer; font-size: 20px;
  color: var(--ap-text3); line-height: 1;
  background: none; border: none; padding: 2px;
}
.ap-modal-close:hover { color: var(--ap-text); }
.ap-modal-body { padding: 24px; }
.ap-modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--ap-border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--ap-bg3);
}

/* ════════════════════════════════════
   NOTIFICATIONS
   ════════════════════════════════════ */
.ap-notif-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--ap-border);
  align-items: flex-start;
}
.ap-notif-item:last-child { border-bottom: none; }
.ap-notif-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--ap-text); }
.ap-notif-sub   { font-size: 12px; color: var(--ap-text2); }
.ap-notif-time  { font-size: 11px; color: var(--ap-text3); margin-top: 3px; }

/* ════════════════════════════════════
   ALERTS
   ════════════════════════════════════ */
.ap-alert {
  padding: 12px 16px; border-radius: var(--ap-radius-sm);
  font-size: 13px; font-weight: 600;
  margin-bottom: 16px;
}
.ap-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #059669; }
.ap-alert-error   { background: #fff5f5; border: 1px solid #fecaca; color: #dc2626; }
.ap-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }
.ap-alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #d97706; }

/* ════════════════════════════════════
   READ-ONLY AUDITOR BANNER
   ════════════════════════════════════ */
.ap-readonly-banner {
  background: linear-gradient(135deg, #fff1f2, #fce7f3);
  border: 1px solid #fecdd3;
  border-radius: var(--ap-radius-sm);
  padding: 12px 18px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: #e11d48;
  box-shadow: 0 1px 6px rgba(225,29,72,0.08);
}

/* ════════════════════════════════════
   INFO / PROFILE ROWS
   ════════════════════════════════════ */
.ap-info-row {
  display: flex; padding: 10px 0;
  border-bottom: 1px solid var(--ap-border);
  align-items: flex-start; gap: 12px;
}
.ap-info-row:last-child { border-bottom: none; }
.ap-info-label {
  font-size: 12px; font-weight: 600; color: var(--ap-text3);
  text-transform: uppercase; letter-spacing: 0.05em;
  width: 140px; flex-shrink: 0; padding-top: 1px;
}
.ap-info-value { font-size: 13px; color: var(--ap-text); flex: 1; }

/* ════════════════════════════════════
   INVITE TOKEN
   ════════════════════════════════════ */
.ap-invite-token {
  font-family: var(--ap-mono); font-size: 12px;
  background: #eef2ff; padding: 3px 9px;
  border-radius: 5px; border: 1px solid #c7d2fe;
  color: var(--ap-accent); letter-spacing: 0.05em;
}

/* ════════════════════════════════════
   BAR CHART
   ════════════════════════════════════ */
.ap-bar-chart { display: flex; flex-direction: column; gap: 10px; }
.ap-bar-row { display: flex; align-items: center; gap: 12px; }
.ap-bar-label {
  font-size: 12px; color: var(--ap-text2);
  width: 100px; flex-shrink: 0; text-align: right;
}
.ap-bar-track {
  flex: 1; height: 8px; background: var(--ap-bg4);
  border-radius: 4px; overflow: hidden;
  border: 1px solid var(--ap-border);
}
.ap-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.ap-bar-val {
  font-size: 12px; font-family: var(--ap-mono);
  color: var(--ap-text); width: 60px;
}

/* ════════════════════════════════════
   GRID HELPERS
   ════════════════════════════════════ */
.ap-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ap-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ap-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ap-col { /* pass-through */ }

/* ════════════════════════════════════
   MISC UTILITY
   ════════════════════════════════════ */
.ap-empty-state { text-align: center; padding: 48px 24px; color: var(--ap-text3); }
.ap-empty-icon  { font-size: 48px; margin-bottom: 12px; }
.ap-empty-text  { font-size: 14px; }

.ap-loading {
  color: var(--ap-text3); font-size: 13px;
  padding: 28px; text-align: center;
  animation: ap-pulse 1.5s ease-in-out infinite;
}
.ap-error { color: var(--ap-red); font-size: 13px; padding: 24px; text-align: center; }

.ap-text-mono   { font-family: var(--ap-mono); }
.ap-text-accent { color: var(--ap-accent); }
.ap-text-success{ color: var(--ap-green); }
.ap-text-danger { color: var(--ap-red); }
.ap-text-muted  { color: var(--ap-text3); }
.ap-hidden      { display: none !important; }

/* Step indicator */
.ap-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.ap-step  { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ap-text3); }
.ap-step.active { color: var(--ap-accent); }
.ap-step.done   { color: var(--ap-green); }
.ap-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.ap-step.active .ap-step-num { background: var(--ap-accent); border-color: var(--ap-accent); color: #fff; }
.ap-step.done   .ap-step-num { background: var(--ap-green); border-color: var(--ap-green); color: #fff; }
.ap-step-divider { width: 32px; height: 1px; background: var(--ap-border); }

/* ════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════ */
@keyframes ap-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ap-fade-in { animation: ap-fade-in 0.3s ease both; }

@keyframes ap-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes ap-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

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

.ap-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: ap-spin 0.6s linear infinite;
  display: inline-block; vertical-align: middle;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 1200px) {
  .ap-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .ap-grid-2, .ap-grid-3, .ap-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .ap-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .ap-sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0,0,0,0.18);
  }
  .ap-main { margin-left: 0; }
  .ap-sidebar-toggle { display: flex; }
  .ap-page-content   { padding: 16px; }
  .ap-topnav         { padding: 0 16px; }
  .ap-page-header    { padding: 16px 16px 0; }
}
@media (max-width: 768px) {
  .ap-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ap-ts-day-grid { grid-template-columns: repeat(4, 1fr); }
  .ap-field-grid-2, .ap-form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ap-stats-grid { grid-template-columns: 1fr; }
  .ap-ts-day-grid { grid-template-columns: repeat(2, 1fr); }
  .ap-modal { width: 100%; border-radius: var(--ap-radius) var(--ap-radius) 0 0; }
}

/* ── Additional utility classes (v3.1) ─────────────────────────── */

/* Avatar helpers (used by AP_Utils::avatar_html) */
.ap-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ap-avatar-initials { font-size: 13px; font-weight: 700; }

/* Sidebar overlay (mobile) */
.ap-sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; display: none; }
.ap-sidebar.open ~ .ap-sidebar-overlay { display: block; }

/* HR Dashboard widget card (used in class-ap-hr-dashboard.php) */
.ap-widget-card    { background: var(--ap-card); border: 1px solid var(--ap-border); border-radius: var(--ap-radius); box-shadow: var(--ap-shadow-sm); margin-bottom: 24px; overflow: hidden; }
.ap-widget-header  { padding: 14px 20px; border-bottom: 1px solid var(--ap-border); display: flex; align-items: center; justify-content: space-between; background: var(--ap-bg3); }
.ap-widget-header h3 { font-size: 14px; font-weight: 700; color: var(--ap-text); }
.ap-widget-link    { font-size: 12px; color: var(--ap-accent); font-weight: 600; text-decoration: none; }
.ap-widget-link:hover { text-decoration: underline; }
.ap-widget         { padding: 18px 20px; }

/* HR stat icon color helpers */
.ap-si-blue   { color: var(--ap-blue);   }
.ap-si-green  { color: var(--ap-green);  }
.ap-si-yellow { color: var(--ap-yellow); }
.ap-si-purple { color: var(--ap-purple); }

/* Stat body */
.ap-stat-body { padding-top: 4px; }

/* Mini table (compact, no padding) */
.ap-mini-table { width: 100%; border-collapse: collapse; }
.ap-mini-table th { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ap-text3); padding: 8px 14px; border-bottom: 1px solid var(--ap-border); background: #f8faff; }
.ap-mini-table td { padding: 10px 14px; font-size: 12px; border-bottom: 1px solid var(--ap-border); color: var(--ap-text); vertical-align: middle; }
.ap-mini-table tr:last-child td { border-bottom: none; }
.ap-mini-table tr:hover td { background: #f5f8ff; }

/* Empty message (inline) */
.ap-empty-msg { font-size: 13px; color: var(--ap-text3); padding: 20px; text-align: center; }

/* JS-targeted button helpers (no extra style, just presence) */
.ap-btn-approve { }
.ap-btn-reject  { }
.ap-mark-read   { }

/* Login form view container */
.ap-form-view { }

/* Register step panel */
.ap-reg-step-panel { }

/* ── Enterprise polish: xs button variants ─────────────────── */
.ap-btn-xs.ap-btn-ghost   { border-color: var(--ap-border2); color: var(--ap-text2); background: transparent; }
.ap-btn-xs.ap-btn-ghost:hover { border-color: var(--ap-accent); color: var(--ap-accent); background: #f0f4ff; }
.ap-btn-xs.ap-btn-success { background: #f0fdf4; color: var(--ap-green); border-color: #bbf7d0; }
.ap-btn-xs.ap-btn-danger  { background: #fff5f5; color: var(--ap-red);   border-color: #fecaca; }
.ap-btn-xs.ap-btn-warning { background: #fffbeb; color: var(--ap-yellow);border-color: #fde68a; }

/* Theme blog helpers (index.php) */
.ap-main-content { padding: 40px 20px; max-width: 800px; margin: 0 auto; }
.ap-post-title   { font-size: 22px; font-weight: 700; color: var(--ap-text); margin-bottom: 8px; }
.ap-post-content { font-size: 15px; color: var(--ap-text2); line-height: 1.7; }

/* Timesheet day class helper */
.ap-ts-day { text-align: center; font-family: var(--ap-mono); font-size: 15px; font-weight: 600; }

/* ════════════════════════════════════
   CARD TOOLBAR (filter bar inside cards)
   ════════════════════════════════════ */
.ap-card-toolbar {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
  padding: 12px 22px;
  border-bottom: 1px solid var(--ap-border);
  background: #f8faff;
}
.ap-form-label-inline {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ap-text2); white-space: nowrap;
}
.ap-form-input {
  background: #fff; border: 1.5px solid var(--ap-border2);
  border-radius: 7px; padding: 8px 13px;
  color: var(--ap-text); font-family: var(--ap-sans);
  font-size: 13px; outline: none;
  transition: border-color 0.2s;
}
.ap-form-input:focus { border-color: var(--ap-accent); }
.ap-form-input-sm { font-size: 12px !important; padding: 6px 10px !important; }
.ap-form-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--ap-text2); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 6px;
}

/* Ghost button — secondary/outline style */
.ap-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; padding: 7px 14px;
  border-radius: var(--ap-radius-sm);
  font-family: var(--ap-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  background: transparent; border: 1.5px solid var(--ap-border2);
  color: var(--ap-text2); white-space: nowrap;
}
.ap-btn-ghost:hover { border-color: var(--ap-accent); color: var(--ap-accent); background: #f0f4ff; }
.ap-btn-ghost.ap-btn-sm { padding: 5px 11px; }

/* Muted text color */
.ap-muted { color: var(--ap-text3) !important; font-size: 12px; }

/* Tab panel (shown/hidden via JS) */
.ap-tab-panel { }

/* Doc name cell — truncate long filenames */
td.ap-doc-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* WordPress widget title */
.ap-widget-title { font-size: 14px; font-weight: 700; color: var(--ap-text); margin-bottom: 12px; }

/* ════════════════════════════════════
   CARD HELPERS (v2.3)
   ════════════════════════════════════ */
/* Card description paragraph — replaces inline style="font-size:13px;color:#64748b;margin-bottom:…" */
.ap-card-desc {
  font-size: 13px; color: var(--ap-text2); margin-bottom: 18px; line-height: 1.6;
}
/* Card meta line (subdued secondary text) */
.ap-card-meta {
  font-size: 12px; color: var(--ap-text3); margin-top: 4px;
}
/* Card actions row (filter/action buttons inside card-header) */
.ap-card-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* ════════════════════════════════════
   FORM HELPERS (v2.3)
   ════════════════════════════════════ */
/* .ap-form-grid — 2-col responsive grid for form fields */
.ap-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 680px) {
  .ap-form-grid { grid-template-columns: 1fr; }
}
/* Span full width inside a form-grid */
.ap-form-group-full,
.ap-field-group-full { grid-column: 1 / -1; }

/* Form hint — small helper text below inputs */
.ap-form-hint {
  display: block; font-size: 11px; color: var(--ap-text3);
  margin-top: 5px; line-height: 1.5;
}
/* Required field asterisk */
.ap-req {
  color: var(--ap-red); font-weight: 700;
  margin-left: 2px; font-size: 11px; vertical-align: super;
}
/* Button-row at the bottom of a form */
.ap-form-actions {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-top: 16px;
}
/* Inline link-style button (no border/bg, looks like an <a>) */
.ap-btn-link {
  background: none; border: none; padding: 0;
  font-family: var(--ap-sans); font-size: inherit;
  color: var(--ap-accent); font-weight: 600;
  cursor: pointer; text-decoration: underline;
  transition: color 0.15s;
}
.ap-btn-link:hover { color: var(--ap-accent-dark); }

/* ════════════════════════════════════
   TIMESHEET HELPERS (v2.3)
   ════════════════════════════════════ */
/* Totals bar under the day-grid inputs */
.ap-ts-total-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ap-text2);
  margin-top: 12px;
}
.ap-ts-total-bar strong { color: var(--ap-text); }
/* Rejection note row inside history table */
.ap-ts-rejection-note {
  font-size: 11px; color: var(--ap-red);
  margin-top: 4px; line-height: 1.4;
}

/* ════════════════════════════════════
   NOTIFICATION TABLE ROWS (v2.3)
   ════════════════════════════════════ */
tr.ap-notif-unread td { font-weight: 600; }
tr.ap-notif-read   td { opacity: 0.72; }

/* ════════════════════════════════════
   FILE UPLOAD COMPONENT (v2.3) — used by C2C timesheets
   ════════════════════════════════════ */
.ap-file-drop-zone {
  border: 2px dashed var(--ap-border2);
  border-radius: var(--ap-radius);
  padding: 28px 24px;
  text-align: center;
  background: var(--ap-bg3);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.ap-file-drop-zone:hover,
.ap-file-drop-zone.ap-drag-over {
  border-color: var(--ap-accent);
  background: #eef2ff;
}
.ap-file-drop-icon {
  font-size: 36px; margin-bottom: 8px; display: block;
}
.ap-file-drop-text {
  font-size: 14px; color: var(--ap-text2);
  font-weight: 500; margin-bottom: 4px;
}
.ap-file-drop-hint {
  font-size: 11px; color: var(--ap-text3);
}
/* Selected file info strip */
.ap-file-selected {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; background: #eef2ff;
  border: 1px solid #c7d2fe; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--ap-text);
  flex-wrap: wrap;
}
.ap-file-icon { font-size: 18px; flex-shrink: 0; }
.ap-file-size {
  font-size: 11px; color: var(--ap-text3);
  font-family: var(--ap-mono);
}
/* Upload progress bar */
.ap-upload-progress {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
.ap-progress-bar {
  flex: 1; height: 6px;
  background: var(--ap-bg4); border-radius: 3px; overflow: hidden;
  border: 1px solid var(--ap-border);
}
.ap-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ap-accent), var(--ap-accent2));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ════════════════════════════════════
   AUDIT TABLE HELPERS (v2.3) — replaces inline styles in auditor templates
   ════════════════════════════════════ */
.ap-audit-time {
  font-family: var(--ap-mono); font-size: 11px;
  white-space: nowrap; color: var(--ap-text2);
}
.ap-audit-details {
  max-width: 220px; font-size: 11px; color: var(--ap-text3);
}
/* .ap-audit-action and .ap-audit-ip are in auditor.css — keep there */

/* ════════════════════════════════════
   ADDITIONAL UTILITIES (v2.3 — second pass)
   ════════════════════════════════════ */
/* Notification dot — color set via JS/PHP inline background, only structural styles here */
.ap-notif-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; vertical-align: middle;
}
/* Wide card-header with tighter vertical padding (notifications page) */
.ap-card-header-padded {
  padding: 16px 22px;
}
/* Constrained message cell in notification table */
td.ap-notif-message { max-width: 320px; }
/* Small dot-column th in notification table */
th.ap-notif-dot-col { width: 8px; }
/* Disabled input */
.ap-input-disabled { opacity: 0.6; }
/* Rejection note text in alert */
.ap-rejection-note-text { font-size: 13px; display: block; }
.ap-rejection-note-hint { font-size: 12px; display: block; }
/* Read-only label on audit headings */
small.ap-readonly-label {
  font-weight: 400; color: var(--ap-text3); font-size: 0.85em;
}
/* Warning card meta (pending review note) */
.ap-card-meta-warn {
  font-size: 12px; color: var(--ap-yellow); margin-top: 4px;
}

/* ── Spacing helpers (avoid inline margin overrides) ─────────── */
.ap-mt-0  { margin-top: 0    !important; }
.ap-mt-8  { margin-top: 8px  !important; }
.ap-mt-16 { margin-top: 16px !important; }
.ap-mt-24 { margin-top: 24px !important; }
.ap-mb-0  { margin-bottom: 0    !important; }
.ap-mb-8  { margin-bottom: 8px  !important; }
.ap-mb-16 { margin-bottom: 16px !important; }
.ap-mb-24 { margin-bottom: 24px !important; }
.ap-ml-8  { margin-left: 8px  !important; }
.ap-ml-16 { margin-left: 16px !important; }
/* Warning form hint */
.ap-form-hint-warn { font-size: 11px; color: var(--ap-yellow); margin-top: 5px; line-height: 1.5; }
/* Auto-width override for topnav filter selects */
.ap-form-input-auto { width: auto !important; }
/* Modal subdued info paragraph */
.ap-modal-doc-info { font-size: 13px; color: var(--ap-text2); margin-bottom: 16px; }

/* ════════════════════════════════════
   CARD WIDTH VARIANTS (v2.4)
   ════════════════════════════════════ */
/* Constrained-width card (e.g. report filter panel) */
.ap-card-narrow { max-width: 480px; }
/* Medium constrained card (e.g. profile pages) */
.ap-card-medium { max-width: 580px; }
/* Edge-to-edge card — removes padding, clips overflow (e.g. JS-rendered list cards) */
.ap-card-flush  { padding: 0 !important; overflow: hidden; }

/* ── Modal size variants (v2.4) ──────────────────────────────── */
/* Wider modal for complex forms (e.g. worker edit) */
.ap-modal-lg { width: 580px; }

/* ════════════════════════════════════
   ACCESS DENIED / FALLBACK SCREEN (v2.4)
   Shown when a logged-in user has no portal role configured.
   ════════════════════════════════════ */
.ap-access-denied-wrap {
  font-family: var(--ap-sans);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--ap-bg);
}
.ap-access-denied-card {
  background: var(--ap-bg2);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  padding: 40px 48px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: var(--ap-shadow);
}
.ap-access-denied-icon {
  font-size: 48px; margin-bottom: 16px; display: block;
}
.ap-access-denied-title {
  font-size: 20px; font-weight: 800; color: var(--ap-text);
  margin: 0 0 10px; letter-spacing: -0.03em;
}
.ap-access-denied-msg {
  font-size: 14px; color: var(--ap-text2);
  line-height: 1.6; margin: 0 0 24px;
}
.ap-access-denied-logout {
  font-size: 12px; color: var(--ap-text3);
  text-decoration: none;
  transition: color 0.15s;
}
.ap-access-denied-logout:hover { color: var(--ap-text2); }

/* ── JS-rendered DOM helpers (v2.4) ──────────────────────────── */
/* Rejection note tooltip hint in tables (JS-rendered) */
.ap-ts-review-note {
  font-size: 11px; color: var(--ap-text3);
  cursor: help; margin-left: 4px;
}
/* Small danger-colored text (e.g. deductions) */
.ap-text-danger-sm {
  color: var(--ap-red); font-size: inherit;
  font-family: var(--ap-mono);
}
/* Small subdued note inside action cells */
.ap-table-note {
  font-size: 0.8em; color: var(--ap-text3);
  cursor: help;
}

/* ── Toast notification (v2.7 — replaces native alert() in HR JS) ── */
.ap-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 99999;
  max-width: 360px; padding: 13px 18px;
  background: #1e293b; color: #f1f5f9;
  border-radius: 10px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.ap-toast.ap-toast-show { opacity: 1; transform: translateY(0); }
.ap-toast.ap-toast-error   { border-left: 4px solid var(--ap-red); }
.ap-toast.ap-toast-success { border-left: 4px solid var(--ap-green); background: #052e16; color: #d1fae5; }
