*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; scroll-padding-top: 76px; }
  :root {
    --primary: #0F62FE;
    --primary-light: #EBF2FF;
    --primary-dark: #0043CE;
    --secondary: #1F2937;
    --success: #16A34A;
    --success-light: #DCFCE7;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --sidebar-w: 220px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 14px;
  }
  body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text-primary); font-size: 14px; line-height: 1.5; overflow-x: hidden; }
  body.scroll-locked { overflow: hidden; }
  a { color: inherit; text-decoration: none; }
  button { cursor: pointer; font-family: inherit; }
  input, select, textarea { font-family: inherit; }

  /* Local icon fallback. Tabler CDN overrides these when it loads. */
  .ti { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; line-height: 1; font-style: normal; font-family: "Segoe UI Symbol", "Noto Sans Symbols", Arial, sans-serif; }
  .ti::before { content: "\25A1"; }
  .ti-activity-heartbeat::before { content: "\2665"; }
  .ti-alert-triangle::before { content: "\26A0"; }
  .ti-arrow-left::before { content: "\2190"; }
  .ti-bell::before { content: "\25CE"; }
  .ti-brand-whatsapp::before { content: "\260E"; }
  .ti-briefcase::before { content: "\25A3"; }
  .ti-brush::before { content: "\25E9"; }
  .ti-building-store::before { content: "\25A6"; }
  .ti-calendar::before, .ti-calendar-dollar::before, .ti-calendar-due::before { content: "\25A4"; }
  .ti-cash::before, .ti-cash-banknote::before, .ti-coin::before { content: "\20B9"; }
  .ti-category::before { content: "\25A6"; }
  .ti-chart-bar::before, .ti-trending-up::before { content: "\25A5"; }
  .ti-check::before, .ti-checklist::before, .ti-circle-check::before { content: "\2713"; }
  .ti-chevron-down::before { content: "\2304"; }
  .ti-chevron-left::before { content: "\2039"; }
  .ti-chevron-right::before { content: "\203A"; }
  .ti-chevrons-left::before { content: "\00AB"; }
  .ti-clipboard-text::before { content: "\25A4"; }
  .ti-clock-dollar::before, .ti-hourglass-high::before { content: "\25D4"; }
  .ti-credit-card::before { content: "\25AD"; }
  .ti-database::before { content: "\25C9"; }
  .ti-download::before { content: "\2193"; }
  .ti-edit::before { content: "\270E"; }
  .ti-eye::before { content: "\25C9"; }
  .ti-file::before, .ti-file-invoice::before, .ti-file-plus::before, .ti-file-text::before, .ti-file-type-pdf::before { content: "\25A7"; }
  .ti-file-zip::before { content: "\25A8"; }
  .ti-filter::before { content: "\25BD"; }
  .ti-flag-2::before { content: "\2691"; }
  .ti-folder::before, .ti-folder-open::before { content: "\25B0"; }
  .ti-key::before { content: "\26BF"; }
  .ti-layout-dashboard::before { content: "\25A6"; }
  .ti-link-off::before { content: "\26AD"; }
  .ti-logout::before { content: "\2192"; }
  .ti-mail::before, .ti-mail-forward::before { content: "\2709"; }
  .ti-map-pin::before { content: "\25C9"; }
  .ti-menu-2::before { content: "\2630"; }
  .ti-phone::before, .ti-phone-call::before { content: "\260E"; }
  .ti-photo::before { content: "\25A7"; }
  .ti-plus::before { content: "\002B"; }
  .ti-receipt::before, .ti-receipt-2::before, .ti-receipt-tax::before { content: "\25A4"; }
  .ti-rotate-clockwise::before { content: "\21BB"; }
  .ti-search::before { content: "\2315"; }
  .ti-settings::before { content: "\2699"; }
  .ti-trash::before { content: "\2715"; }
  .ti-upload::before { content: "\2191"; }
  .ti-user::before, .ti-users::before { content: "\25CF"; }
  .ti-vector::before, .ti-vector-triangle::before { content: "\25B3"; }
  .ti-video::before { content: "\25B6"; }
  .ti-x::before { content: "\00D7"; }

  /* Layout */
  .app { display: flex; height: 100vh; overflow: hidden; }
  .sidebar { width: var(--sidebar-w); background: var(--secondary); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; transition: width .2s ease, transform .2s ease; }
  .main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; scroll-behavior: smooth; overscroll-behavior-y: contain; scrollbar-gutter: stable; }

  /* Sidebar */
  .sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .brand-logo { display: flex; align-items: center; gap: 10px; }
  .brand-copy { min-width: 0; flex: 1; }
  .brand-icon { width: 36px; height: 36px; background: #292827; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
  .brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .login-logo { width: 48px !important; height: 48px !important; border-radius: 50% !important; }
  .brand-name { color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
  .brand-sub { color: rgba(255,255,255,0.4); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }
  .sidebar-collapse-btn { width: 26px; height: 26px; border: 0; border-radius: 6px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .sidebar-collapse-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
  body.sidebar-collapsed .sidebar { width: 68px; }
  body.sidebar-collapsed .sidebar-brand { padding-left: 16px; padding-right: 16px; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .sidebar-section-label,
  body.sidebar-collapsed .sidebar-nav li a span,
  body.sidebar-collapsed .sidebar-nav li a .badge { display: none; }
  body.sidebar-collapsed .brand-logo { justify-content: center; }
  body.sidebar-collapsed .sidebar-collapse-btn { position: absolute; left: 54px; background: var(--primary); color: #fff; box-shadow: var(--shadow); }
  body.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
  body.sidebar-collapsed .sidebar-nav li a { justify-content: center; padding: 10px; }
  body.sidebar-collapsed .sidebar-nav li a i { font-size: 20px; }

  .sidebar-section { padding: 20px 10px 8px; }
  .sidebar-section-label { color: rgba(255,255,255,0.3); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 8px; margin-bottom: 6px; }
  .sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 1px; }
  .sidebar-nav li a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.55); font-size: 13.5px; font-weight: 400; transition: all 0.15s;
  }
  .sidebar-nav li a i { font-size: 17px; flex-shrink: 0; }
  .sidebar-nav li a:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
  .sidebar-nav li a.active { background: var(--primary); color: #fff; font-weight: 500; }
  .sidebar-nav li a .badge { margin-left: auto; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); font-size: 10px; padding: 2px 6px; border-radius: 10px; }
  .sidebar-nav li a.active .badge { background: rgba(255,255,255,0.2); color: #fff; }
  .sidebar-footer { margin-top: auto; padding: 14px 10px; border-top: 1px solid rgba(255,255,255,0.06); }

  /* Topbar */
  .topbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 0 28px; height: 58px; display: flex; align-items: center; gap: 16px; flex-shrink: 0; position: sticky; top: 0; z-index: 10; }
  .topbar-left { display: flex; align-items: center; gap: 14px; flex: 1; }
  .page-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
  .page-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
  .search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; width: 280px; }
  .search-box i { color: var(--text-muted); font-size: 16px; }
  .search-box input { border: none; background: none; outline: none; font-size: 13px; color: var(--text-primary); width: 100%; }
  .search-box input::placeholder { color: var(--text-muted); }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .mobile-menu-btn, .sidebar-backdrop { display: none; }
  .icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--card); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 17px; transition: all 0.15s; position: relative; }
  .icon-btn:hover { background: var(--bg); border-color: var(--text-muted); }
  .notif-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; background: var(--danger); border-radius: 50%; border: 1.5px solid #fff; }
  .user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); cursor: pointer; transition: all 0.15s; }
  .user-chip:hover { background: var(--bg); }
  .user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
  .user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }

  /* Page content */
  .content { padding: 28px; flex: 1; }

  /* Stats grid */
  .stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
  .finance-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; }
  .stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s; }
  .stat-card:hover { box-shadow: var(--shadow); }
  .stat-label { font-size: 11.5px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
  .stat-value { font-size: 24px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; margin-bottom: 6px; }
  .stat-change { font-size: 12px; display: flex; align-items: center; gap: 4px; }
  .stat-change.up { color: var(--success); }
  .stat-change.down { color: var(--danger); }
  .stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
  .stat-icon.blue { background: var(--primary-light); color: var(--primary); }
  .stat-icon.green { background: var(--success-light); color: var(--success); }
  .stat-icon.orange { background: var(--warning-light); color: var(--warning); }
  .stat-icon.red { background: var(--danger-light); color: var(--danger); }

  /* Charts row */
  .charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 24px; }
  .chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
  .chart-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
  .chart-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

  /* Section header */
  .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

  /* Buttons */
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid transparent; transition: all 0.15s; }
  .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
  .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
  .btn-outline { background: var(--card); color: var(--text-secondary); border-color: var(--border); }
  .btn-outline:hover { background: var(--bg); color: var(--text-primary); }
  .btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
  .btn-ghost { background: none; border-color: transparent; color: var(--text-muted); }
  .btn-ghost:hover { background: var(--bg); color: var(--text-secondary); }

  /* Tables */
  .table-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
  .table-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
  table { width: 100%; border-collapse: collapse; }
  th { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 11px 16px; background: var(--bg); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
  td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); font-size: 13.5px; color: var(--text-primary); }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #FAFBFC; }
  .table-actions { display: flex; gap: 4px; }

  /* Badges / Pills */
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; }
  .badge-blue { background: var(--primary-light); color: var(--primary); }
  .badge-green { background: var(--success-light); color: var(--success); }
  .badge-orange { background: var(--warning-light); color: #92400E; }
  .badge-red { background: var(--danger-light); color: var(--danger); }
  .badge-gray { background: #F1F5F9; color: var(--text-secondary); }
  .badge-purple { background: #EDE9FE; color: #6D28D9; }
  .badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  /* Progress bar */
  .progress { background: var(--border); border-radius: 10px; height: 5px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 10px; background: var(--primary); }
  .progress-fill.green { background: var(--success); }
  .progress-fill.orange { background: var(--warning); }
  .progress-fill.red { background: var(--danger); }

  /* Project management workspace */
  .pm-shell { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
  .pm-sidebar { padding: 16px; position: sticky; top: 76px; max-height: calc(100vh - 120px); overflow: auto; }
  .pm-sidebar-head, .pm-detail-head, .pm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .pm-kicker { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
  .pm-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
  .pm-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
  .pm-mini-stat { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--bg); }
  .pm-mini-stat span, .pm-insight span, .pm-health-card span { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
  .pm-mini-stat strong { display: block; font-size: 18px; margin-top: 4px; }
  .pm-mini-stat.is-danger strong, .pm-danger-text { color: var(--danger); }
  .pm-filters { display: grid; gap: 8px; margin-bottom: 14px; }
  .pm-filter-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pm-section-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin: 16px 0 8px; }
  .pm-client-list, .pm-project-list { display: flex; flex-direction: column; gap: 6px; }
  .pm-client-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); color: var(--text-secondary); font-size: 12.5px; }
  .pm-client-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pm-client-link strong { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
  .pm-client-link.active, .pm-client-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .pm-project-card { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 11px 12px; box-shadow: var(--shadow-sm); }
  .pm-project-card.active, .pm-project-card:hover { border-color: var(--primary); background: var(--primary-light); }
  .pm-project-top, .pm-project-meta, .pm-progress-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  .pm-project-top span:first-child { font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
  .pm-project-meta { color: var(--text-muted); font-size: 12px; margin-top: 5px; }
  .pm-project-meta span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pm-progress-row { margin-top: 8px; }
  .pm-progress-row .progress { flex: 1; }
  .pm-progress-row strong { font-size: 11.5px; color: var(--text-secondary); min-width: 34px; text-align: right; }
  .pm-workspace { padding: 18px; min-width: 0; }
  .pm-detail-title { font-size: 21px; font-weight: 750; letter-spacing: -0.03em; }
  .pm-detail-sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--text-muted); font-size: 12.5px; }
  .pm-detail-sub span { padding-right: 8px; border-right: 1px solid var(--border); }
  .pm-detail-sub span:last-child { border-right: 0; }
  .pm-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .pm-health-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
  .pm-health-card, .pm-insight { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
  .pm-health-card .form-control { margin-top: 8px; }
  .pm-progress-control { grid-column: span 1; }
  .pm-progress-control div { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
  .pm-progress-control input { width: 100%; }
  .pm-progress-control strong { min-width: 42px; text-align: right; }
  .pm-insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
  .pm-insight strong { display: block; font-size: 20px; margin-top: 5px; }
  .pm-insight small, .pm-panel-head span { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
  .pm-main-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 14px; margin-top: 14px; }
  .pm-panel { overflow: hidden; }
  .pm-panel-head { padding: 13px 14px; border-bottom: 1px solid var(--border); align-items: center; }
  .pm-panel-body { padding: 14px; }
  .pm-comment-form { display: flex; align-items: flex-start; gap: 8px; padding: 14px; border-bottom: 1px solid var(--border-light); }
  .pm-comment-form textarea { flex: 1; }
  .pm-timeline { padding: 0 14px 10px; max-height: 310px; overflow: auto; }
  .pm-timeline-item { padding: 11px 0; border-bottom: 1px solid var(--border-light); }
  .pm-timeline-item:last-child { border-bottom: 0; }
  .pm-timeline-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
  .pm-doc-list { display: grid; gap: 8px; }
  .pm-doc-item { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--border-light); border-radius: 8px; padding: 9px 10px; }
  .pm-doc-item strong { font-size: 12.5px; }
  .pm-doc-item span { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
  .pm-empty, .pm-empty-state { color: var(--text-muted); font-size: 13px; text-align: center; padding: 18px; }
  .pm-empty-state { min-height: 420px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; }
  .pm-empty-state i { font-size: 34px; color: var(--primary); }
  .pm-empty-state strong { color: var(--text-primary); font-size: 16px; }

  /* Kanban */
  .kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
  .kanban-col { flex-shrink: 0; width: 260px; }
  .kanban-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; border-bottom: none; }
  .kanban-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
  .kanban-count { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--bg); color: var(--text-muted); font-weight: 500; }
  .kanban-body { background: var(--bg); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 8px; min-height: 160px; }
  .kanban-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s; }
  .kanban-card:hover { box-shadow: var(--shadow); }
  .kanban-card:last-child { margin-bottom: 0; }
  .kanban-card-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
  .kanban-card-meta { display: flex; align-items: center; justify-content: space-between; }
  .avatar-stack { display: flex; }
  .avatar-xs { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 9px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; margin-left: -5px; }
  .avatar-xs:first-child { margin-left: 0; }

  /* Tabs */
  .tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 2px; }
  .tab { padding: 10px 16px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s; margin-bottom: -1px; }
  .tab:hover { color: var(--text-primary); }
  .tab.active { color: var(--primary); border-bottom-color: var(--primary); }

  /* Form elements */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-span-2 { grid-column: 1 / -1; }
  .form-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
  .form-control { padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 13.5px; color: var(--text-primary); background: var(--card); outline: none; transition: border-color 0.15s; }
  .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,98,254,0.08); }
  .form-control::placeholder { color: var(--text-muted); }
  select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

  /* Modal */
  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; align-items: center; justify-content: center; }
  .modal-overlay.open { display: flex; }
  .modal { background: var(--card); border-radius: var(--radius-lg); width: 580px; max-width: 95vw; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; box-shadow: var(--shadow-md); }
  .modal-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .modal-title { font-size: 16px; font-weight: 600; }
  .modal-body { padding: 22px; }
  .modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

  /* Timeline */
  .timeline { display: flex; flex-direction: column; gap: 0; }
  .timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
  .timeline-item:last-child { padding-bottom: 0; }
  .timeline-dot-wrap { display: flex; flex-direction: column; align-items: center; }
  .timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 4px; }
  .timeline-line { flex: 1; width: 1px; background: var(--border); margin-top: 4px; }
  .timeline-item:last-child .timeline-line { display: none; }
  .timeline-content { flex: 1; }
  .timeline-time { font-size: 11px; color: var(--text-muted); }
  .timeline-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

  /* Payment steps */
  .payment-steps { display: flex; align-items: center; gap: 0; }
  .payment-step { display: flex; flex-direction: column; align-items: center; flex: 1; }
  .payment-step-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
  .payment-step-circle.done { background: var(--success); color: #fff; }
  .payment-step-circle.current { background: var(--primary); color: #fff; }
  .payment-step-circle.pending { background: var(--bg); border: 2px solid var(--border); color: var(--text-muted); }
  .payment-step-label { font-size: 10.5px; color: var(--text-muted); margin-top: 5px; text-align: center; }
  .payment-step-line { flex: 1; height: 2px; background: var(--border); }
  .payment-step-line.done { background: var(--success); }

  /* Notifications panel */
  .notif-panel { width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); position: absolute; right: 20px; top: 62px; z-index: 20; display: none; }
  .notif-panel.open { display: block; }
  .notif-panel-header { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); display: flex; gap: 12px; cursor: pointer; transition: background 0.1s; }
  .notif-item:hover { background: var(--bg); }
  .notif-item:last-child { border-bottom: none; }
  .notif-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .notif-text { font-size: 12.5px; color: var(--text-secondary); }
  .notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

  /* Calendar */
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .cal-day-head { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 6px 0; text-transform: uppercase; }
  .cal-day { min-height: 80px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
  .cal-day.today { border-color: var(--primary); }
  .cal-day.other-month { background: var(--bg); }
  .cal-day-num { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
  .cal-day.today .cal-day-num { color: var(--primary); }
  .cal-event { font-size: 10.5px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-event.blue { background: var(--primary-light); color: var(--primary); }
  .cal-event.green { background: var(--success-light); color: var(--success); }
  .cal-event.orange { background: var(--warning-light); color: #92400E; }

  /* Report cards */
  .report-shell { display: grid; gap: 18px; }
  .report-hero { align-items: flex-start; gap: 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 0; }
  .report-hero .section-title { font-size: 22px; letter-spacing: -0.03em; margin-top: 2px; }
  .report-filter-bar { display: grid; grid-template-columns: minmax(140px, .8fr) repeat(2, minmax(145px, 1fr)) auto auto; gap: 10px; align-items: end; min-width: min(720px, 100%); }
  .report-filter-field { display: grid; gap: 5px; }
  .report-filter-bar .btn { height: 39px; justify-content: center; white-space: nowrap; }
  .report-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
  .report-shell .report-kpi { margin-bottom: 0; }
  .kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
  .kpi-icon { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
  .kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
  .kpi-icon.green { background: var(--success-light); color: var(--success); }
  .kpi-icon.orange { background: var(--warning-light); color: #92400E; }
  .kpi-icon.purple { background: #F3E8FF; color: #7E22CE; }
  .kpi-val { font-size: 27px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; line-height: 1.12; }
  .kpi-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-bottom: 5px; }
  .kpi-foot { color: var(--text-muted); font-size: 12px; margin-top: 8px; }
  .kpi-trend { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
  .report-primary-charts { margin-bottom: 0; }
  .report-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .report-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .report-data-grid .table-card:last-child { grid-column: 1 / -1; }
  .table-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
  .table-card-head strong { display: block; font-size: 14px; line-height: 1.2; }
  .table-card-head span { display: block; color: var(--text-muted); font-size: 12px; margin-top: 3px; }
  .table-card-head > i { color: var(--primary); background: var(--primary-light); width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .aging-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .aging-grid > div { padding: 16px; border-right: 1px solid var(--border-light); }
  .aging-grid > div:last-child { border-right: 0; }
  .aging-grid span { display: block; color: var(--text-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 7px; }
  .aging-grid strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
  .warning-text { color: var(--warning) !important; }

  /* Donut legend */
  .donut-legend { display: flex; flex-direction: column; gap: 10px; }
  .legend-item { display: flex; align-items: center; gap: 8px; }
  .legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .legend-label { font-size: 12.5px; color: var(--text-secondary); flex: 1; }
  .legend-val { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }

  /* Responsive */
  @media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } .finance-kpi-grid { grid-template-columns: repeat(3, 1fr); } .report-filter-bar { min-width: 0; grid-template-columns: repeat(3, minmax(130px, 1fr)); } }
  @media (max-width: 1180px) {
    .pm-shell { grid-template-columns: 1fr; }
    .pm-sidebar { position: static; max-height: none; }
    .pm-health-grid { grid-template-columns: repeat(3, 1fr); }
    .pm-main-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 900px) {
    .sidebar { width: 56px; }
    .brand-name, .brand-sub, .sidebar-section-label, .sidebar-nav li a span, .sidebar-nav li a .badge { display: none; }
    .sidebar-nav li a { justify-content: center; padding: 10px; }
    .sidebar-nav li a i { font-size: 20px; }
    .pm-health-grid, .pm-insight-grid { grid-template-columns: repeat(2, 1fr); }
    .report-section-grid, .report-data-grid, .report-primary-charts { grid-template-columns: 1fr; }
    .report-data-grid .table-card:last-child { grid-column: auto; }
    .aging-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aging-grid > div:nth-child(2) { border-right: 0; }
    .aging-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
  }
  @media (max-width: 700px) {
    .app { min-height: 100vh; height: auto; overflow: visible; }
    .main { min-width: 0; overflow: visible; }
    .sidebar {
      position: fixed; inset: 0 auto 0 0; z-index: 120; width: min(280px, 86vw);
      transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md);
    }
    .sidebar .brand-name, .sidebar .brand-sub, .sidebar .sidebar-section-label, .sidebar .sidebar-nav li a span, .sidebar .sidebar-nav li a .badge { display: block; }
    .sidebar .sidebar-nav li a { justify-content: flex-start; padding: 9px 10px; }
    .sidebar .sidebar-nav li a .badge { margin-left: auto; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .mobile-menu-btn { display: inline-flex; flex-shrink: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 110; border: 0; background: rgba(15,23,42,.48); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .topbar { padding: 0 14px; }
    .topbar-actions .user-name, .topbar-actions .ti-chevron-down { display: none; }
    .user-chip { padding-right: 5px; }
    .page-breadcrumb { display: none; }
    .stats-grid, .finance-kpi-grid { grid-template-columns: 1fr 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .search-box { display: none; }
    .content { padding: 16px; }
    .section-header { align-items: stretch; flex-direction: column; gap: 10px; }
    .section-header form { width: 100%; flex-wrap: wrap; }
    .section-header .btn { justify-content: center; }
    .report-filter-bar { grid-template-columns: 1fr 1fr; }
    .report-filter-bar .btn { width: 100%; }
    .table-actions { min-width: max-content; }
    .invoice-preview { padding: 18px; }
    .invoice-header, .invoice-meta { grid-template-columns: 1fr; flex-direction: column; gap: 16px; }
    .invoice-tag { text-align: left; }
    .report-kpi { grid-template-columns: 1fr 1fr; }
    .pm-summary-grid, .pm-health-grid, .pm-insight-grid, .pm-filter-row { grid-template-columns: 1fr; }
    .pm-detail-head, .pm-comment-form { flex-direction: column; }
    .pm-actions { justify-content: flex-start; }
    .pm-comment-form .btn { width: 100%; justify-content: center; }
  }
  @media (max-width: 480px) {
    .stats-grid, .report-kpi, .finance-kpi-grid { grid-template-columns: 1fr; }
    .report-filter-bar, .aging-grid { grid-template-columns: 1fr; }
    .aging-grid > div { border-right: 0; border-bottom: 1px solid var(--border-light); }
    .aging-grid > div:last-child { border-bottom: 0; }
    .stat-card, .chart-card, .workspace-section { padding: 14px; }
    .modal { max-width: calc(100vw - 20px); }
    .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
  }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 7px; height: 7px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
  * { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }

  /* Active page management */
  .page { display: none; }
  .page.active { display: block; }

  /* Invoice template */
  .invoice-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
  .invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
  .invoice-company { font-size: 20px; font-weight: 700; color: var(--primary); }
  .invoice-tag { font-size: 28px; font-weight: 700; color: var(--text-primary); text-align: right; }
  .invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
  .invoice-section-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
  .invoice-table th { background: var(--primary); color: #fff; }
  .invoice-totals { margin-top: 16px; display: flex; justify-content: flex-end; }
  .invoice-totals-inner { width: 220px; }
  .inv-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
  .inv-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 15px; }

  /* Premium corporate invoice */
  .corporate-invoice { background: #fff; border: 1px solid #E5E7EB; border-radius: 14px; padding: 34px; margin-bottom: 24px; box-shadow: var(--shadow-sm); color: #111827; }
  .corp-invoice-header { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
  .corp-logo-image { max-width: 150px; max-height: 72px; width: auto; height: auto; object-fit: contain; display: block; margin-bottom: 12px; }
  .corp-company { font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
  .corp-muted { color: #6B7280; font-size: 12px; line-height: 1.6; margin-top: 4px; }
  .corp-document-meta h2 { font-size: 30px; line-height: 1; text-align: right; letter-spacing: -.04em; margin-bottom: 18px; }
  .corp-document-meta dl, .corp-payment-card dl { display: grid; gap: 0; }
  .corp-document-meta dl > div, .corp-payment-card dl > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #E5E7EB; padding: 6px 0; }
  .corp-document-meta dt, .corp-payment-card dt { color: #6B7280; font-size: 12px; }
  .corp-document-meta dd, .corp-payment-card dd { margin: 0; font-size: 12px; font-weight: 650; text-align: right; }
  .corp-divider { border-top: 2px solid #111827; margin: 24px 0 18px; }
  .corp-info-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #E5E7EB; margin-bottom: 22px; }
  .corp-info-grid section { padding: 17px 18px; }
  .corp-info-grid section + section { border-left: 1px solid #E5E7EB; }
  .corp-label { color: #6B7280; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
  .corp-info-grid h3 { font-size: 15px; margin: 6px 0 4px; }
  .corp-info-grid p, .corp-note p, .corp-footer-grid p { color: #4B5563; font-size: 12px; line-height: 1.65; margin: 0; }
  .corp-service-wrap { margin-bottom: 20px; }
  .corp-service-table { min-width: 760px; }
  .corp-service-table th { background: #fff; color: #6B7280; border-top: 1px solid #111827; border-bottom: 1px solid #D1D5DB; padding: 10px 8px; }
  .corp-service-table td { padding: 13px 8px; }
  .corp-service-table th:nth-child(n+3), .corp-service-table td:nth-child(n+3) { text-align: right; }
  .corp-service-table tbody tr:hover td { background: #F9FAFB; }
  .corp-service-table small { display: block; color: #6B7280; margin-top: 3px; line-height: 1.45; }
  .corp-summary-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 42px; align-items: start; }
  .corp-words { border-left: 3px solid #2563EB; background: #F9FAFB; padding: 11px 13px; }
  .corp-words span { display: block; color: #6B7280; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .corp-words strong { display: block; font-size: 12px; margin-top: 5px; }
  .corp-note { margin-top: 18px; }
  .corp-note p { margin-top: 6px; }
  .corp-totals { display: grid; }
  .corp-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 12.5px; }
  .corp-totals span { color: #6B7280; }
  .corp-grand { border-top: 1px solid #D1D5DB; margin-top: 4px; padding-top: 10px !important; font-size: 14px !important; }
  .corp-grand span { color: #111827; font-weight: 700; }
  .corp-danger { color: #DC2626; }
  .corp-balance { background: #111827; color: #fff; padding: 12px !important; margin-top: 8px; font-size: 15px !important; }
  .corp-balance span { color: #fff; font-weight: 700; }
  .corp-payment-card { display: grid; grid-template-columns: 1fr auto; gap: 28px; border: 1px solid #E5E7EB; padding: 18px; margin-top: 24px; }
  .corp-payment-card dl { margin-top: 8px; max-width: 520px; }
  .corp-qr { display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .corp-qr img { width: 96px; height: 96px; }
  .corp-qr span { color: #6B7280; font-size: 10px; margin-top: 5px; }
  .corp-footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-top: 24px; }
  .corp-footer-grid p { margin-top: 7px; white-space: normal; }
  .corp-signature { text-align: right; color: #6B7280; font-size: 11px; }
  .corp-signature div { height: 46px; }
  .corp-signature img { display: block; max-width: 150px; max-height: 54px; object-fit: contain; margin: 8px 0 6px auto; }
  .corp-signature strong { display: inline-block; border-top: 1px solid #9CA3AF; padding-top: 6px; color: #4B5563; font-size: 11px; }
  .corp-generated { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #D1D5DB; margin-top: 24px; padding-top: 10px; color: #6B7280; font-size: 10px; }

  /* Search dropdown */
  .search-box { position: relative; }
  .search-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md); max-height: 320px; overflow-y: auto; z-index: 50; }
  .search-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
  .search-item:hover { background: var(--bg); }
  .search-item strong { display: block; color: var(--text-primary); }
  .search-item small { color: var(--text-muted); }
  .search-type { font-size: 10px; text-transform: uppercase; color: var(--primary); font-weight: 600; }
  .search-empty { padding: 14px; color: var(--text-muted); font-size: 13px; text-align: center; }

  /* Toast */
  .toast { position: fixed; bottom: 24px; right: 24px; background: var(--secondary); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-md); z-index: 200; }
  .toast-error { background: var(--danger); }

  /* Client-centric Project Page */
  .client-project-page { display: grid; grid-template-columns: minmax(300px, 25%) minmax(0, 75%); gap: 18px; align-items: start; }
  .client-rail { position: sticky; top: 74px; height: calc(100vh - 104px); overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 16px; }
  .client-rail-head, .section-toolbar, .client-hero, .client-card-top, .file-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
  .page-kicker { color: var(--text-muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
  .client-rail h2, .workspace-section h2 { font-size: 18px; line-height: 1.2; margin-top: 3px; letter-spacing: -0.02em; }
  .client-search-panel { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 16px 0; }
  .rail-label { color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 16px 0 8px; }
  .recent-client-row { display: flex; gap: 8px; }
  .recent-client-row a { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--text-secondary); font-weight: 700; }
  .recent-client-row a.active, .recent-client-row a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .client-card-list { display: grid; gap: 8px; }
  .client-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
  .client-card.active, .client-card:hover { border-color: var(--primary); background: #FBFDFF; box-shadow: var(--shadow); }
  .client-card strong { display: block; font-size: 14px; color: var(--text-primary); }
  .client-card span { color: var(--text-muted); font-size: 12px; }
  .client-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; }
  .client-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .client-workspace { display: grid; gap: 16px; min-width: 0; }
  .client-hero, .workspace-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 18px; }
  .client-hero h1 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; }
  .client-company { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
  .client-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 14px; color: var(--text-secondary); font-size: 13px; }
  .client-contact-grid span { display: flex; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .client-contact-grid i { color: var(--text-muted); margin-top: 2px; }
  .client-actions, .project-card-actions, .file-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .business-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .summary-card, .payment-summary-grid > div { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 14px; }
  .summary-card span, .payment-summary-grid span, .project-info-grid span, .project-finance-grid span { display: block; color: var(--text-muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; }
  .summary-card strong { display: block; font-size: 18px; margin-top: 6px; }
  .success-text { color: var(--success) !important; }
  .danger-text { color: var(--danger) !important; }
  .section-toolbar { align-items: center; margin-bottom: 14px; }
  .section-toolbar p { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
  .section-toolbar.compact { margin-bottom: 12px; }
  .project-filter-bar { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(6, minmax(115px, 1fr)) auto; gap: 8px; margin-bottom: 14px; }
  .project-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .client-project-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); padding: 15px; }
  .project-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
  .project-card-head h3 { font-size: 16px; letter-spacing: -0.02em; line-height: 1.25; }
  .project-card-head span { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
  .project-workflow { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 14px 0; }
  .project-workflow span { height: 5px; border-radius: 999px; background: var(--border); }
  .project-workflow span.active { background: var(--primary); }
  .project-info-grid, .project-finance-grid, .payment-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .project-info-grid strong, .project-finance-grid strong, .payment-summary-grid strong { display: block; font-size: 13px; margin-top: 3px; color: var(--text-primary); }
  .project-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
  .project-progress .progress { flex: 1; }
  .project-progress strong { font-size: 12px; min-width: 36px; text-align: right; }
  .project-finance-grid { border-top: 1px solid var(--border-light); padding-top: 12px; margin-top: 12px; }
  .project-card-actions { border-top: 1px solid var(--border-light); margin-top: 13px; padding-top: 12px; }
  .workspace-two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); gap: 16px; align-items: start; }
  .payment-summary-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
  .activity-list { display: grid; gap: 10px; max-height: 420px; overflow: auto; }
  .activity-item { display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; }
  .activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
  .activity-item strong { display: block; font-size: 13px; }
  .activity-item small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
  .file-upload-strip { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) auto; gap: 8px; margin-bottom: 14px; }
  .file-list, .note-history { display: grid; gap: 8px; }
  .file-row { border: 1px solid var(--border-light); border-radius: 12px; padding: 11px 12px; align-items: center; }
  .file-row strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
  .file-row span { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
  .notes-form { display: grid; gap: 8px; margin-bottom: 14px; }
  .rich-note { min-height: 128px; line-height: 1.6; }
  .note-item { border: 1px solid var(--border-light); border-radius: 12px; padding: 11px; }
  .note-item strong, .note-item span, .note-item small { display: block; }
  .note-item span { color: var(--text-secondary); margin-top: 5px; }
  .note-item small { color: var(--text-muted); margin-top: 6px; }
  .empty-panel, .empty-cell, .empty-workspace { color: var(--text-muted); text-align: center; font-size: 13px; padding: 18px; }
  .empty-workspace { min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
  .empty-workspace i { color: var(--primary); font-size: 32px; }
  .empty-workspace strong { color: var(--text-primary); font-size: 16px; }

  @media (max-width: 1280px) {
    .client-project-page { grid-template-columns: 330px minmax(0, 1fr); }
    .business-summary-grid { grid-template-columns: repeat(3, 1fr); }
    .project-filter-bar { grid-template-columns: repeat(3, 1fr); }
    .project-card-grid, .workspace-two-col { grid-template-columns: 1fr; }
  }
  @media (max-width: 900px) {
    .client-project-page { grid-template-columns: 1fr; }
    .client-rail { position: static; height: auto; max-height: 520px; }
    .client-hero { flex-direction: column; }
    .client-actions { justify-content: flex-start; }
    .client-contact-grid, .business-summary-grid, .payment-summary-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 700px) {
    .client-contact-grid, .business-summary-grid, .payment-summary-grid, .project-filter-bar, .project-info-grid, .project-finance-grid, .file-upload-strip { grid-template-columns: 1fr; }
    .section-toolbar, .project-card-head, .file-row { flex-direction: column; }
    .client-actions, .project-card-actions, .file-actions { justify-content: flex-start; }
    .corporate-invoice { padding: 20px; }
    .corp-invoice-header, .corp-info-grid, .corp-summary-grid, .corp-payment-card, .corp-footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .corp-document-meta h2 { text-align: left; margin-top: 8px; }
    .corp-info-grid section + section { border-left: 0; border-top: 1px solid #E5E7EB; }
    .corp-generated { flex-direction: column; }
  }
