/* ═══════════════════════════════════════════════════════════════
   Agencies WP — Client Portal  v3.0
   Clean, modern SaaS-style portal
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --c-green:    #059669;
  --c-green-d:  #047857;
  --c-green-l:  #d1fae5;
  --c-green-50: #ecfdf5;
  --c-blue:     #0284c7;
  --c-blue-l:   #e0f2fe;
  --c-red:      #dc2626;
  --c-red-l:    #fef2f2;
  --c-amber:    #d97706;
  --c-amber-l:  #fffbeb;
  --c-violet:   #7c3aed;
  --c-violet-l: #f5f3ff;
  --c-cyan:     #0891b2;
  --c-cyan-l:   #ecfeff;
  --c-slate-50:  #f8fafc;
  --c-slate-100: #f1f5f9;
  --c-slate-200: #e2e8f0;
  --c-slate-300: #cbd5e1;
  --c-slate-400: #94a3b8;
  --c-slate-500: #64748b;
  --c-slate-600: #475569;
  --c-slate-700: #334155;
  --c-slate-800: #1e293b;
  --c-slate-900: #0f172a;
  --c-white:     #ffffff;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
}

/* ── Shell & Layout ────────────────────────────────────────── */
.agencieswp-portal-shell {
  background: var(--c-slate-50);
  min-height: 80vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--c-slate-800);
}
.agencieswp-portal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

/* ── Header ────────────────────────────────────────────────── */
.awp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--c-slate-200);
  background: var(--c-white);
  /* stretch to edges */
  margin-left: -28px;
  margin-right: -28px;
  padding-left: 28px;
  padding-right: 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.awp-header__left { display: flex; align-items: center; gap: 12px; }
.awp-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-green), #0d9488);
  color: #fff; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: -.5px;
}
.awp-header__name { font-size: 14px; font-weight: 700; color: var(--c-slate-900); line-height: 1.2; }
.awp-header__sub  { font-size: 11px; color: var(--c-slate-400); margin-top: 1px; }

/* ── Nav ───────────────────────────────────────────────────── */
.awp-nav {
  display: flex; gap: 4px;
  padding: 0;
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid var(--c-slate-200);
  padding-bottom: 0;
}
.awp-nav::-webkit-scrollbar { display: none; }
.awp-nav__item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  text-decoration: none;
  color: var(--c-slate-500);
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
  transition: color .15s, background .15s;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  letter-spacing: .2px;
}
.awp-nav__item:hover {
  color: var(--c-slate-800);
  background: var(--c-slate-100);
}

/* Per-tab accent colors when active */
.awp-nav__item[href*="dashboard"].awp-nav__item--active    { color: #0284c7; border-bottom-color: #0284c7; background: #e0f2fe; }
.awp-nav__item[href*="projects"].awp-nav__item--active     { color: #059669; border-bottom-color: #059669; background: #d1fae5; }
.awp-nav__item[href*="invoices"].awp-nav__item--active     { color: #7c3aed; border-bottom-color: #7c3aed; background: #ede9fe; }
.awp-nav__item[href*="outstanding"].awp-nav__item--active  { color: #dc2626; border-bottom-color: #dc2626; background: #fee2e2; }
.awp-nav__item[href*="approvals_tab"].awp-nav__item--active { color: #d97706; border-bottom-color: #d97706; background: #fef3c7; }
.awp-nav__item[href*="discussions"].awp-nav__item--active  { color: #0891b2; border-bottom-color: #0891b2; background: #cffafe; }
.awp-nav__item[href*="requests"].awp-nav__item--active     { color: #be185d; border-bottom-color: #be185d; background: #fce7f3; }
.awp-nav__item[href*="contracts_tab"].awp-nav__item--active { color: #065f46; border-bottom-color: #059669; background: #ecfdf5; }
.awp-nav__item--active { font-weight: 800; }

/* Colored dots on inactive items */
.awp-nav__item .awp-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.awp-nav__item[href*="dashboard"] .awp-dot    { background: #0284c7; }
.awp-nav__item[href*="projects"] .awp-dot     { background: #059669; }
.awp-nav__item[href*="invoices"] .awp-dot     { background: #7c3aed; }
.awp-nav__item[href*="outstanding"] .awp-dot  { background: #dc2626; }
.awp-nav__item[href*="approvals_tab"] .awp-dot { background: #d97706; }
.awp-nav__item[href*="discussions"] .awp-dot  { background: #0891b2; }
.awp-nav__item[href*="contracts_tab"] .awp-dot { background: #059669; }
.awp-nav__item[href*="requests"] .awp-dot     { background: #be185d; }

.awp-badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px;
  background: var(--c-slate-200); color: var(--c-slate-700);
  font-size: 10px; font-weight: 800;
}
.awp-nav__item--active .awp-badge-count { opacity: .85; }
.awp-badge-count--danger { background: #dc2626 !important; color: #fff !important; }

/* ── Content area ──────────────────────────────────────────── */
.awp-content { /* just a clean wrapper */ }

/* ── Flash message ─────────────────────────────────────────── */
.awp-flash {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px; font-weight: 600;
  display: none;
}
.awp-flash--success { background: var(--c-green-l); color: #065f46; border: 1px solid #6ee7b7; }
.awp-flash--error   { background: var(--c-red-l);   color: #991b1b; border: 1px solid #fca5a5; }

/* ── Buttons ───────────────────────────────────────────────── */
.awp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-size: 13px; font-weight: 600; line-height: 1.4;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.awp-btn:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; }
.awp-btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.awp-btn--primary {
  background: var(--c-green); color: #fff; border-color: var(--c-green);
}
.awp-btn--primary:hover {
  background: var(--c-green-d); border-color: var(--c-green-d); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35);
}
.awp-btn--danger {
  background: #fff; color: var(--c-red); border-color: var(--c-red);
}
.awp-btn--danger:hover {
  background: var(--c-red); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.3);
}
.awp-btn--outline {
  background: #fff; color: var(--c-green); border-color: var(--c-slate-300);
}
.awp-btn--outline:hover { border-color: var(--c-green); background: var(--c-green-50); }
.awp-btn--ghost {
  background: transparent; color: var(--c-slate-500); border-color: var(--c-slate-300);
}
.awp-btn--ghost:hover { background: var(--c-slate-100); color: var(--c-slate-700); }
.awp-btn--sm  { padding: 6px 12px; font-size: 12px; }
.awp-btn--full { width: 100%; justify-content: center; }

/* ── Cards ─────────────────────────────────────────────────── */
.awp-card {
  background: var(--c-white); border: 1px solid var(--c-slate-200);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.awp-card:hover { box-shadow: var(--shadow-md); }
.awp-card--highlight {
  border-left: 4px solid var(--c-green);
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.awp-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.awp-badge--feature_request { background: var(--c-amber-l); color: #92400e; }
.awp-badge--change_request  { background: var(--c-cyan-l);  color: #155e75; }

/* ── Login page ────────────────────────────────────────────── */
.agencieswp-portal-login {
  display: flex; justify-content: center; padding: 72px 20px;
}
.agencieswp-portal-login__card {
  background: var(--c-white); border: 1px solid var(--c-slate-200);
  border-radius: 20px; padding: 48px 40px;
  max-width: 400px; width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,.08); text-align: center;
}
.agencieswp-portal-login__logo { margin-bottom: 16px; }
.agencieswp-portal-login__logo .dashicons {
  font-size: 44px; width: 44px; height: 44px; color: var(--c-green);
}
.agencieswp-portal-login__card h2 {
  margin: 0 0 6px; font-size: 24px; font-weight: 800;
  color: var(--c-slate-900); letter-spacing: -.5px;
}
.agencieswp-portal-login__subtitle { color: var(--c-slate-500); font-size: 13px; margin-bottom: 28px; }

/* ── Stats ─────────────────────────────────────────────────── */
.agencieswp-portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.agencieswp-portal-stat {
  background: var(--c-white); border: 1px solid var(--c-slate-200);
  border-top: 3px solid var(--c-green);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
  box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.agencieswp-portal-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.agencieswp-portal-stat--danger  { border-top-color: var(--c-red); }
.agencieswp-portal-stat--warning { border-top-color: var(--c-amber); }
.agencieswp-portal-stat__number {
  display: block; font-size: 26px; font-weight: 800;
  color: var(--c-slate-900); margin-bottom: 4px; letter-spacing: -.5px;
}
.agencieswp-portal-stat--danger .agencieswp-portal-stat__number  { color: var(--c-red); }
.agencieswp-portal-stat--warning .agencieswp-portal-stat__number { color: var(--c-amber); }
.agencieswp-portal-stat__label {
  font-size: 10px; color: var(--c-slate-500);
  text-transform: uppercase; letter-spacing: .7px; font-weight: 700;
}

/* ── Content cards ─────────────────────────────────────────── */
.agencieswp-portal-card {
  background: var(--c-white); border: 1px solid var(--c-slate-200);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.agencieswp-portal-card:hover { box-shadow: var(--shadow-md); }
.agencieswp-portal-card--highlight {
  border-left: 4px solid var(--c-green);
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.agencieswp-portal-card--approval { border-left: 4px solid var(--c-violet); }
.agencieswp-portal-card--payment  { border-left: 4px solid var(--c-red); }
.agencieswp-portal-card__header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.agencieswp-portal-card__body { color: var(--c-slate-600); font-size: 13px; line-height: 1.6; }
.agencieswp-portal-card__body p { margin: 3px 0; }
.agencieswp-portal-card__actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--c-slate-100); }
.agencieswp-portal-card__buttons { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.agencieswp-portal-card__closed { padding: 8px 0; color: var(--c-slate-400); font-style: italic; font-size: 13px; }
.agencieswp-payment-badge {
  display: inline-block; margin: 8px 0; padding: 10px 16px;
  background: var(--c-amber-l); border: 1px solid #fcd34d;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
}

/* ── Old portal buttons (still used in template body) ──────── */
.agencieswp-portal-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: 1.5px solid transparent;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; line-height: 1.4;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
  white-space: nowrap;
}
.agencieswp-portal-btn:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; }
.agencieswp-portal-btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.agencieswp-portal-btn--primary {
  background: var(--c-green); color: #fff; border-color: var(--c-green);
}
.agencieswp-portal-btn--primary:hover {
  background: var(--c-green-d); border-color: var(--c-green-d); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35);
}
.agencieswp-portal-btn--success {
  background: var(--c-green); color: #fff; border-color: var(--c-green);
}
.agencieswp-portal-btn--success:hover {
  background: #065f46; border-color: #065f46; color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35);
}
.agencieswp-portal-btn--danger {
  background: #fff; color: var(--c-red); border-color: var(--c-red);
}
.agencieswp-portal-btn--danger:hover {
  background: var(--c-red); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.3);
}
.agencieswp-portal-btn--outline {
  background: #fff; color: var(--c-green); border-color: var(--c-slate-300);
}
.agencieswp-portal-btn--outline:hover { border-color: var(--c-green); background: var(--c-green-50); }
.agencieswp-portal-btn--small { padding: 6px 12px; font-size: 12px; }
.agencieswp-portal-btn--full  { width: 100%; justify-content: center; }

/* ── Tables ─────────────────────────────────────────────────── */
.agencieswp-portal-table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--c-slate-200); box-shadow: var(--shadow);
}
.agencieswp-portal-table { width: 100%; border-collapse: collapse; background: var(--c-white); font-size: 13px; }
.agencieswp-portal-table th {
  background: var(--c-slate-50); padding: 11px 14px; text-align: left;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--c-slate-500); border-bottom: 1px solid var(--c-slate-200);
}
.agencieswp-portal-table td { padding: 12px 14px; border-bottom: 1px solid var(--c-slate-100); }
.agencieswp-portal-table tbody tr:last-child td { border-bottom: 0; }
.agencieswp-portal-table tbody tr:hover { background: var(--c-green-50); }

/* ── Badges ─────────────────────────────────────────────────── */
.agencieswp-badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.agencieswp-badge--pending, .agencieswp-badge--draft, .agencieswp-badge--medium { background: var(--c-slate-100); color: var(--c-slate-600); }
.agencieswp-badge--in_progress, .agencieswp-badge--sent, .agencieswp-badge--partial { background: var(--c-blue-l); color: #075985; }
.agencieswp-badge--completed, .agencieswp-badge--paid, .agencieswp-badge--active, .agencieswp-badge--open { background: var(--c-green-l); color: #065f46; }
.agencieswp-badge--on_hold, .agencieswp-badge--overdue, .agencieswp-badge--high, .agencieswp-badge--urgent { background: var(--c-red-l); color: #991b1b; }
.agencieswp-badge--cancelled, .agencieswp-badge--rejected, .agencieswp-badge--inactive, .agencieswp-badge--closed { background: var(--c-slate-100); color: var(--c-slate-400); }
.agencieswp-badge--low { background: var(--c-blue-l); color: var(--c-blue); }
.agencieswp-badge--approval { background: var(--c-violet-l); color: #5b21b6; }
.agencieswp-badge--feature_request { background: var(--c-amber-l); color: #92400e; }
.agencieswp-badge--change_request  { background: var(--c-cyan-l);  color: #155e75; }
.agencieswp-badge--payment_request { background: #fce7f3; color: #9d174d; }
.agencieswp-badge--project_request { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── Progress ────────────────────────────────────────────────── */
.agencieswp-progress-bar { background: var(--c-slate-100); border-radius: 6px; height: 8px; overflow: hidden; }
.agencieswp-progress-bar__fill {
  background: linear-gradient(90deg, var(--c-green), var(--c-cyan));
  height: 100%; border-radius: 6px; transition: width .4s ease;
}

/* ── Content headings ────────────────────────────────────────── */
.agencieswp-portal__content h3,
.awp-content h3 {
  font-size: 17px; font-weight: 800; margin: 28px 0 14px;
  color: var(--c-slate-900); letter-spacing: -.3px;
  display: flex; align-items: center; gap: 8px;
}
.agencieswp-portal__content h3::before,
.awp-content h3::before {
  content: ''; display: block; width: 3px; height: 18px;
  background: var(--c-green); border-radius: 2px; flex-shrink: 0;
}
.agencieswp-section-desc { color: var(--c-slate-500); font-size: 13px; margin: -8px 0 18px; }

/* ── Messages ────────────────────────────────────────────────── */
.agencieswp-portal-messages {
  display: flex; flex-direction: column; gap: 8px;
  margin: 14px 0; max-height: 400px; overflow-y: auto;
}
.agencieswp-portal-msg { padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 13px; }
.agencieswp-portal-msg--admin  { background: var(--c-green-50); border-left: 3px solid var(--c-green); }
.agencieswp-portal-msg--client { background: var(--c-blue-l);   border-left: 3px solid var(--c-blue); }
.agencieswp-portal-msg--approved { background: var(--c-green-l) !important; border-left-color: var(--c-green) !important; }
.agencieswp-portal-msg--denied   { background: var(--c-red-l)   !important; border-left-color: var(--c-red)   !important; }
.agencieswp-portal-msg__head { font-size: 11px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; color: var(--c-slate-500); }
.agencieswp-portal-msg__head strong { color: var(--c-slate-700); }
.agencieswp-portal-msg__body p { margin: 2px 0; line-height: 1.55; }
.agencieswp-portal-msg__payment { margin-top: 8px; padding: 8px 10px; background: var(--c-slate-50); border-radius: 6px; font-size: 12px; border: 1px dashed var(--c-slate-300); }

/* ── Forms ────────────────────────────────────────────────────── */
.agencieswp-portal-form__field { margin-bottom: 14px; }
.agencieswp-portal-form__field label {
  display: block; margin-bottom: 5px;
  font-size: 11px; font-weight: 700; color: var(--c-slate-600);
  text-transform: uppercase; letter-spacing: .4px;
}
.agencieswp-portal-input,
.agencieswp-portal-form input[type="text"],
.agencieswp-portal-form input[type="email"],
.agencieswp-portal-form select,
.agencieswp-portal-form textarea {
  width: 100%; padding: 9px 12px; box-sizing: border-box;
  border: 1px solid var(--c-slate-300); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--c-white); color: var(--c-slate-800);
  transition: border-color .15s, box-shadow .15s;
}
.agencieswp-portal-input:focus,
.agencieswp-portal-form input:focus,
.agencieswp-portal-form select:focus,
.agencieswp-portal-form textarea:focus {
  border-color: var(--c-green); outline: none;
  box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}

/* ── Files ────────────────────────────────────────────────────── */
.agencieswp-portal-files { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-slate-200); }
.agencieswp-portal-file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; background: var(--c-slate-50);
  border: 1px solid var(--c-slate-200); border-radius: var(--radius-sm);
  margin-bottom: 4px; font-size: 12px; transition: .12s;
}
.agencieswp-portal-file-item:hover { border-color: var(--c-green); background: var(--c-green-50); }
.agencieswp-portal-file-item .dashicons { color: var(--c-green); font-size: 14px; width: 14px; height: 14px; }
.agencieswp-portal-file-item a { color: var(--c-slate-700); font-weight: 600; text-decoration: none; }
.agencieswp-portal-file-item a:hover { color: var(--c-green); }
.agencieswp-client-file-upload-label { cursor: pointer; }
.agencieswp-client-file-upload-label:hover { border-color: var(--c-green) !important; background: var(--c-green-50) !important; }
.agencieswp-upload-status { font-size: 12px; color: var(--c-slate-500); }

/* ── Project overview ─────────────────────────────────────────── */
.agencieswp-project-overview {
  margin: 14px 0; padding: 16px;
  background: var(--c-slate-50); border: 1px solid var(--c-slate-200); border-radius: var(--radius);
}
.agencieswp-project-overview__header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agencieswp-project-overview__header h4 { margin: 0; font-size: 15px; color: var(--c-slate-900); font-weight: 700; }
.agencieswp-project-overview__desc { color: var(--c-slate-600); font-size: 13px; line-height: 1.55; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--c-slate-200); }
.agencieswp-project-overview__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.agencieswp-project-overview__item { text-align: center; padding: 10px 6px; background: var(--c-white); border-radius: var(--radius-sm); border: 1px solid var(--c-slate-200); }
.agencieswp-project-overview__label { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--c-slate-500); margin-bottom: 3px; font-weight: 700; }
.agencieswp-project-overview__value { display: block; font-size: 15px; font-weight: 800; color: var(--c-slate-800); }

/* ── Text helpers ─────────────────────────────────────────────── */
.agencieswp-text-danger  { color: var(--c-red);   font-weight: 700; }
.agencieswp-text-success { color: var(--c-green); font-weight: 700; }
.agencieswp-meta { color: var(--c-slate-500); font-size: 11px; }

/* ── Invoice print ─────────────────────────────────────────────── */
.agencieswp-invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 2px solid var(--c-green); }
.agencieswp-invoice-totals { width: 260px; margin-left: auto; margin-top: 18px; border-collapse: collapse; }
.agencieswp-invoice-totals th, .agencieswp-invoice-totals td { padding: 5px 10px; text-align: right; font-size: 13px; }

/* ── Portal: Project Milestones Timeline ──────────────────────── */
.awp-portal-timeline { position: relative; padding-left: 22px; }
.awp-portal-timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: #e5e7eb; border-radius: 2px; }
.awp-portal-timeline__item { position: relative; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.awp-portal-timeline__item:last-child { margin-bottom: 0; }
.awp-portal-timeline__dot { position: absolute; left: -19px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #d1d5db; border: 2px solid #fff; box-shadow: 0 0 0 2px #d1d5db; flex-shrink: 0; }
.awp-portal-timeline__item--completed .awp-portal-timeline__dot { background: #059669; box-shadow: 0 0 0 2px #d1fae5; }
.awp-portal-timeline__item--in_progress .awp-portal-timeline__dot { background: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.awp-portal-timeline__content { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.awp-portal-timeline__title { font-weight: 500; color: #111827; }
.awp-portal-timeline__due { font-size: 12px; color: #9ca3af; }

/* ── Portal: Team avatars ─────────────────────────────────────── */
.awp-portal-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #0284c7; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  #agencieswp-print-area, #agencieswp-print-area * { visibility: visible; }
  #agencieswp-print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
  .agencieswp-no-print, .awp-header, .awp-nav { display: none !important; }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .agencieswp-portal { padding: 0 16px 48px; }
  .awp-header { padding-left: 16px; padding-right: 16px; margin-left: -16px; margin-right: -16px; }
  .agencieswp-portal-login__card { padding: 32px 22px; }
  .agencieswp-portal-stats { grid-template-columns: 1fr 1fr; }
  .agencieswp-project-overview__grid { grid-template-columns: 1fr 1fr; }
  .agencieswp-portal-card--highlight { flex-direction: column; align-items: flex-start; }
  .agencieswp-portal-card__buttons { flex-direction: column; }
  .agencieswp-portal-btn--full { width: 100%; justify-content: center; }
  .awp-nav__item { padding: 8px 11px; font-size: 11px; }
}

/* ── Finance blocks (project card) ─────────────────────────────── */
.awp-finance-block { border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.awp-finance-block--hourly { background: #eff6ff; border: 1px solid #bfdbfe; }
.awp-finance-block--fixed  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.awp-finance-block__title  { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.awp-finance-block--hourly .awp-finance-block__title { color: #1d4ed8; }
.awp-finance-block--fixed  .awp-finance-block__title { color: #15803d; }
.awp-finance-block__rate   { font-size: 11px; font-weight: 600; background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 99px; }
.awp-finance-block__grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.awp-finance-block__note   { font-size: 11px; color: #6b7280; margin: 10px 0 0; line-height: 1.5; }

/* Finance grid items */
.awp-finance-item          { background: #fff; border-radius: 8px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.awp-finance-item__label   { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.awp-finance-item__value   { font-size: 15px; font-weight: 700; }
.awp-finance-item__value--neutral { color: #111827; }
.awp-finance-item__value--success { color: #16a34a; }
.awp-finance-item__value--warning { color: #d97706; }
.awp-finance-item__value--danger  { color: #dc2626; }

/* Stat card sub-label */
.agencieswp-portal-stat__sub { font-size: 10px; color: #9ca3af; margin-top: 2px; line-height: 1.3; }

/* Outstanding page: per-project cells */
.awp-os-cell            { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.awp-os-cell:last-child { border-bottom: none; }
.awp-os-cell__label     { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }
.awp-os-cell__val       { font-size: 14px; font-weight: 700; color: #111827; }
.awp-os-cell__val--success { color: #16a34a; }
.awp-os-cell__val--warning { color: #d97706; }
.awp-os-cell__val--danger  { color: #dc2626; }
