/* ── TBGG Client Portal – Design System ───────────────────────────────────
   Inter loaded via wp_enqueue_style in class-tbgg-client-portal.php
────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

:root {
  --tbgg-navy:    #0F2744;
  --tbgg-cobalt:  #1B4FD8;
  --tbgg-cobalt-h:#1540B0;
  --tbgg-gold:    #C9963A;
  --tbgg-ink:     #1A1F2E;
  --tbgg-muted:   #6B7280;
  --tbgg-cloud:   #F6F7FB;
  --tbgg-white:   #FFFFFF;
  --tbgg-border:  #E5E7EB;
  --tbgg-border-h:#D1D5DB;
  --tbgg-radius:  10px;
  --tbgg-radius-lg:16px;
  --tbgg-shadow:  0 1px 3px rgba(15,39,68,.06), 0 4px 12px rgba(15,39,68,.06);
  --tbgg-shadow-up:0 8px 24px rgba(15,39,68,.12);
  --tbgg-primary: var(--tbgg-navy);
  --tbgg-accent:  var(--tbgg-cobalt);
  --tbgg-sidebar-w: 240px;
  --tbgg-success: #166534;
  --tbgg-danger:  #991B1B;
  --tbgg-warning: #92400E;
}

/* ── Portal shell ──────────────────────────────────────────────────────── */
.tbgg-portal {
  display: flex;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--tbgg-ink);
  background: var(--tbgg-cloud);
  line-height: 1.5;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.tbgg-nav {
  width: var(--tbgg-sidebar-w);
  flex-shrink: 0;
  background: var(--tbgg-navy);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.tbgg-nav-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.tbgg-nav-logo img { max-width: 140px; max-height: 42px; object-fit: contain; }
.tbgg-nav-logo .firm-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
}
.tbgg-nav-logo .client-name {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  font-weight: 500;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbgg-nav-links {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tbgg-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
  text-decoration: none;
}
.tbgg-nav-link .icon { font-size: 16px; flex-shrink: 0; }
.tbgg-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.tbgg-nav-link.active {
  background: var(--tbgg-cobalt);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(27,79,216,.4);
}
.tbgg-nav-link .badge {
  margin-left: auto;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
}
.tbgg-nav-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.tbgg-nav-bottom a {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .12s;
}
.tbgg-nav-bottom a:hover { color: rgba(255,255,255,.8); }

/* ── Main content area ─────────────────────────────────────────────────── */
.tbgg-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tbgg-topbar {
  height: 60px;
  background: var(--tbgg-white);
  border-bottom: 1px solid var(--tbgg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--tbgg-border);
}
.tbgg-topbar .page-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--tbgg-navy);
  letter-spacing: -.3px;
}
.tbgg-topbar-right { display: flex; align-items: center; gap: 14px; }
.tbgg-topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tbgg-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tbgg-content {
  padding: 28px;
  flex: 1;
}

/* ── Mobile toggle ─────────────────────────────────────────────────────── */
.tbgg-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--tbgg-navy);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(15,39,68,.4);
}
@media (max-width: 768px) {
  .tbgg-mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .tbgg-nav { position: fixed; left: -100%; transition: left .22s ease; height: 100%; }
  .tbgg-nav.open { left: 0; }
  .tbgg-content { padding: 18px; }
}

/* ── Notifications ─────────────────────────────────────────────────────── */
.tbgg-notif-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background .12s;
  color: var(--tbgg-muted);
}
.tbgg-notif-btn:hover { background: var(--tbgg-cloud); color: var(--tbgg-ink); }
.tbgg-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid var(--tbgg-white);
}
.tbgg-notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: var(--tbgg-white);
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  box-shadow: var(--tbgg-shadow-up);
  z-index: 200;
  display: none;
  max-height: 420px;
  overflow-y: auto;
}
.tbgg-notif-panel.open { display: block; }
.tbgg-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tbgg-border);
  position: sticky;
  top: 0;
  background: var(--tbgg-white);
}
.tbgg-notif-header h4 { font-size: 13px; font-weight: 700; color: var(--tbgg-navy); }
.tbgg-notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tbgg-border);
  cursor: pointer;
  transition: background .1s;
}
.tbgg-notif-item:last-child { border-bottom: none; }
.tbgg-notif-item:hover { background: var(--tbgg-cloud); }
.tbgg-notif-item.unread { background: #EFF6FF; }
.tbgg-notif-item .n-title { font-size: 12px; font-weight: 700; color: var(--tbgg-navy); margin-bottom: 2px; }
.tbgg-notif-item .n-body  { font-size: 12px; color: var(--tbgg-muted); line-height: 1.4; }
.tbgg-notif-item .n-time  { font-size: 10px; color: var(--tbgg-muted); margin-top: 4px; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.tbgg-card {
  background: var(--tbgg-white);
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  padding: 22px;
  box-shadow: var(--tbgg-shadow);
  margin-bottom: 18px;
}
.tbgg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.tbgg-card-header h3 { font-size: 15px; font-weight: 700; color: var(--tbgg-navy); }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.tbgg-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.tbgg-stat-card {
  background: var(--tbgg-white);
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  padding: 20px;
  box-shadow: var(--tbgg-shadow);
  position: relative;
  overflow: hidden;
}
.tbgg-stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--tbgg-border);
}
.tbgg-stat-card.highlight::before { background: var(--tbgg-gold); }
.tbgg-stat-card .s-label { font-size: 11px; font-weight: 600; color: var(--tbgg-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.tbgg-stat-card .s-value { font-size: 22px; font-weight: 800; color: var(--tbgg-navy); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.tbgg-stat-card.highlight .s-value { color: var(--tbgg-gold); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.tbgg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbgg-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tbgg-muted);
  background: var(--tbgg-cloud);
  border-bottom: 1px solid var(--tbgg-border);
}
.tbgg-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--tbgg-border);
  color: var(--tbgg-ink);
  vertical-align: middle;
}
.tbgg-table tbody tr:last-child td { border-bottom: none; }
.tbgg-table tbody tr:hover td { background: #FAFBFF; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.tbgg-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;
}
.tbgg-badge-active,.tbgg-badge-paid,.tbgg-badge-done,.tbgg-badge-approved,.tbgg-badge-submitted,.tbgg-badge-both_signed { background: #DCFCE7; color: #166534; }
.tbgg-badge-pending,.tbgg-badge-draft,.tbgg-badge-pending_invite { background: #F3F4F6; color: #374151; }
.tbgg-badge-invited,.tbgg-badge-partial,.tbgg-badge-in_progress { background: #FEF3C7; color: #92400E; }
.tbgg-badge-sent { background: #DBEAFE; color: #1E40AF; }
.tbgg-badge-overdue,.tbgg-badge-rejected,.tbgg-badge-suspended,.tbgg-badge-blocked,.tbgg-badge-cancelled { background: #FEE2E2; color: #991B1B; }
.tbgg-badge-paused,.tbgg-badge-firm_signed,.tbgg-badge-client_signed { background: #EDE9FE; color: #5B21B6; }
.tbgg-badge-archived,.tbgg-badge-inactive { background: #F9FAFB; color: #6B7280; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.tbgg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .1s;
  line-height: 1;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.tbgg-btn:active { transform: translateY(1px); }
.tbgg-btn-primary { background: var(--tbgg-cobalt); color: #fff; border-color: var(--tbgg-cobalt); }
.tbgg-btn-primary:hover { background: var(--tbgg-cobalt-h); box-shadow: 0 4px 12px rgba(27,79,216,.3); color: #fff; }
.tbgg-btn-secondary { background: var(--tbgg-white); color: var(--tbgg-cobalt); border-color: var(--tbgg-cobalt); }
.tbgg-btn-secondary:hover { background: #EEF2FF; }
.tbgg-btn-ghost { background: transparent; color: var(--tbgg-muted); border-color: var(--tbgg-border); }
.tbgg-btn-ghost:hover { background: var(--tbgg-cloud); color: var(--tbgg-ink); border-color: var(--tbgg-border-h); }
.tbgg-btn-outline { background: transparent; color: var(--tbgg-cobalt); border-color: var(--tbgg-cobalt); }
.tbgg-btn-outline:hover { background: #EEF2FF; }
.tbgg-btn-success { background: #16A34A; color: #fff; border-color: #16A34A; }
.tbgg-btn-success:hover { background: #15803D; }
.tbgg-btn-sm  { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.tbgg-btn-pay {
  width: 100%;
  padding: 14px;
  background: var(--tbgg-cobalt);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .14s, box-shadow .14s;
  font-family: inherit;
}
.tbgg-btn-pay:hover { background: var(--tbgg-cobalt-h); box-shadow: 0 6px 18px rgba(27,79,216,.3); }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.tbgg-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.tbgg-form-group label { font-size: 12px; font-weight: 600; color: var(--tbgg-ink); }
.tbgg-form-group input,
.tbgg-form-group select,
.tbgg-form-group textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--tbgg-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--tbgg-ink);
  background: var(--tbgg-white);
  transition: border-color .14s, box-shadow .14s;
  width: 100%;
}
.tbgg-form-group input:focus,
.tbgg-form-group select:focus,
.tbgg-form-group textarea:focus {
  outline: none;
  border-color: var(--tbgg-cobalt);
  box-shadow: 0 0 0 3px rgba(27,79,216,.12);
}
.tbgg-form-group textarea { resize: vertical; min-height: 88px; }

/* ── Progress ──────────────────────────────────────────────────────────── */
.tbgg-progress {
  background: #E5E7EB;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.tbgg-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tbgg-cobalt), #60A5FA);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.25,.46,.45,.94);
}
.tbgg-progress.green .fill { background: linear-gradient(90deg, #16A34A, #4ADE80); }

/* ── Project / phase elements ───────────────────────────────────────────  */
.tbgg-phase {
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  overflow: hidden;
  background: var(--tbgg-white);
  box-shadow: var(--tbgg-shadow);
  margin-bottom: 12px;
}
.tbgg-phase-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--tbgg-cloud);
  border-bottom: 1px solid var(--tbgg-border);
}
.tbgg-phase-hdr .ph-name { font-size: 13px; font-weight: 700; color: var(--tbgg-navy); }
.tbgg-phase-hdr .ph-meta { display: flex; align-items: center; gap: 8px; }
.tbgg-task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--tbgg-border);
  transition: background .1s;
}
.tbgg-task:last-child { border-bottom: none; }
.tbgg-task:hover { background: #FAFBFF; }
.tbgg-task .t-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #DCFCE7;
  color: #166534;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.tbgg-task.done .t-title { text-decoration: line-through; color: var(--tbgg-muted); }
.tbgg-task .t-title { font-size: 13px; font-weight: 500; color: var(--tbgg-ink); }
.tbgg-task .t-meta { font-size: 11px; color: var(--tbgg-muted); margin-top: 3px; }

/* ── KPI cards (client side) ────────────────────────────────────────────  */
.tbgg-kpi-impact {
  background: var(--tbgg-white);
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  padding: 20px;
  box-shadow: var(--tbgg-shadow);
  border-left: 3px solid var(--tbgg-gold);
}
.ki-name { font-size: 14px; font-weight: 700; color: var(--tbgg-navy); margin-bottom: 12px; }
.ki-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--tbgg-border); }
.ki-row:last-of-type { border-bottom: none; }
.ki-label { font-size: 12px; color: var(--tbgg-muted); font-weight: 500; }
.ki-val { font-size: 14px; font-weight: 700; color: var(--tbgg-navy); font-variant-numeric: tabular-nums; }
.ki-current { color: var(--tbgg-gold); font-size: 16px; }

/* ── Document cards ─────────────────────────────────────────────────────  */
.tbgg-doc-card {
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius-lg);
  padding: 16px;
  background: var(--tbgg-white);
  box-shadow: var(--tbgg-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow .14s, border-color .14s;
}
.tbgg-doc-card:hover { box-shadow: var(--tbgg-shadow-up); border-color: var(--tbgg-cobalt); }
.tbgg-doc-card .d-icon { font-size: 28px; }
.tbgg-doc-card .d-name { font-size: 13px; font-weight: 700; color: var(--tbgg-navy); word-break: break-word; }
.tbgg-doc-card .d-meta { font-size: 11px; color: var(--tbgg-muted); }
.tbgg-doc-card .d-sign-alert { font-size: 11px; font-weight: 700; color: #92400E; background: #FEF3C7; padding: 4px 10px; border-radius: 20px; align-self: flex-start; }

/* ── Modal (client-side) ────────────────────────────────────────────────  */
.tbgg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,39,68,.52);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tbgg-modal-overlay.open { display: flex; }
.tbgg-portal-modal {
  background: var(--tbgg-white);
  border-radius: var(--tbgg-radius-lg);
  box-shadow: 0 24px 64px rgba(15,39,68,.22);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: tbgg-modal-in .18s ease;
}
.tbgg-portal-modal.lg { max-width: 720px; }
@keyframes tbgg-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tbgg-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--tbgg-border);
  position: sticky;
  top: 0;
  background: var(--tbgg-white);
  z-index: 1;
}
.tbgg-modal-hdr h3 { font-size: 16px; font-weight: 800; color: var(--tbgg-navy); }
.tbgg-modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--tbgg-muted); padding: 4px 8px; border-radius: 6px; transition: background .12s; }
.tbgg-modal-close:hover { background: var(--tbgg-cloud); color: var(--tbgg-ink); }
.tbgg-modal-body { padding: 22px; }
.tbgg-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--tbgg-border);
  background: var(--tbgg-cloud);
  border-radius: 0 0 var(--tbgg-radius-lg) var(--tbgg-radius-lg);
  position: sticky;
  bottom: 0;
}

/* ── Auth pages (login / register) ─────────────────────────────────────  */
.tbgg-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tbgg-navy);
  padding: 24px;
  position: relative;
}
.tbgg-auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(27,79,216,.25) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(201,150,58,.12) 0%, transparent 50%);
  pointer-events: none;
}
.tbgg-auth-card {
  background: var(--tbgg-white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 32px 80px rgba(15,39,68,.28);
  position: relative;
}
.tbgg-auth-logo { margin-bottom: 28px; }
.tbgg-auth-logo img { max-height: 48px; }
.tbgg-auth-logo .firm { font-size: 20px; font-weight: 800; color: var(--tbgg-navy); }
.tbgg-auth-card .subtitle { font-size: 13px; color: var(--tbgg-muted); margin-bottom: 24px; }
.tbgg-auth-heading { font-size: 24px; font-weight: 800; color: var(--tbgg-navy); letter-spacing: -.5px; margin-bottom: 4px; }
.tbgg-auth-sub { font-size: 13px; color: var(--tbgg-muted); margin-bottom: 28px; }
.tbgg-auth-field { margin-bottom: 14px; }
.tbgg-auth-field label { font-size: 12px; font-weight: 600; color: var(--tbgg-ink); display: block; margin-bottom: 5px; }
.tbgg-auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--tbgg-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--tbgg-ink);
  background: var(--tbgg-white);
  transition: border-color .14s, box-shadow .14s;
}
.tbgg-auth-field input:focus { outline: none; border-color: var(--tbgg-cobalt); box-shadow: 0 0 0 3px rgba(27,79,216,.12); }
.tbgg-auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--tbgg-cobalt);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, box-shadow .14s;
  margin-top: 6px;
}
.tbgg-auth-submit:hover { background: var(--tbgg-cobalt-h); box-shadow: 0 6px 18px rgba(27,79,216,.3); }
.tbgg-auth-error { background: #FEE2E2; color: #991B1B; border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; display: none; }
.tbgg-auth-footer { text-align: center; font-size: 12px; color: var(--tbgg-muted); margin-top: 20px; }
.tbgg-auth-footer a { color: var(--tbgg-cobalt); font-weight: 600; text-decoration: none; }

/* ── Toast (client) ─────────────────────────────────────────────────────  */
#tbgg-portal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.tbgg-portal-toast-item {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  animation: tbgg-toast-in .2s ease;
  max-width: 320px;
  line-height: 1.4;
}
@keyframes tbgg-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tbgg-portal-toast-item.success { background: #166534; color: #fff; }
.tbgg-portal-toast-item.error   { background: #991B1B; color: #fff; }

/* ── Signature canvas ───────────────────────────────────────────────────  */
.tbgg-sig-canvas {
  width: 100%;
  border: 1.5px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius);
  background: var(--tbgg-cloud);
  cursor: crosshair;
  display: block;
  touch-action: none;
}

/* ── Pay methods ────────────────────────────────────────────────────────  */
.tbgg-pay-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tbgg-pay-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--tbgg-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.tbgg-pay-method:hover { border-color: var(--tbgg-cobalt); background: #EEF2FF; }
.tbgg-pay-method.selected { border-color: var(--tbgg-cobalt); background: #EEF2FF; box-shadow: 0 0 0 3px rgba(27,79,216,.12); }
.tbgg-pay-method .pm-logo { font-size: 24px; flex-shrink: 0; }
.tbgg-pay-method .pm-label { font-weight: 700; font-size: 13px; color: var(--tbgg-navy); }
.tbgg-pay-method .pm-desc  { font-size: 11px; color: var(--tbgg-muted); margin-top: 2px; }


/* ── Folder filter buttons ──────────────────────────────────────────── */
.folder-filter-btn { margin-bottom: 4px; }

/* ── Dashboard feedback banner ──────────────────────────────────────── */
#feedback-banner {
  background: linear-gradient(135deg, var(--tbgg-navy), var(--tbgg-cobalt));
  color: #fff;
  padding: 16px 22px;
  border-radius: var(--tbgg-radius-lg);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(27,79,216,.25);
}
#feedback-banner button {
  background: #fff;
  color: var(--tbgg-navy);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow .14s;
  white-space: nowrap;
}
#feedback-banner button:hover { box-shadow: 0 4px 12px rgba(0,0,0,.15); }

/* ── Pay modal ──────────────────────────────────────────────────────── */
.tbgg-portal-modal .bank-details {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--tbgg-radius);
  padding: 16px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 2;
}

/* ── Outstanding banner (invoices page) ─────────────────────────────── */
#outstanding-banner {
  background: linear-gradient(135deg, #92400E, #B45309);
  color: #fff;
  padding: 16px 22px;
  border-radius: var(--tbgg-radius-lg);
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(146,64,14,.25);
}

/* ── Project view tab strip ─────────────────────────────────────────── */
#proj-tabs-strip {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--tbgg-border);
  margin-bottom: 20px;
}
.tbgg-portal-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tbgg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .14s, border-color .14s;
}
.tbgg-portal-tab:hover { color: var(--tbgg-navy); }
.tbgg-portal-tab.active { color: var(--tbgg-cobalt); border-bottom-color: var(--tbgg-cobalt); }

/* ── Register page multi-section layout ─────────────────────────────── */
.tbgg-auth-card .section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--tbgg-navy);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tbgg-border);
  letter-spacing: -.1px;
}
.tbgg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .tbgg-form-row { grid-template-columns: 1fr; } }

/* ── Consent / permission checkbox area ─────────────────────────────── */
.tbgg-consent-box {
  background: var(--tbgg-cloud);
  border: 1px solid var(--tbgg-border);
  border-radius: var(--tbgg-radius);
  padding: 14px 16px;
  margin: 14px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--tbgg-ink);
  line-height: 1.5;
}
.tbgg-consent-box input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  accent-color: var(--tbgg-cobalt);
  flex-shrink: 0;
}
.tbgg-consent-box a { color: var(--tbgg-cobalt); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tbgg-stats { grid-template-columns: 1fr 1fr; }
  .tbgg-content { padding: 16px; }
}
@media (max-width: 480px) {
  .tbgg-stats { grid-template-columns: 1fr; }
  .tbgg-auth-card { padding: 28px 22px; }
}

/* ── Utility layer ──────────────────────────────────────────────────────── */
.tbgg-empty { text-align: center; padding: 40px 20px; color: var(--tbgg-muted); font-size: 13px; grid-column: 1/-1; }
.tbgg-empty-icon { font-size: 40px; margin-bottom: 12px; }
.tbgg-muted    { color: var(--tbgg-muted); }
.tbgg-navy     { color: var(--tbgg-navy); }
.tbgg-gold     { color: var(--tbgg-gold); }
.tbgg-success  { color: #166534; }
.tbgg-small    { font-size: 12px; }
.tbgg-xs       { font-size: 11px; }
.tbgg-bold     { font-weight: 700; }
.tbgg-flex     { display: flex; align-items: center; gap: 8px; }
.tbgg-flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tbgg-flex-end { display: flex; justify-content: flex-end; gap: 8px; }
.tbgg-flex-wrap{ display: flex; flex-wrap: wrap; gap: 8px; }
.tbgg-mt-8  { margin-top: 8px; }
.tbgg-mt-12 { margin-top: 12px; }
.tbgg-mt-16 { margin-top: 16px; }
.tbgg-mb-8  { margin-bottom: 8px; }
.tbgg-mb-12 { margin-bottom: 12px; }
.tbgg-mb-16 { margin-bottom: 16px; }
.tbgg-info-box  { padding: 12px 16px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--tbgg-radius); font-size: 12px; color: #1E40AF; line-height: 1.6; }
.tbgg-warn-box  { padding: 12px 16px; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: var(--tbgg-radius); font-size: 12px; color: #92400E; line-height: 1.6; }
.tbgg-divider   { border: none; border-top: 1px solid var(--tbgg-border); margin: 18px 0; }
.tbgg-label-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; line-height: 1.5; }
.tbgg-label-row input { margin-top: 2px; flex-shrink: 0; accent-color: var(--tbgg-cobalt); }
.tbgg-section-title { font-size: 13px; font-weight: 700; color: var(--tbgg-navy); margin: 20px 0 8px; }
.tbgg-section-desc  { font-size: 13px; color: var(--tbgg-muted); margin: 0 0 14px; line-height: 1.6; }

/* ── Utility layer (mirrors admin CSS) ─────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }  .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px;  } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px;  } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-xs  { font-size: 11px; } .text-sm  { font-size: 12px; }
.text-base{ font-size: 13px; } .text-md  { font-size: 14px; }
.font-600 { font-weight: 600; } .font-700 { font-weight: 700; } .font-800 { font-weight: 800; }
.text-center { text-align: center; }
.text-navy   { color: var(--tbgg-navy); }
.text-cobalt { color: var(--tbgg-cobalt); }
.text-gold   { color: var(--tbgg-gold); }
.text-muted  { color: var(--tbgg-muted); }
.text-green  { color: #166534; }
.text-red    { color: #991B1B; }
.text-amber  { color: #92400E; }
.rounded     { border-radius: var(--tbgg-radius); }
.rounded-lg  { border-radius: var(--tbgg-radius-lg); }
.w-full  { width: 100%; }
.hidden  { display: none; }
.block   { display: block; }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbgg-empty { text-align: center; padding: 48px 24px; color: var(--tbgg-muted); }
.tbgg-empty .icon { font-size: 40px; margin-bottom: 12px; }
.tbgg-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--tbgg-radius); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.tbgg-alert-info  { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.tbgg-alert-warn  { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.tbgg-help { font-size: 11px; color: var(--tbgg-muted); margin-top: 4px; line-height: 1.5; }
.tbgg-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--tbgg-muted); margin-bottom: 10px; display: block;
}

/* ── Utility layer ───────────────────────────────────────────────────── */
.u-muted   { color: var(--tbgg-muted); }
.u-primary { color: var(--tbgg-navy); }
.u-gold    { color: var(--tbgg-gold); }
.u-success { color: #166534; }
.u-warning { color: #92400E; }
.u-danger  { color: #991B1B; }
.u-xs  { font-size: 11px; }
.u-sm  { font-size: 12px; }
.u-md  { font-size: 13px; }
.u-bold { font-weight: 700; }
.u-black { font-weight: 800; }
.u-mt-8  { margin-top: 8px; }
.u-mt-16 { margin-top: 16px; }
.u-mb-8  { margin-bottom: 8px; }
.u-mb-16 { margin-bottom: 16px; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.u-surface { background: var(--tbgg-cloud); border-radius: var(--tbgg-radius); padding: 12px 14px; }
.u-info-box.blue   { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.6; }
.u-info-box.yellow { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.6; }

/* ── Section transition (eliminates blank-screen flash on nav click) ─── */
.tbgg-content {
  animation: tbgg-fade-in .22s ease forwards;
}
@keyframes tbgg-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading state for async data ───────────────────────────────────── */
.tbgg-skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: tbgg-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes tbgg-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Active nav item highlight on page load ──────────────────────────── */
.tbgg-nav-link {
  user-select: none;
  -webkit-user-select: none;
}
