@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

:root {
  --pfm-primary:       #2C629E;
  --pfm-primary-light: #3a78be;
  --pfm-accent:        #5b9bd5;
  --pfm-danger:        #e63946;
  --pfm-warning:       #f4a261;
  --pfm-info:          #4895ef;
  --pfm-success:       #52b788;
  --pfm-bg:            #f2f5f8;
  --pfm-surface:       #ffffff;
  --pfm-surface-2:     #edf2f8;
  --pfm-border:        #dce6f0;
  --pfm-text:          #1c2533;
  --pfm-text-muted:    #6b7a8d;
  --pfm-text-light:    #9aa8bb;
  --pfm-sidebar-w:     256px;
  --pfm-topbar-h:      60px;
  --pfm-radius:        12px;
  --pfm-radius-sm:     8px;
  --pfm-shadow:        0 2px 8px rgba(0,0,0,.08);
  --pfm-shadow-md:     0 4px 20px rgba(0,0,0,.10);
  --pfm-transition:    .15s ease;
  --pfm-font:          'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; }

/* ======================== LOGIN ======================== */
.pfm-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; font-family: var(--pfm-font);
  background: linear-gradient(135deg, #e8eef8 0%, #f2f5f8 60%, #dce6f0 100%);
}
.pfm-login-card {
  background: var(--pfm-surface); border-radius: 16px;
  padding: 40px 44px; width: 100%; max-width: 420px;
  box-shadow: var(--pfm-shadow-md);
}
.pfm-login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.pfm-login-logo span { font-size: 16px; font-weight: 700; color: var(--pfm-primary); }
.pfm-login-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.pfm-login-sub { color: var(--pfm-text-muted); margin-bottom: 28px; font-size: 15px; }
.pfm-login-note { text-align: center; color: var(--pfm-text-light); font-size: 12px; margin-top: 16px; }

/* ======================== FORMS ======================== */
.pfm-form-group { margin-bottom: 16px; }
.pfm-form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--pfm-text); margin-bottom: 6px; font-family: var(--pfm-font);
}
.pfm-input, .pfm-select, .pfm-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--pfm-border); border-radius: var(--pfm-radius-sm);
  font-family: var(--pfm-font); font-size: 14px; color: var(--pfm-text);
  background: var(--pfm-surface); outline: none;
  transition: border-color var(--pfm-transition);
}
.pfm-input:focus, .pfm-select:focus, .pfm-textarea:focus { border-color: var(--pfm-accent); }
.pfm-textarea { min-height: 80px; resize: vertical; }
.pfm-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pfm-input-row--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Budget deductions block (inside project modal) ── */
.pfm-ded-section {
  background: var(--pfm-surface-2);
  border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius-sm);
  padding: 14px 16px 10px;
  margin-bottom: 16px;
}
.pfm-ded-heading {
  font-size: 13px; font-weight: 600; color: var(--pfm-text);
  margin-bottom: 12px;
}
.pfm-ded-amt {
  font-size: 11px; font-weight: 500; color: var(--pfm-danger);
  margin-top: 4px; padding-left: 2px;
}
.pfm-usable-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--pfm-primary); color: #fff;
  border-radius: var(--pfm-radius-sm); padding: 10px 14px;
  margin-top: 10px;
}
.pfm-usable-label { font-size: 13px; font-weight: 600; }
.pfm-usable-value { font-size: 16px; font-weight: 700; font-family: 'Poppins', sans-serif; }

/* ── Budget breakdown card (project details page) ── */
.pfm-budget-breakdown {}
.pfm-breakdown-table { display: flex; flex-direction: column; gap: 0; }
.pfm-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--pfm-border);
}
.pfm-breakdown-row:last-child { border-bottom: none; }
.pfm-breakdown-row--ded { padding-left: 8px; }
.pfm-breakdown-label { font-size: 14px; color: var(--pfm-text); display: flex; align-items: center; gap: 6px; }
.pfm-breakdown-minus { font-size: 16px; color: var(--pfm-danger); font-weight: 700; line-height: 1; }
.pfm-breakdown-pct {
  font-size: 11px; font-weight: 600; color: var(--pfm-danger);
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 20px; padding: 1px 7px;
}
.pfm-breakdown-value { font-size: 14px; font-weight: 600; font-family: 'Poppins', sans-serif; color: var(--pfm-text); }
.pfm-breakdown-value--ded { color: var(--pfm-danger); }
.pfm-breakdown-row--total {
  background: var(--pfm-surface-2);
  border-radius: var(--pfm-radius-sm);
  padding: 11px 14px; margin-top: 6px; border: none;
}
.pfm-breakdown-row--total .pfm-breakdown-label { font-weight: 700; font-size: 15px; color: var(--pfm-primary); }
.pfm-breakdown-value--total { font-size: 17px; font-weight: 700; color: var(--pfm-primary); }

@media (max-width: 480px) {
  .pfm-breakdown-label{
    font-size: 12px;
  }
  .pfm-breakdown-value{
    font-size: 13px;
  }
  .pfm-breakdown-row--total .pfm-breakdown-label { font-size: 12px; }
  .pfm-breakdown-value--total { font-size: 13px; }

}

/* ======================== ALERTS ======================== */
.pfm-alert { padding: 10px 14px; border-radius: var(--pfm-radius-sm); font-size: 13px; margin-bottom: 14px; }
.pfm-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ======================== BUTTONS ======================== */
.pfm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--pfm-radius-sm); font-family: var(--pfm-font);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: background var(--pfm-transition), opacity var(--pfm-transition);
  text-decoration: none; white-space: nowrap;
}
.pfm-btn-primary { background: var(--pfm-primary); color: #fff; }
.pfm-btn-primary:hover { background: var(--pfm-primary-light); color: #fff; }
.pfm-btn-ghost { background: transparent; color: var(--pfm-text); border: 1.5px solid var(--pfm-border); }
.pfm-btn-ghost:hover { background: var(--pfm-surface-2); }
.pfm-btn-danger { background: var(--pfm-danger); color: #fff; }
.pfm-btn-danger:hover { opacity: .88; }
.pfm-btn-sm { padding: 6px 14px; font-size: 13px; }
.pfm-btn-full { width: 100%; }

/* ======================== APP LAYOUT ======================== */
.pfm-app {
  display: flex; min-height: 100vh; background: var(--pfm-bg);
  font-family: var(--pfm-font); color: var(--pfm-text);
}

/* Sidebar */
.pfm-sidebar {
  width: var(--pfm-sidebar-w); background: var(--pfm-primary);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: transform var(--pfm-transition);
}
.pfm-sidebar-header {
  padding: 18px 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.pfm-sidebar-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 14px; font-weight: 700; }
.pfm-sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; font-size: 18px; padding: 4px 8px; }

.pfm-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.pfm-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 500;
  text-decoration: none; border-left: 3px solid transparent;
  transition: background var(--pfm-transition), color var(--pfm-transition);
}
.pfm-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.pfm-nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--pfm-accent); }
.pfm-nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.pfm-sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.pfm-user-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pfm-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.pfm-user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfm-user-role { color: rgba(255,255,255,.5); font-size: 11px; }
.pfm-logout-btn { background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; padding: 6px; flex-shrink: 0; }
.pfm-logout-btn:hover { color: #fff; }
.pfm-logout-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Main */
.pfm-main { flex: 1; margin-left: var(--pfm-sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.pfm-topbar {
  height: var(--pfm-topbar-h); background: var(--pfm-surface);
  border-bottom: 1px solid var(--pfm-border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.pfm-menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--pfm-text); padding: 4px; }
.pfm-menu-toggle svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.pfm-topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.pfm-content { padding: 24px; flex: 1; }

/* ======================== CARDS ======================== */
.pfm-card {
  background: var(--pfm-surface); border-radius: var(--pfm-radius);
  border: 1px solid var(--pfm-border); box-shadow: var(--pfm-shadow);
}
.pfm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.pfm-data-card {
  background: var(--pfm-surface); border-radius: var(--pfm-radius);
  border: 1px solid var(--pfm-border); box-shadow: var(--pfm-shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.pfm-data-card-header {
  padding: 14px 16px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px;
  border-bottom: 1px solid var(--pfm-border);
}
.pfm-data-card-title { font-size: 16px; font-weight: 700; }
.pfm-data-card-sub { font-size: 12px; color: var(--pfm-text-muted); margin-top: 2px; }
.pfm-data-card-body { padding: 12px 16px; flex: 1; }
.pfm-data-card-footer { padding: 10px 16px; border-top: 1px solid var(--pfm-border); display: flex; gap: 8px; }
.pfm-data-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--pfm-surface-2); }
.pfm-data-row:last-child { border-bottom: none; }
.pfm-data-label { color: var(--pfm-text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pfm-card-actions-row { display: flex; gap: 8px; }

/* ======================== STATS ======================== */
.pfm-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pfm-stat-card {
  padding: 16px 18px; border-radius: var(--pfm-radius); border: 1px solid var(--pfm-border);
  background: var(--pfm-surface); box-shadow: var(--pfm-shadow);
}
.pfm-stat-card.span2 { grid-column: span 2; }
.pfm-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pfm-text-muted); margin-bottom: 6px; }
.pfm-stat-value { font-size: 28px; font-weight: 800; }
.pfm-stat-value--money { font-size: 18px; }
.pfm-stat-card.green { border-left: 4px solid var(--pfm-accent); }
.pfm-stat-card.green .pfm-stat-value { color: var(--pfm-primary); }
.pfm-stat-card.orange { border-left: 4px solid var(--pfm-warning); }
.pfm-stat-card.orange .pfm-stat-value { color: #c2530f; }
.pfm-stat-card.blue { border-left: 4px solid var(--pfm-info); }
.pfm-stat-card.blue .pfm-stat-value { color: #1d4ed8; }
.pfm-stat-card.teal { border-left: 4px solid #0d9488; }
.pfm-stat-card.teal .pfm-stat-value { color: #0d9488; }
.pfm-stat-card.red { border-left: 4px solid var(--pfm-danger); }
.pfm-stat-card.red .pfm-stat-value { color: var(--pfm-danger); }
.pfm-stat-card.purple { border-left: 4px solid #7c3aed; }
.pfm-stat-card.purple .pfm-stat-value { color: #7c3aed; }

/* ======================== PROGRESS ======================== */
.pfm-progress {
  height: 10px; background: var(--pfm-surface-2); border-radius: 5px; overflow: hidden;
}
.pfm-progress--sm { height: 6px; }
.pfm-progress-bar { height: 100%; border-radius: 5px; background: var(--pfm-accent); transition: width .4s ease; }
.pfm-progress-bar--default { background: var(--pfm-accent); }
.pfm-progress-bar--success { background: var(--pfm-accent); }
.pfm-progress-bar--warning { background: var(--pfm-warning); }
.pfm-progress-bar--danger  { background: var(--pfm-danger); }

/* ======================== STATUS BADGES ======================== */
.pfm-status-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.pfm-status-planning   { background: #eff6ff; color: #1d4ed8; }
.pfm-status-active     { background: #ecfdf5; color: #065f46; }
.pfm-status-on_hold    { background: #fff7ed; color: #c2410c; }
.pfm-status-completed  { background: #f0fdf4; color: #14532d; }
.pfm-status-cancelled  { background: #fef2f2; color: #991b1b; }

/* ======================== SECTION HEADERS ======================== */
.pfm-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.pfm-section-title { font-size: 20px; font-weight: 700; }
.pfm-count { color: var(--pfm-text-muted); font-weight: 500; font-size: .9em; }
.pfm-breadcrumb {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--pfm-text-muted); margin-bottom: 16px; flex-wrap: wrap;
}
.pfm-breadcrumb a { color: var(--pfm-primary); font-weight: 600; }
.pfm-breadcrumb span { color: var(--pfm-text-light); }

/* ======================== PROJECT HEADER ======================== */
.pfm-project-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.pfm-project-title { font-size: 24px; font-weight: 800; }
.pfm-project-client { color: var(--pfm-text-muted); font-size: 14px; margin-top: 4px; }

/* ======================== INFO GRID ======================== */
.pfm-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0; }
.pfm-info-item {
  padding: 10px 14px; border-right: 1px solid var(--pfm-border);
  border-bottom: 1px solid var(--pfm-border);
}
.pfm-info-item:nth-child(4n) { border-right: none; }
.pfm-info-item--full { grid-column: 1 / -1; border-right: none; }
.pfm-info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pfm-text-muted); margin-bottom: 4px; }
.pfm-info-val { font-size: 14px; font-weight: 500; }

/* ======================== BUDGET TABLE ======================== */
.pfm-budget-table-wrap { padding: 0; }
.pfm-budget-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pfm-budget-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pfm-text-muted); border-bottom: 1px solid var(--pfm-border); background: var(--pfm-surface-2); }
.pfm-budget-table td { padding: 12px 16px; border-bottom: 1px solid var(--pfm-border); vertical-align: middle; }
.pfm-budget-table tr:last-child td { border-bottom: none; }
.pfm-budget-table tr:hover td { background: var(--pfm-surface-2); }

/* Category dot */
.pfm-cat-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}
.pfm-cat-materials    { background: #3b82f6; }
.pfm-cat-labor        { background: #f59e0b; }
.pfm-cat-equipment    { background: #8b5cf6; }
.pfm-cat-government   { background: #ef4444; }
.pfm-cat-professional { background: #06b6d4; }
.pfm-cat-transport    { background: #10b981; }
.pfm-cat-utilities    { background: #f97316; }
.pfm-cat-other        { background: #6b7280; }

/* Category progress bar colors */
.pfm-cat-bar-materials    { background: #3b82f6; height: 100%; border-radius: 3px; }
.pfm-cat-bar-labor        { background: #f59e0b; height: 100%; border-radius: 3px; }
.pfm-cat-bar-equipment    { background: #8b5cf6; height: 100%; border-radius: 3px; }
.pfm-cat-bar-government   { background: #ef4444; height: 100%; border-radius: 3px; }
.pfm-cat-bar-professional { background: #06b6d4; height: 100%; border-radius: 3px; }
.pfm-cat-bar-transport    { background: #10b981; height: 100%; border-radius: 3px; }
.pfm-cat-bar-utilities    { background: #f97316; height: 100%; border-radius: 3px; }
.pfm-cat-bar-other        { background: #6b7280; height: 100%; border-radius: 3px; }

/* ======================== TIMELINE ======================== */
.pfm-timeline { position: relative; padding-left: 24px; }
.pfm-timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--pfm-border); }
.pfm-timeline-item { position: relative; margin-bottom: 20px; }
.pfm-timeline-item:last-child { margin-bottom: 0; }
.pfm-timeline-dot {
  position: absolute; left: -24px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pfm-accent); border: 3px solid var(--pfm-surface);
  box-shadow: 0 0 0 2px var(--pfm-accent);
}
.pfm-timeline-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pfm-timeline-date { font-size: 12px; color: var(--pfm-text-muted); font-weight: 600; }
.pfm-timeline-pct {
  display: inline-flex; align-items: center; padding: 2px 8px;
  background: var(--pfm-surface-2); border-radius: 12px;
  font-size: 12px; font-weight: 700; color: var(--pfm-primary);
}
.pfm-timeline-milestone { font-weight: 700; font-size: 14px; }
.pfm-timeline-notes { font-size: 13px; color: var(--pfm-text-muted); margin-top: 2px; }
.pfm-timeline-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ======================== CATEGORY BADGE ======================== */
.pfm-cat-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  background: var(--pfm-surface-2); color: var(--pfm-text);
}

/* ======================== MODAL ======================== */
.pfm-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
}
.pfm-modal {
  background: var(--pfm-surface); border-radius: var(--pfm-radius);
  width: 100%; max-width: 560px; margin: 16px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.pfm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--pfm-border);
}
.pfm-modal-title { font-size: 17px; font-weight: 700; }
.pfm-modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--pfm-text-muted); padding: 4px 8px; }
.pfm-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.pfm-modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--pfm-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ======================== TOAST ======================== */
.pfm-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.pfm-toast {
  padding: 12px 18px; border-radius: var(--pfm-radius-sm); font-size: 14px; font-weight: 500;
  color: #fff; box-shadow: var(--pfm-shadow-md); min-width: 220px; max-width: 340px;
  animation: pfm-toast-in .2s ease;
}
.pfm-toast-success { background: #16a34a; }
.pfm-toast-error   { background: var(--pfm-danger); }
.pfm-toast-info    { background: var(--pfm-info); }
@keyframes pfm-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ======================== AJAX OVERLAY ======================== */
.pfm-ajax-overlay {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.35); align-items: center; justify-content: center;
}
.pfm-ajax-overlay.active { display: flex; }
.pfm-ajax-spinner svg { width: 48px; height: 48px; animation: pfm-spin 1s linear infinite; }
@keyframes pfm-spin { to { transform: rotate(360deg); } }

/* ======================== EMPTY STATE ======================== */
.pfm-empty-state { text-align: center; padding: 48px 20px; color: var(--pfm-text-muted); }
.pfm-empty-icon { font-size: 40px; margin-bottom: 12px; }
.pfm-empty-title { font-size: 18px; font-weight: 700; color: var(--pfm-text); margin-bottom: 6px; }

/* ======================== FILTER ROW ======================== */
.pfm-filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ======================== PAGINATION ======================== */
.pfm-pagination { margin-top: 20px; padding-bottom: 8px; }
.pfm-pagination-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pfm-page-btn {
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--pfm-border); border-radius: var(--pfm-radius-sm);
  background: var(--pfm-surface); color: var(--pfm-text);
  font-family: var(--pfm-font); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--pfm-transition);
}
.pfm-page-btn:hover { background: var(--pfm-surface-2); }
.pfm-page-btn.active { background: var(--pfm-primary); color: #fff; border-color: var(--pfm-primary); }
.pfm-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ======================== PROOF THUMBS ======================== */
.pfm-proof-thumb {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: var(--pfm-radius-sm); border: 1px solid var(--pfm-border);
  cursor: zoom-in; display: block;
}
.pfm-photo-wrap { position: relative; display: inline-block; }
.pfm-photo-del {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--pfm-danger); color: #fff;
  border: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
#pfm-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
#pfm-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6); cursor: default; }
#pfm-lightbox-close { position: fixed; top: 18px; right: 22px; color: #fff; font-size: 28px; cursor: pointer; opacity: .8; user-select: none; }
#pfm-lightbox-close:hover { opacity: 1; }

/* ======================== MOBILE BOTTOM NAV ======================== */
.pfm-bottom-nav { display: none; }
.pfm-sidebar-overlay { display: none; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 900px) {
  .pfm-card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .pfm-info-grid { grid-template-columns: 1fr 1fr; }
  .pfm-info-item:nth-child(4n) { border-right: 1px solid var(--pfm-border); }
  .pfm-info-item:nth-child(2n) { border-right: none; }
}

/* ======================== PROJECT PHASES ======================== */

/* Progress summary bar above the phase list */
.pfm-phase-summary {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: var(--pfm-surface-2); border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius-sm); padding: 12px 16px; margin-bottom: 12px;
}
.pfm-phase-summary-left { display: flex; align-items: center; gap: 10px; }
.pfm-phase-summary-pct  { font-size: 22px; font-weight: 700; color: var(--pfm-primary); font-family: 'Poppins', sans-serif; }
.pfm-phase-summary-text { font-size: 13px; color: var(--pfm-text-muted); }
.pfm-phase-summary-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.pfm-phase-complete-badge {
  font-size: 12px; font-weight: 700; color: #059669;
  background: #d1fae5; border: 1px solid #6ee7b7;
  border-radius: 20px; padding: 3px 12px; white-space: nowrap;
}

/* Empty state for phases */
.pfm-phase-empty {
  padding: 18px; color: var(--pfm-text-muted); font-size: 14px;
  border: 1.5px dashed var(--pfm-border); border-radius: var(--pfm-radius-sm);
  text-align: center;
}

/* Phase list */
.pfm-phase-list { display: flex; flex-direction: column; gap: 8px; }

/* Phase item row */
.pfm-phase-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--pfm-surface); border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius-sm); padding: 14px 16px;
  transition: border-color .15s, background .15s;
}
.pfm-phase-item--done {
  background: #f0fdf4; border-color: #86efac;
}

/* Circular checkbox toggle */
.pfm-phase-check {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--pfm-border); background: var(--pfm-surface);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; margin-top: 1px;
  transition: background .15s, border-color .15s, transform .1s;
}
.pfm-phase-check:hover:not(:disabled) { border-color: var(--pfm-accent); transform: scale(1.08); }
.pfm-phase-check:disabled { opacity: .6; cursor: default; }
.pfm-phase-check--done { background: #059669; border-color: #059669; }
.pfm-phase-check--done:hover:not(:disabled) { background: #047857; border-color: #047857; }

/* Phase text body */
.pfm-phase-body { flex: 1; min-width: 0; padding-top: 2px; }
.pfm-phase-name { font-size: 15px; font-weight: 600; color: var(--pfm-text); line-height: 1.3; }
.pfm-phase-name--done { text-decoration: line-through; color: var(--pfm-text-muted); }
.pfm-phase-desc { font-size: 13px; color: var(--pfm-text-muted); margin-top: 4px; line-height: 1.4; }
.pfm-phase-done-date {
  display: inline-block; font-size: 11px; font-weight: 600; color: #059669;
  margin-top: 6px;
}

/* Phase action buttons */
.pfm-phase-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

/* ======================== END PROJECT PHASES ======================== */

/* ======================== CLIENT BILLING ======================== */
.pfm-billing-tax-note {
  font-size: 12px; color: var(--pfm-text-muted); font-weight: 400;
  background: var(--pfm-surface-2); border-radius: 20px; padding: 3px 10px;
  border: 1px solid var(--pfm-border);
}

/* Billing card container */
.pfm-billing-card { padding: 0; overflow: hidden; }

/* Billing base summary bar */
.pfm-billing-base-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--pfm-primary); color: #fff;
  padding: 12px 20px;
}
.pfm-billing-base-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.pfm-billing-base-meta  { font-size: 12px; opacity: .8; flex: 1; }
.pfm-billing-base-meta strong { color: #fff; }
.pfm-billing-base-value { font-size: 18px; font-weight: 700; font-family: 'Poppins', sans-serif; white-space: nowrap; }

/* Billing table wrapper */
.pfm-billing-table-wrap { overflow-x: auto; }
.pfm-billing-tbl { margin: 0; border-radius: 0; }
.pfm-billing-tbl th, .pfm-billing-tbl td { padding: 12px 16px; }

/* Paid row tint */
.pfm-bill-row--paid { background: #f0fdf4; }

/* Billing item name */
.pfm-bill-name { font-weight: 600; font-size: 14px; }

/* Status cell */
.pfm-bill-status {
  display: inline-flex; flex-direction: column; gap: 2px;
  font-size: 13px; font-weight: 600;
}
.pfm-bill-status--paid    { color: #059669; }
.pfm-bill-status--pending { color: var(--pfm-text-muted); }

/* Status dot/icon */
.pfm-bill-dot {
  display: inline-flex; width: 20px; height: 20px; border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; margin-right: 6px;
  vertical-align: middle;
}
.pfm-bill-dot--paid    { background: #d1fae5; color: #059669; }
.pfm-bill-dot--pending { background: #f3f4f6; color: #9ca3af; border: 1.5px solid #d1d5db; }

/* Paid date under status */
.pfm-bill-date {
  display: block; font-size: 11px; font-weight: 400;
  color: var(--pfm-text-muted); padding-left: 26px; margin-top: 2px;
}

/* Summary bar at bottom */
.pfm-billing-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-top: 1px solid var(--pfm-border);
  background: var(--pfm-surface-2);
}
.pfm-billing-summary-label { font-size: 13px; color: var(--pfm-text-muted); }
.pfm-billing-complete-badge {
  font-size: 12px; font-weight: 700; color: #059669;
  background: #d1fae5; border: 1px solid #6ee7b7;
  border-radius: 20px; padding: 3px 12px;
}

/* Billing modal — radio group */
.pfm-billing-radio-group {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.pfm-billing-radio {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--pfm-radius-sm);
  border: 2px solid var(--pfm-border); cursor: pointer;
  font-size: 14px; font-weight: 500; flex: 1; min-width: 120px;
  transition: border-color .15s, background .15s;
}
.pfm-billing-radio input[type="radio"] { display: none; }
.pfm-billing-radio.active { border-color: var(--pfm-accent); background: #eff6ff; }
.pfm-billing-radio-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.pfm-billing-radio-dot--paid    { background: #d1fae5; color: #059669; }
.pfm-billing-radio-dot--pending { background: #f3f4f6; color: #9ca3af; border: 1.5px solid #d1d5db; }

@media (max-width: 768px) {
  .pfm-billing-base-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pfm-billing-base-value { font-size: 16px; }
}

/* ======================== END CLIENT BILLING ======================== */

/* ======================== CLIENT BILLING v2 ======================== */

.pfm-billing-v2 { overflow: hidden; }

/* ── Header bar ── */
.pfm-bv2-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
  background: #3b82f6; color: #fff;
}
.pfm-bv2-header-left { min-width: 0; }
.pfm-bv2-header-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; opacity: .7; margin-bottom: 3px;
}
.pfm-bv2-header-sub { font-size: 12px; opacity: .6; }
.pfm-bv2-header-amt {
  font-size: 24px; font-weight: 700;
  font-family: 'Poppins', sans-serif; white-space: nowrap; flex-shrink: 0;
}

/* ── Pipeline stepper ── */
.pfm-bv2-pipeline {
  position: relative;
  display: flex; justify-content: space-around; align-items: flex-start;
  padding: 20px 32px 16px;
  background: var(--pfm-surface-2); border-bottom: 1px solid var(--pfm-border);
}
/* Connecting line running between all nodes */
.pfm-bv2-pipeline::before {
  content: '';
  position: absolute;
  top: calc(20px + 18px);    /* padding-top + half of 36px node */
  left:  calc(32px + 36px);  /* pipeline padding + ~one full node width to start after first node center */
  right: calc(32px + 36px);
  height: 2px;
  background: var(--pfm-border);
  z-index: 0;
}
.pfm-bv2-pipe-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 7px; flex: 1; position: relative; z-index: 1;
}
.pfm-bv2-pipe-node {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid var(--pfm-border);
  background: var(--pfm-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  transition: background .2s, border-color .2s, color .2s;
  box-shadow: 0 0 0 4px var(--pfm-surface-2);
}
.pfm-bv2-pipe-num { font-size: 13px; font-weight: 700; }
.pfm-bv2-pipe-label {
  font-size: 11px; font-weight: 600; color: var(--pfm-text);
  text-align: center; line-height: 1.3; max-width: 80px;
}
.pfm-bv2-pipe-pct { font-size: 11px; font-weight: 800; color: #3b82f6; }

/* ── Cards grid ── */
.pfm-bv2-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; padding: 20px;
}
.pfm-bv2-item {
  border-radius: var(--pfm-radius-sm);
  border: 1.5px solid var(--pfm-border);
  background: var(--pfm-surface);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
}
.pfm-bv2-item:hover { box-shadow: var(--pfm-shadow-md); }
.pfm-bv2-item--paid { border-color: #93c5fd; background: #eff6ff; }
.pfm-bv2-item-stripe { height: 5px; width: 100%; flex-shrink: 0; background: #3b82f6; }
.pfm-bv2-item-content {
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 10px; flex: 1;
}
.pfm-bv2-item-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 6px;
}
.pfm-bv2-item-name {
  font-size: 13px; font-weight: 700; color: var(--pfm-text); line-height: 1.35;
}
.pfm-bv2-item-pct-badge {
  font-size: 11px; font-weight: 800; padding: 2px 9px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  background: #eff6ff; color: #3b82f6;
}
.pfm-bv2-item-amount {
  font-size: 18px; font-weight: 700; color: #3b82f6;
  font-family: 'Poppins', sans-serif; line-height: 1.2;
}
.pfm-bv2-item-status { display: flex; align-items: center; gap: 8px; }
.pfm-bv2-status-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  border: 1.5px solid transparent;
}
.pfm-bv2-status-icon--pending {
  background: var(--pfm-surface-2); color: var(--pfm-text-muted);
  border-color: var(--pfm-border);
}
.pfm-bv2-status-label {
  font-size: 13px; font-weight: 600; color: var(--pfm-text-muted);
  display: flex; flex-direction: column; gap: 1px;
}
.pfm-bv2-status-label--paid { color: #059669; }
.pfm-bv2-status-date { font-size: 11px; font-weight: 400; color: var(--pfm-text-muted); }
.pfm-bv2-item-foot { margin-top: auto; padding-top: 2px; }
.pfm-bv2-item-btn { width: 100%; }

/* ── Footer summary ── */
.pfm-bv2-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--pfm-border);
  background: var(--pfm-surface-2);
}
.pfm-bv2-footer-left { display: flex; align-items: center; gap: 10px; }
.pfm-bv2-footer-dots { display: flex; gap: 5px; align-items: center; }
.pfm-bv2-footer-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pfm-border);
  transition: background .2s;
}
.pfm-bv2-footer-text { font-size: 13px; color: var(--pfm-text-muted); font-weight: 500; }
.pfm-bv2-complete-badge {
  font-size: 12px; font-weight: 700; color: #059669;
  background: #d1fae5; border: 1px solid #6ee7b7;
  border-radius: 20px; padding: 4px 14px;
}
.pfm-bv2-footer-right { display: flex; align-items: center; }
.pfm-bv2-footer-collected { font-size: 13px; color: var(--pfm-text-muted); }
.pfm-bv2-footer-collected strong {
  color: #3b82f6; font-family: 'Poppins', sans-serif;
}

/* ── Responsive ── */
@media (max-width: 1060px) {
  .pfm-bv2-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pfm-bv2-grid { grid-template-columns: 1fr; padding: 14px; gap: 10px; }
  .pfm-bv2-pipeline { display: none; }
  .pfm-bv2-header { gap: 8px; }
  .pfm-bv2-header-amt { font-size: 18px; }
  .pfm-bv2-footer { flex-wrap: wrap; gap: 8px; }

  
}
@media (max-width: 480px) {
  .pfm-bv2-header-amt{
    font-weight: 600;
  }
  .pfm-bv2-item-amount{
    font-weight: 600;
  }
  .pfm-bv2-header-sub{
    font-size: 6px;
  }
}

/* ======================== END CLIENT BILLING v2 ======================== */

/* ======================== SECTION CARDS (project details) ======================== */

.pfm-section-card {
  background: var(--pfm-surface);
  border: 1px solid var(--pfm-border);
  border-radius: var(--pfm-radius);
  box-shadow: var(--pfm-shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

/* Card header row */
.pfm-sc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 12px;
  border-bottom: 1px solid var(--pfm-border);
}

/* Card title with left accent bar */
.pfm-sc-title {
  font-size: 16px; font-weight: 700; color: var(--pfm-text);
  display: flex; align-items: center; gap: 10px;
}
.pfm-sc-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 18px;
  background: var(--pfm-accent); border-radius: 2px; flex-shrink: 0;
}

/* Right-side actions inside header */
.pfm-sc-header-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Card body */
.pfm-sc-body {
  padding: 20px;
}

/* Two-column financial body (no padding — handled by children) */
.pfm-sc-body--fin {
  display: flex; gap: 0; padding: 0;
}

/* Loading skeleton text */
.pfm-sc-loading {
  padding: 32px; text-align: center;
  color: var(--pfm-text-muted); font-size: 14px;
}

/* ======================== HERO CARD ======================== */

.pfm-hero-card {
  background: linear-gradient(160deg, #ffffff 0%, #f8fbf8 100%);
  border-top: 3px solid var(--pfm-accent);
}

/* Title row */
.pfm-hero-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 20px 0; flex-wrap: wrap;
}
.pfm-hero-info { flex: 1; min-width: 0; }
.pfm-hero-title {
  font-size: 22px; font-weight: 800; color: var(--pfm-primary);
  line-height: 1.25; margin-bottom: 4px;
}
.pfm-hero-client {
  font-size: 14px; color: var(--pfm-text-muted); font-weight: 500;
}
.pfm-hero-meta {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding-top: 4px;
}

/* 5-stat bar */
.pfm-hero-stats {
  display: flex; align-items: stretch; gap: 0;
  margin: 20px 20px 0;
  background: var(--pfm-surface-2); border-radius: var(--pfm-radius-sm);
  border: 1px solid var(--pfm-border); overflow: hidden;
}
.pfm-hero-stat {
  flex: 1; padding: 14px 16px;
  border-right: 1px solid var(--pfm-border);
  display: flex; flex-direction: column; gap: 4px;
}
.pfm-hero-stat:last-child { border-right: none; }

.pfm-hs-val {
  font-size: 15px; font-weight: 700; color: var(--pfm-text);
  font-family: 'Poppins', sans-serif; line-height: 1.2; white-space: nowrap;
}
.pfm-hs-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--pfm-text-muted);
}

/* Stat value color variants */
.pfm-hs--teal   { color: #0d9488; }
.pfm-hs--orange { color: #c2530f; }
.pfm-hs--blue   { color: #1d4ed8; }
.pfm-hs--red    { color: var(--pfm-danger); }
.pfm-hs--purple { color: #7c3aed; }

/* Progress bar rows */
.pfm-hero-bars {
  padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.pfm-hero-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 46px 1fr;
  align-items: center; gap: 10px;
}
.pfm-hero-bar-lbl {
  font-size: 12px; font-weight: 600; color: var(--pfm-text-muted);
  white-space: nowrap;
}
.pfm-hero-bar-pct {
  font-size: 12px; font-weight: 700; color: var(--pfm-text);
  text-align: right; font-family: 'Poppins', sans-serif;
}
.pfm-hero-bar-note {
  font-size: 11px; color: var(--pfm-text-muted); padding-left: 4px;
}

/* ======================== FINANCIAL SUMMARY ======================== */

/* Left panel — budget breakdown */
.pfm-fin-left {
  flex: 1; padding: 20px; min-width: 0;
  border-right: 1px solid var(--pfm-border);
}
/* Right panel — donut chart */
.pfm-fin-right {
  flex: 1; padding: 20px; min-width: 0;
}

/* Sub-heading inside fin panels */
.pfm-fin-sub {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pfm-text-muted);
  margin-bottom: 14px;
}

/* ======================== DONUT CHART + LEGEND ======================== */

.pfm-donut-wrap {
  display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
}
.pfm-donut-area { flex-shrink: 0; }

/* Legend list */
.pfm-donut-legend {
  flex: 1; min-width: 160px;
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center;
}
.pfm-dl-item {
  display: grid;
  grid-template-columns: 10px 1fr 80px 32px 1fr;
  align-items: center; gap: 8px;
  font-size: 13px;
}
.pfm-dl-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.pfm-dl-name { font-weight: 500; color: var(--pfm-text); white-space: nowrap; }
.pfm-dl-bar-wrap {
  height: 6px; background: var(--pfm-surface-2);
  border-radius: 3px; overflow: hidden; width: 80px;
}
.pfm-dl-bar { height: 100%; border-radius: 3px; }
.pfm-dl-pct {
  font-size: 12px; font-weight: 700; color: var(--pfm-text-muted);
  text-align: right; font-family: 'Poppins', sans-serif;
}
.pfm-dl-amt {
  font-size: 12px; font-weight: 600; color: var(--pfm-text);
  font-family: 'Poppins', sans-serif; white-space: nowrap;
}

/* Donut empty state */
.pfm-donut-empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 10px 0;
}
.pfm-donut-empty-text {
  font-size: 13px; color: var(--pfm-text-muted); text-align: center;
}

/* ======================== SMALL SELECT ======================== */
.pfm-select--sm {
  padding: 6px 10px; font-size: 13px;
  height: 32px; width: auto;
}

/* ======================== SECTION CARD RESPONSIVE ======================== */
@media (max-width: 900px) {
  .pfm-sc-body--fin { flex-direction: column; }
  .pfm-fin-left { border-right: none; border-bottom: 1px solid var(--pfm-border); }
  .pfm-hero-stats {
    flex-wrap: wrap; background: none; border: none; margin: 12px 16px 0;
    gap: 10px;
  }
  .pfm-hero-stat {
    flex: 1 1 140px; background: var(--pfm-surface-2);
    border: 1px solid var(--pfm-border); border-radius: var(--pfm-radius-sm);
    border-right: 1px solid var(--pfm-border);
  }
  .pfm-hero-bar-row {
    grid-template-columns: 90px 1fr 46px;
  }
  .pfm-hero-bar-note { display: none; }
}

@media (max-width: 640px) {
  .pfm-hero-top { flex-direction: column; }
  .pfm-hero-meta { flex-wrap: wrap; }
  .pfm-hero-stat { flex: 1 1 120px; }
  .pfm-hs-val { font-size: 13px; }
  .pfm-donut-wrap { flex-direction: column; align-items: center; }
  .pfm-donut-legend { min-width: unset; width: 100%; }
  .pfm-dl-item { grid-template-columns: 10px 1fr 50px 28px auto; }
  .pfm-dl-bar-wrap { width: 50px; }
  .pfm-sc-header { flex-wrap: wrap; }
  .pfm-sc-header-actions { width: 100%; justify-content: flex-end; }
  .pfm-hero-bars { padding: 14px 16px 16px; }
  .pfm-hero-top { padding: 16px 16px 0; }
}

/* ======================== END SECTION CARDS ======================== */

/* ======================== PROJECT DOCUMENTS ======================== */

/* Empty state */
.pfm-doc-empty {
  padding: 32px 20px; text-align: center;
  border: 1.5px dashed var(--pfm-border); border-radius: var(--pfm-radius-sm);
  color: var(--pfm-text-muted); font-size: 14px;
}
.pfm-doc-empty-icon { font-size: 36px; margin-bottom: 10px; }

/* Document list */
.pfm-doc-list { display: flex; flex-direction: column; gap: 10px; }

/* Single document row */
.pfm-doc-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--pfm-surface); border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius-sm); padding: 12px 14px;
  transition: box-shadow .15s, border-color .15s;
}
.pfm-doc-item:hover { box-shadow: var(--pfm-shadow); border-color: var(--pfm-accent); }

/* File type badge */
.pfm-doc-icon {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .04em;
}
.pfm-doc-icon--pdf   { background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; }
.pfm-doc-icon--img   { background: #ecfdf5; color: #059669; border: 1.5px solid #6ee7b7; }
.pfm-doc-icon--doc   { background: #eff6ff; color: #2563eb; border: 1.5px solid #bfdbfe; }
.pfm-doc-icon--xls   { background: #f0fdf4; color: #16a34a; border: 1.5px solid #86efac; }
.pfm-doc-icon--other   { background: var(--pfm-surface-2); color: var(--pfm-text-muted); border: 1.5px solid var(--pfm-border); }
.pfm-doc-icon--pending { background: #fffbeb; color: #b45309; border: 1.5px dashed #fcd34d; font-size: 18px; letter-spacing: 2px; }

/* Document info block */
.pfm-doc-info { flex: 1; min-width: 0; }
.pfm-doc-title {
  font-size: 14px; font-weight: 600; color: var(--pfm-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.pfm-doc-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfm-doc-notes { font-size: 12px; color: var(--pfm-text-muted); margin-top: 5px; }
.pfm-doc-filename { font-size: 12px; color: var(--pfm-text-muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfm-doc-size { font-size: 11px; color: var(--pfm-text-light); white-space: nowrap; }

/* Pending (no file) row — subtle left border accent */
.pfm-doc-item--pending { border-left: 3px solid #fcd34d; }

/* Status badge */
.pfm-doc-status {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pfm-doc-status--processed { background: #d1fae5; color: #059669; }
.pfm-doc-status--pending   { background: #fff7ed; color: #c2410c; }
.pfm-doc-date { font-size: 11px; color: var(--pfm-text-muted); white-space: nowrap; }

/* Action buttons */
.pfm-doc-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.pfm-doc-btn-icon { display: inline; }
.pfm-doc-download-btn { text-decoration: none; }

/* Modal hint text (info / success) */
.pfm-doc-modal-hint {
  font-size: 12px; color: var(--pfm-text-muted);
  background: var(--pfm-surface-2); border-radius: var(--pfm-radius-sm);
  padding: 8px 12px; margin: 4px 0 0; line-height: 1.5;
}
.pfm-doc-modal-hint--success { background: #f0fdf4; color: #166534; }

/* ── Document viewer overlay ── */
.pfm-dv-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(10, 15, 10, .92);
}
/* jQuery fadeIn sets display:block; override to flex so children stack */
#pfm-doc-viewer {
  display: none; /* JS controls this */
  flex-direction: column;
}
#pfm-doc-viewer.pfm-dv-open {
  display: flex;
}

/* Top bar */
.pfm-dv-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; gap: 14px;
  background: rgba(0,0,0,.55); border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.pfm-dv-title {
  flex: 1; font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pfm-dv-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pfm-dv-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  cursor: pointer; padding: 5px 13px; border-radius: 6px;
  font-size: 13px; font-weight: 600; font-family: var(--pfm-font);
  text-decoration: none; transition: background .15s; white-space: nowrap;
}
.pfm-dv-btn:hover { background: rgba(255,255,255,.26); color: #fff; }
.pfm-dv-zoom-in,
.pfm-dv-zoom-out { padding: 5px 11px; font-size: 16px; font-weight: 700; }
.pfm-dv-close {
  background: none; border: none; color: rgba(255,255,255,.6);
  cursor: pointer; font-size: 20px; padding: 4px 8px; line-height: 1;
  transition: color .15s;
}
.pfm-dv-close:hover { color: #fff; }

/* Viewer body */
.pfm-dv-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 20px; min-height: 0;
}

/* PDF iframe */
.pfm-dv-iframe {
  width: 100%; height: 100%; border: none;
  border-radius: 6px; background: #fff;
}

/* Image wrapper — scrollable so zoomed image can be panned */
.pfm-dv-img-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; cursor: default;
}
.pfm-dv-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.5);
  transform-origin: center center;
  transition: transform .18s ease;
  user-select: none; cursor: zoom-in; display: block;
}

/* Zoom hint */
.pfm-dv-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.48); color: rgba(255,255,255,.75);
  font-size: 12px; padding: 5px 14px; border-radius: 20px;
  pointer-events: none; white-space: nowrap;
}

/* Body scroll-lock */
.pfm-no-scroll { overflow: hidden; }

@media (max-width: 768px) {
  .pfm-doc-item { flex-wrap: wrap; gap: 10px; }
  .pfm-doc-icon { width: 40px; height: 40px; }
  .pfm-doc-actions { width: 100%; justify-content: flex-end; }
  .pfm-dv-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .pfm-dv-body { padding: 10px; }
  .pfm-dv-hint { display: none; }
}

@media (max-width: 480px) {
  .pfm-doc-item { align-items: flex-start; }
  .pfm-doc-filename { max-width: 140px; }
  .pfm-dv-zoom-in, .pfm-dv-zoom-out { display: none; }
}

/* ======================== END PROJECT DOCUMENTS ======================== */

/* ======================== EXPENSE TABLE ======================== */

/* Section card body variant — flush sides for the table */
.pfm-sc-body--flush { padding: 0; }

/* Scrollable table wrapper */
.pfm-exp-tbl-wrap { overflow-x: auto; }

/* The table itself */
.pfm-exp-tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px; font-family: var(--pfm-font);
}

/* Header */
.pfm-exp-tbl thead tr {
  background: var(--pfm-surface-2);
  border-bottom: 2px solid var(--pfm-border);
}
.pfm-exp-tbl th {
  padding: 11px 12px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--pfm-text-muted);
  white-space: nowrap;
}

/* Column widths */
.pfm-exp-col-num     { width: 44px; text-align: center; }
.pfm-exp-col-center  { text-align: center; width: 60px; }
.pfm-exp-col-money   { text-align: right; width: 110px; }
.pfm-exp-col-actions { width: 140px; }
.pfm-exp-col-date    { width: 100px; white-space: nowrap; }
.pfm-exp-col-vendor  { width: 130px; }
.pfm-exp-col-cat     { width: 140px; }
.pfm-exp-col-desc    { min-width: 180px; }

/* Rows */
.pfm-exp-row { border-bottom: 1px solid var(--pfm-border); transition: background .1s; }
.pfm-exp-row:last-child { border-bottom: none; }
.pfm-exp-row:hover { background: #f7faf7; }

.pfm-exp-tbl td { padding: 10px 12px; vertical-align: middle; color: var(--pfm-text); }

.pfm-exp-num { color: var(--pfm-text-muted); font-size: 12px; text-align: center; }

/* Description cell — clamp to 2 lines */
.pfm-exp-desc-text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; max-width: 260px;
}

/* Category cell */
.pfm-exp-col-cat { white-space: nowrap; }
.pfm-exp-cat-label { font-size: 12px; color: var(--pfm-text-muted); vertical-align: middle; }

/* Amount cell */
.pfm-exp-amount-cell strong { font-family: 'Poppins', sans-serif; font-size: 13px; color: var(--pfm-primary); }

/* Row action buttons */
.pfm-exp-row-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.pfm-exp-row-actions .pfm-btn { padding: 4px 9px; font-size: 12px; }

/* Empty state inside tbody */
.pfm-exp-empty-row { text-align: center; padding: 0 !important; }

/* Footer (pagination bar below table) */
.pfm-exp-tbl-footer {
  padding: 12px 16px; border-top: 1px solid var(--pfm-border);
  background: var(--pfm-surface-2); border-radius: 0 0 var(--pfm-radius) var(--pfm-radius);
}
.pfm-exp-tbl-footer .pfm-pagination { margin: 0; padding: 0; }

/* ── Expense detail popup ── */
.pfm-expd { display: flex; flex-direction: column; gap: 14px; }

.pfm-expd-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.pfm-expd-date { font-size: 13px; color: var(--pfm-text-muted); font-weight: 600; }

.pfm-expd-section { display: flex; flex-direction: column; gap: 5px; }
.pfm-expd-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--pfm-text-muted);
}
.pfm-expd-val { font-size: 14px; color: var(--pfm-text); line-height: 1.5; }
.pfm-expd-desc { font-weight: 500; }
.pfm-expd-notes { color: var(--pfm-text-muted); }

.pfm-expd-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px; background: var(--pfm-surface-2);
  border-radius: var(--pfm-radius-sm); padding: 12px;
}
.pfm-expd-cell { display: flex; flex-direction: column; gap: 3px; }
.pfm-expd-cell--amount { grid-column: 1 / -1; }
.pfm-expd-amount {
  font-size: 20px; font-weight: 800; color: var(--pfm-primary);
  font-family: 'Poppins', sans-serif;
}

/* Attachment thumbnails in detail popup */
.pfm-expd-media { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pfm-expd-thumb {
  width: 80px; height: 80px; border-radius: var(--pfm-radius-sm);
  border: 2px solid var(--pfm-border); overflow: hidden; cursor: pointer;
  background: var(--pfm-surface-2); display: flex; align-items: center;
  justify-content: center; padding: 0; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.pfm-expd-thumb:hover { border-color: var(--pfm-accent); box-shadow: var(--pfm-shadow); }
.pfm-expd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfm-expd-thumb--pdf { background: #fef2f2; border-color: #fecaca; }
.pfm-expd-thumb-pdf-label {
  font-size: 13px; font-weight: 800; color: #dc2626; text-transform: uppercase;
}
.pfm-expd-thumb-pdf-name { font-size: 9px; color: var(--pfm-text-muted); text-align: center; padding: 0 4px; word-break: break-all; }
.pfm-expd-media-count { font-weight: 400; opacity: .7; }

/* ── Gallery nav controls in viewer ── */
.pfm-dv-nav {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pfm-dv-nav-btn {
  padding: 5px 10px; font-size: 20px; font-weight: 700; line-height: 1;
}
.pfm-dv-counter {
  font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap;
  min-width: 48px; text-align: center;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .pfm-exp-tbl th, .pfm-exp-tbl td { padding: 8px 10px; }
  .pfm-exp-col-vendor { display: none; }
}
@media (max-width: 640px) {
  .pfm-exp-col-cat, .pfm-exp-col-date { display: none; }
  .pfm-exp-row-actions .pfm-btn { padding: 4px 7px; }
  .pfm-expd-grid { grid-template-columns: 1fr 1fr; }
}

/* ======================== END EXPENSE TABLE ======================== */

@media (max-width: 768px) {
  .pfm-sidebar { transform: translateX(-100%); }
  .pfm-sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.2); }
  .pfm-sidebar-close { display: block; }
  .pfm-menu-toggle { display: block; }
  .pfm-main { margin-left: 0; }
  .pfm-content { padding: 14px; padding-bottom: 72px; }
  .pfm-card-grid { grid-template-columns: 1fr; }
  .pfm-input-row { grid-template-columns: 1fr; }
  .pfm-input-row--3 { grid-template-columns: 1fr; }
  .pfm-info-grid { grid-template-columns: 1fr 1fr; }
  .pfm-stats-grid { grid-template-columns: 1fr 1fr; }
  .pfm-modal { margin: 0 8px; }

  .pfm-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 190;
    height: 58px; background: var(--pfm-surface);
    border-top: 1.5px solid var(--pfm-border); box-shadow: 0 -2px 14px rgba(0,0,0,.08);
  }
  .pfm-bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 6px 2px; color: var(--pfm-text-muted); font-size: 10px; font-weight: 600;
    font-family: var(--pfm-font); text-decoration: none; background: none; border: none;
    cursor: pointer; transition: color var(--pfm-transition); position: relative; line-height: 1;
  }
  .pfm-bottom-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .pfm-bottom-nav-item.active { color: var(--pfm-primary); }
  .pfm-bottom-nav-item.active svg { stroke: var(--pfm-primary); }
  .pfm-sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,.4); }
  .pfm-sidebar-overlay.open { display: block; }
}

@media (max-width: 480px) {
  .pfm-login-card { padding: 28px 20px; }
  .pfm-content { padding: 12px; padding-bottom: 72px; }
  .pfm-stat-card.span2 { grid-column: span 2; }
  .pfm-project-header { flex-direction: column; }
  .pfm-budget-table { font-size: 12px; }
  .pfm-budget-table th, .pfm-budget-table td { padding: 8px 10px; }
  .pfm-info-grid { grid-template-columns: 1fr; }
  .pfm-info-item { border-right: none !important; }
  .pfm-card-actions-row { flex-wrap: wrap; }
  .pfm-card-actions-row .pfm-btn { flex: 1; }
}

/* ======================== ACTIVITIES PAGE ======================== */

/* ── Toolbar ── */
.pfm-act-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 18px;
}
.pfm-act-date-nav {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pfm-act-date-display {
  font-size: 15px; font-weight: 700; color: var(--pfm-text);
  min-width: 210px; text-align: center;
}
.pfm-act-date-picker {
  width: auto; padding: 7px 10px; font-size: 13px; cursor: pointer;
}
.pfm-act-actions { display: flex; align-items: center; gap: 8px; }

/* ── Stats bar ── */
.pfm-act-stats {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 10px 14px;
  background: var(--pfm-surface); border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius-sm);
}
.pfm-act-stat-pill {
  font-size: 12px; font-weight: 600; color: var(--pfm-text-muted);
  background: var(--pfm-surface-2); border-radius: 20px;
  padding: 3px 10px;
}
.pfm-act-stat-pill--done { color: var(--pfm-success); background: #e8f5e9; }
.pfm-act-stat-pill--empty { color: var(--pfm-text-light); background: none; }
.pfm-act-progress-wrap {
  flex: 1; min-width: 80px; height: 6px;
  background: var(--pfm-surface-2); border-radius: 3px; overflow: hidden;
}
.pfm-act-progress-bar {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.pfm-act-stat-pct {
  font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* ── Loading placeholder ── */
.pfm-act-loading {
  text-align: center; padding: 48px 0;
  color: var(--pfm-text-muted); font-size: 14px;
}

/* ── Sections ── */
.pfm-act-sections { display: flex; flex-direction: column; gap: 20px; }

.pfm-act-section {
  background: var(--pfm-surface); border: 1.5px solid var(--pfm-border);
  border-radius: var(--pfm-radius); overflow: hidden;
}
/* ── Activity list ── */
.pfm-act-list { display: flex; flex-direction: column; }
.pfm-act-empty {
  padding: 24px 20px; font-size: 13px; color: var(--pfm-text-light);
  font-style: italic; text-align: center;
}

/* ── Activity item ── */
.pfm-act-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--pfm-border);
  transition: background var(--pfm-transition);
}
.pfm-act-item:last-child { border-bottom: none; }
.pfm-act-item:hover { background: var(--pfm-surface-2); }
.pfm-act-item--done { opacity: .65; }
.pfm-act-item--done .pfm-act-title { text-decoration: line-through; color: var(--pfm-text-muted); }

/* ── Checkbox ── */
.pfm-act-check-wrap {
  flex-shrink: 0; width: 22px; height: 22px;
  position: relative; cursor: pointer; margin-top: 1px;
}
.pfm-act-check-wrap input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.pfm-act-checkmark {
  display: block; width: 22px; height: 22px;
  border: 2px solid var(--pfm-border); border-radius: 6px;
  background: var(--pfm-surface); transition: all var(--pfm-transition);
}
.pfm-act-check-wrap:hover .pfm-act-checkmark { border-color: var(--pfm-accent); }
.pfm-act-check-wrap input:checked ~ .pfm-act-checkmark {
  background: var(--pfm-accent); border-color: var(--pfm-accent);
}
.pfm-act-check-wrap input:checked ~ .pfm-act-checkmark::after {
  content: ''; display: block;
  width: 5px; height: 10px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(2px, -1px);
  margin: 2px auto 0;
}

/* ── Activity body ── */
.pfm-act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.pfm-act-top-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfm-act-time {
  font-size: 11px; font-weight: 700; color: var(--pfm-primary);
  background: #dbeafe; border-radius: 4px; padding: 2px 7px;
  white-space: nowrap; font-family: 'Poppins', sans-serif;
}
.pfm-act-title { font-size: 14px; font-weight: 600; color: var(--pfm-text); line-height: 1.4; }

.pfm-act-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfm-act-cat-badge {
  font-size: 11px; font-weight: 600; border-radius: 20px;
  padding: 2px 9px; border: 1px solid transparent;
}
.pfm-act-proj { font-size: 12px; color: var(--pfm-text-muted); }

.pfm-act-desc {
  font-size: 13px; color: var(--pfm-text-muted); line-height: 1.5;
}
.pfm-act-notes {
  font-size: 12px; color: var(--pfm-text-light); line-height: 1.5;
  font-style: italic;
}

/* ── Row actions ── */
.pfm-act-row-actions {
  flex-shrink: 0; display: flex; gap: 4px; opacity: 0;
  transition: opacity var(--pfm-transition);
}
.pfm-act-item:hover .pfm-act-row-actions { opacity: 1; }

.pfm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: var(--pfm-radius-sm);
  border: 1.5px solid var(--pfm-border);
  background: var(--pfm-surface);
  color: var(--pfm-text-muted);
  cursor: pointer; font-size: 14px; line-height: 1;
  font-family: var(--pfm-font);
  transition: all var(--pfm-transition);
}
.pfm-icon-btn:hover {
  background: var(--pfm-surface-2);
  color: var(--pfm-text);
  border-color: var(--pfm-accent);
}
.pfm-act-delete.pfm-icon-btn:hover {
  background: #fef2f2;
  color: var(--pfm-danger);
  border-color: #fecaca;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .pfm-act-toolbar { flex-direction: column; align-items: stretch; }
  .pfm-act-date-nav { justify-content: center; }
  .pfm-act-date-display { min-width: 0; font-size: 13px; }
  .pfm-act-actions { justify-content: center; }
  .pfm-act-row-actions { opacity: 1; }
}

@media (max-width: 480px) {
  .pfm-act-row-actions {flex-direction: column;}
}

/* ======================== END ACTIVITIES PAGE ======================== */

/* ======================== PROJECT DETAILS — MOBILE POLISH ======================== */

/* ── 768px — tablet / sidebar-collapsed ── */
@media (max-width: 768px) {
  /* Tighten section card padding */
  .pfm-section-card { margin-bottom: 14px; }
  .pfm-sc-body { padding: 16px; }
  .pfm-sc-header { padding: 12px 16px; }

  /* Fin panels: tighter once they stack */
  .pfm-fin-left,
  .pfm-fin-right { padding: 16px; }

  /* Phase summary gap */
  .pfm-phase-summary { gap: 8px; }
}

/* ── 640px — large phones ── */
@media (max-width: 640px) {
  /* Expense header: filter select should expand to use available space */
  .pfm-sc-header-actions { flex-wrap: nowrap; }
  .pfm-sc-header-actions .pfm-select--sm { flex: 1; min-width: 0; }

  /* Hero bars tighter */
  .pfm-hero-bars { padding: 12px 14px 14px; }

  /* Phase action buttons: always visible on touch (no hover dependency) */
  .pfm-phase-actions { opacity: 1 !important; flex-direction: column;}
}

/* ── 480px — phones ── */
@media (max-width: 480px) {
  /* Breadcrumb */
  .pfm-breadcrumb { font-size: 12px; margin-bottom: 10px; }

  /* Hero card */
  .pfm-hero-title { font-size: 18px; }
  .pfm-hero-top { padding: 14px 14px 0; }
  .pfm-hero-bars { padding: 10px 14px 14px; }
  .pfm-hero-bar-row {
    grid-template-columns: 72px 1fr 38px;
    gap: 8px;
  }
  .pfm-hero-bar-lbl { font-size: 11px; }

  /* Hero stats: strict 2-column grid — prevents orphaned last item */
  .pfm-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 14px 0;
    background: none;
    border: none;
    border-radius: 0;
  }
  .pfm-hero-stat {
    flex: unset;
    padding: 10px 12px;
    background: var(--pfm-surface-2);
    border: 1px solid var(--pfm-border);
    border-radius: var(--pfm-radius-sm);
    border-right: 1px solid var(--pfm-border);
  }
  .pfm-hs-val { font-size: 12px; }
  .pfm-hs-lbl { font-size: 10px; }

  /* Section cards: compact */
  .pfm-sc-header { padding: 11px 14px; }
  .pfm-sc-body { padding: 14px; }
  .pfm-section-card { border-radius: 8px; margin-bottom: 10px; width:93vw; }

  /* Financial panels */
  .pfm-fin-left,
  .pfm-fin-right { padding: 14px; }

  /* Donut legend: hide mini progress bars (they're too narrow at this size) */
  .pfm-dl-bar-wrap { display: none; }
  .pfm-dl-item { grid-template-columns: 10px 1fr 28px auto; font-size: 12px; gap: 6px; }
  .pfm-dl-name { white-space: normal; line-height: 1.3; }

  /* Billing v2 */
  .pfm-bv2-header { padding: 12px 14px; }
  .pfm-bv2-header-amt { font-size: 18px; }
  .pfm-bv2-grid { padding: 10px; gap: 8px; }
  .pfm-bv2-footer { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }

  /* Phase items */
  .pfm-phase-item { padding: 12px; }
  .pfm-phase-summary { padding: 10px 12px; }

  /* Phase summary: stack left/right */
  .pfm-phase-summary-right { flex: 0 0 100%; justify-content: flex-start; }

  /* Documents: allow title to wrap instead of hard-truncating */
  .pfm-doc-title { white-space: normal; line-height: 1.35; }

  /* Document actions: keep buttons at minimum readable size */
  .pfm-doc-actions .pfm-btn-sm { padding: 6px 10px; font-size: 12px; }

  /* Expense table: hide Qty (col 6) and Unit Price (col 7) on small phones —
     only # + Description + Amount + actions remain visible */
  .pfm-exp-tbl thead tr th:nth-child(3),
  .pfm-exp-tbl thead tr th:nth-child(4),
  .pfm-exp-tbl thead tr th:nth-child(5),
  .pfm-exp-tbl thead tr th:nth-child(6),
  .pfm-exp-tbl tbody tr td:nth-child(6),
  .pfm-exp-tbl thead tr th:nth-child(7),
  .pfm-exp-tbl tbody tr td:nth-child(7) { display: none; }

  /* Expense table footer */
  .pfm-exp-tbl-footer { padding: 8px 12px; }

  /* Info grid already goes 1-col via existing rule — just ensure
     items don't have awkward right borders */
  .pfm-info-item { padding: 10px 12px; }
}

/* ── 375px — smallest phones (iPhone SE etc.) ── */
@media (max-width: 375px) {
  .pfm-hero-title { font-size: 16px; }
  .pfm-hero-stat { padding: 8px 10px; }
  .pfm-hs-val { font-size: 11px; }
  .pfm-content { padding: 10px; padding-bottom: 72px; }
  .pfm-bv2-item-amount { font-size: 15px; }
  .pfm-bv2-item-content { padding: 12px 12px 10px; }
  .pfm-phase-name { font-size: 14px; }
  .pfm-doc-actions { flex-wrap: wrap; }
  .pfm-doc-actions .pfm-btn-sm { font-size: 11px; padding: 5px 8px; }
}

/* ======================== END PROJECT DETAILS — MOBILE POLISH ======================== */
