:root {
  --pay-bg: #f5f3ef;
  --pay-white: #fff;
  --pay-fg: #141210;
  --pay-muted: #7a7671;
  --pay-border: #e0dcd5;
  --pay-red: #c0281e;
  --pay-green: #2a7a3a;
  --pay-amber: #9a6a10;
  --pay-blue: #2a4a9a;
  --pay-sidebar-bg: #141210;
  --pay-sidebar-fg: #e0dcd5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: var(--pay-bg); color: var(--pay-fg); font-size: 14px; }

/* Layout */
.pay-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* Sidebar */
.pay-sidebar { background: var(--pay-sidebar-bg); color: var(--pay-sidebar-fg); padding: 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; width: 220px; overflow-y: auto; }
.pay-logo { font-size: 18px; font-weight: 800; color: #fff; padding: 24px 20px 16px; letter-spacing: -0.02em; }
.pay-logo span { color: var(--pay-red); }
.pay-org-select { width: 100%; background: #2a2622; color: #fff; border: 1px solid #3a3632; border-radius: 8px; padding: 8px 10px; font-family: 'Poppins', sans-serif; font-size: 12px; margin: 0 12px 16px; width: calc(100% - 24px); }
.pay-nav { flex: 1; padding: 0 10px; }
.pay-nav-section { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5a5652; padding: 16px 10px 6px; }
.pay-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--pay-sidebar-fg); text-decoration: none; font-size: 13px; font-weight: 500; transition: all .12s; margin-bottom: 2px; }
.pay-nav-item:hover, .pay-nav-item.active { background: rgba(255,255,255,.08); color: #fff; }
.pay-nav-item i { width: 16px; text-align: center; font-size: 13px; }
.pay-sidebar-footer { padding: 16px 20px; font-size: 11px; color: #5a5652; display: flex; justify-content: space-between; border-top: 1px solid #2a2622; }
.pay-sidebar-footer a { color: var(--pay-red); text-decoration: none; }

/* Main */
.pay-main { margin-left: 220px; min-height: 100vh; }
.pay-topbar { padding: 24px 32px 0; }
.pay-page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.pay-content { padding: 24px 32px 48px; }

/* Stats */
.pay-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.pay-stat-card { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.pay-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.pay-stat-icon.green { background: #eaf4ec; color: var(--pay-green); }
.pay-stat-icon.red { background: #fdecea; color: var(--pay-red); }
.pay-stat-icon.amber { background: #fef6e4; color: var(--pay-amber); }
.pay-stat-icon.blue { background: #eaf0fb; color: var(--pay-blue); }
.pay-stat-icon.gray { background: #f0eeea; color: var(--pay-muted); }
.pay-stat-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.pay-stat-label { font-size: 11px; color: var(--pay-muted); margin-top: 2px; }

/* Buttons */
.pay-btn { display: inline-flex; align-items: center; gap: 6px; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--pay-border); background: var(--pay-white); color: var(--pay-fg); text-decoration: none; cursor: pointer; transition: all .12s; }
.pay-btn:hover { border-color: #aaa; }
.pay-btn-primary { background: var(--pay-red); color: #fff; border-color: var(--pay-red); }
.pay-btn-primary:hover { background: #a02318; }
.pay-btn-secondary { background: var(--pay-white); }
.pay-btn-sm { font-size: 11px; padding: 5px 10px; }
.pay-btn-full { width: 100%; justify-content: center; }

/* Table */
.pay-table-wrap { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 12px; overflow: hidden; }
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--pay-muted); padding: 12px 16px; border-bottom: 1px solid var(--pay-border); text-align: left; background: #faf9f7; }
.pay-table td { padding: 12px 16px; border-bottom: 1px solid var(--pay-border); font-size: 13px; }
.pay-table tr:last-child td { border-bottom: none; }
.pay-table tr:hover td { background: #faf9f7; }

/* Badges */
.pay-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .06em; }
.pay-badge-draft { background: #f0eeea; color: var(--pay-muted); }
.pay-badge-sent { background: #eaf0fb; color: var(--pay-blue); }
.pay-badge-paid { background: #eaf4ec; color: var(--pay-green); }
.pay-badge-overdue { background: #fdecea; color: var(--pay-red); }
.pay-badge-cancelled { background: #f0eeea; color: var(--pay-muted); }

/* Forms */
.pay-form { display: flex; flex-direction: column; gap: 14px; }
.pay-form-card { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 12px; padding: 24px; max-width: 600px; }
.pay-field { display: flex; flex-direction: column; gap: 5px; }
.pay-field label { font-size: 12px; font-weight: 600; color: var(--pay-muted); }
.pay-field input, .pay-field select, .pay-field textarea { font-family: 'Poppins', sans-serif; font-size: 13px; padding: 9px 12px; border: 1px solid var(--pay-border); border-radius: 8px; background: #faf9f7; color: var(--pay-fg); outline: none; transition: border-color .12s; }
.pay-field input:focus, .pay-field select:focus, .pay-field textarea:focus { border-color: var(--pay-red); }
.pay-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Section */
.pay-section { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.pay-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.pay-section-header h2 { font-size: 18px; font-weight: 700; }

/* Invoice */
.pay-invoice-view { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 12px; padding: 40px; max-width: 800px; }
.pay-invoice-header { display: flex; justify-content: space-between; margin-bottom: 32px; }
.pay-invoice-customer { margin-bottom: 24px; font-size: 13px; line-height: 1.6; }
.pay-invoice-totals { border-top: 1px solid var(--pay-border); padding-top: 16px; max-width: 300px; margin-left: auto; }
.pay-invoice-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.pay-invoice-total-final { font-size: 16px; font-weight: 800; border-top: 2px solid var(--pay-fg); margin-top: 6px; padding-top: 10px; }
.pay-invoice-notes { margin-top: 24px; font-size: 13px; color: var(--pay-muted); }
.pay-invoice-item { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.pay-invoice-item input { font-family: 'Poppins', sans-serif; font-size: 13px; padding: 8px 10px; border: 1px solid var(--pay-border); border-radius: 8px; }

/* Onboarding */
.pay-onboarding { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.pay-onboarding-card { background: var(--pay-white); border: 1px solid var(--pay-border); border-radius: 16px; padding: 40px; max-width: 480px; width: 100%; }
.pay-onboarding-card h1 { font-size: 24px; font-weight: 800; margin: 16px 0 8px; }
.pay-onboarding-card p { color: var(--pay-muted); margin-bottom: 24px; }

/* Responsive */
@media (max-width: 1100px) { .pay-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .pay-layout { grid-template-columns: 1fr; }
  .pay-sidebar { display: none; }
  .pay-main { margin-left: 0; }
  .pay-stats { grid-template-columns: 1fr 1fr; }
  .pay-content { padding: 16px; }
}
