@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #F5F7FA;
  color: #101828;
}
.cc-display { font-family: 'Space Grotesk', sans-serif; }

a { text-decoration: none; color: inherit; }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101828;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  width: 340px;
  max-width: 90vw;
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-title { font-size: 18px; font-weight: 700; }
.login-sub { font-size: 12px; color: #667085; letter-spacing: .5px; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #344054; margin-bottom: 14px; }
.field input, .field select {
  padding: 9px 10px; border-radius: 8px; border: 1px solid #D0D5DD; font-size: 14px; font-family: 'Inter', sans-serif;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
}
.btn-primary { background: #101828; color: #fff; width: 100%; }
.btn-accent { background: #0E9F8E; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #E4E7EC; color: #344054; }
.btn-danger { background: transparent; color: #DC2626; border: none; cursor: pointer; }
.error-box { background: #FEF3F2; color: #B42318; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.ok-box { background: #E6F7F5; color: #12805C; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #101828; color: #fff; padding: 24px 16px; flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; padding: 0 8px; }
.sidebar-section-title { font-size: 10px; color: #667085; font-weight: 700; letter-spacing: .5px; padding: 0 4px; margin-bottom: 8px; }
.scope-btn {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: #8A94A6; margin-bottom: 4px;
}
.scope-btn.active { background: rgba(255,255,255,0.08); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #98A2B3; margin-bottom: 4px;
}
.nav-btn.active { background: #1D2939; color: #fff; }
.sidebar-footer { margin-top: 40px; padding: 10px 12px; font-size: 11px; color: #667085; }

.main { flex: 1; padding: 28px 36px; max-width: 1100px; }
.page-title { font-size: 24px; font-weight: 700; }
.page-sub { font-size: 13px; color: #667085; margin-top: 2px; margin-bottom: 22px; }

.stat-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card { background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; padding: 18px; flex: 1; min-width: 160px; }
.stat-label { font-size: 12px; color: #667085; font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 8px; }

.company-cards { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.company-card { flex: 1; min-width: 200px; background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; padding: 16px; }
.company-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.company-badge { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

.panel { background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.panel-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px; margin-bottom: 14px; }

.table-wrap { background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; overflow: hidden; }
.t-head, .t-row { display: flex; align-items: center; padding: 12px 16px; }
.t-head { background: #FAFBFC; border-bottom: 1px solid #E4E7EC; font-size: 11px; font-weight: 700; color: #98A2B3; letter-spacing: .4px; text-transform: uppercase; }
.t-row { border-bottom: 1px solid #F0F2F5; font-size: 13px; }
.t-row:hover { background: #FAFBFC; }
.t-col { flex: 1; }
.t-col-wide { flex: 2; }
.t-col-narrow { flex: 0 0 32px; }
.empty-state { padding: 28px 16px; text-align: center; font-size: 13px; color: #98A2B3; }

.toolbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.filter-row { display: flex; gap: 8px; margin: 16px 0; }
.filter-btn { padding: 6px 14px; border-radius: 20px; font-size: 13px; border: 1px solid #E4E7EC; background: #fff; color: #667085; cursor: pointer; }
.filter-btn.active { background: #101828; color: #fff; border-color: #101828; }

.modal-overlay { position: fixed; inset: 0; background: rgba(16,24,40,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 22px; width: 380px; max-width: 100%; max-height: 88vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; }
.close-x { font-size: 20px; color: #667085; background: none; border: none; cursor: pointer; }

.company-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.company-pick label {
  flex: 1; min-width: 80px; text-align: center; padding: 8px 4px; border-radius: 8px; font-size: 12px;
  font-weight: 600; border: 1px solid #E4E7EC; color: #667085; cursor: pointer;
}
.company-pick input { display: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 0; }
.status-paid { color: #12805C; }
.status-overdue { color: #DC2626; }
.status-soon { color: #B54708; }
.status-pending { color: #667085; }

.due-item { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; }
.due-overdue { background: #FEF3F2; color: #DC2626; font-weight: 600; }
.due-soon { background: #FEF0DA; color: #93450A; font-weight: 600; }

.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; color: #667085; }

.report-wrap { background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; padding: 24px; }
.report-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #101828; padding-bottom: 14px; margin-bottom: 16px; }
.report-logo { max-width: 90px; max-height: 60px; }
.report-logo-fallback { width: 44px; height: 44px; border-radius: 50%; background: #E6F7F5; color: #0E9F8E; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.report-title { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700; }
.report-sub { font-size: 12px; color: #667085; margin-top: 2px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th { text-align: left; font-size: 10px; font-weight: 700; color: #98A2B3; text-transform: uppercase; letter-spacing: .3px; padding: 6px 8px; border-bottom: 1px solid #E4E7EC; }
.report-table td { padding: 7px 8px; border-bottom: 1px solid #F0F2F5; vertical-align: top; }
.report-name { font-weight: 600; color: #101828; }
.report-subline { font-size: 11px; color: #667085; }
.report-empty { text-align: center; color: #98A2B3; padding: 24px; }
.report-totals { margin-top: 18px; padding-top: 14px; border-top: 1px solid #E4E7EC; }
.report-totals-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.report-totals-line { font-size: 12px; color: #344054; }
.report-footer { margin-top: 18px; font-size: 10px; color: #98A2B3; text-align: right; }

@media print {
  .sidebar, .toolbar, .stat-row, .ok-box, .error-box { display: none !important; }
  .main { padding: 0; max-width: 100%; }
  .report-wrap { border: none; padding: 0; }
  body { background: #fff; }
}
