/* PayChaser AI — brand: navy #13284A, lime #B8E54A, bg #F5F7FA, text #182230 */
:root {
  --navy: #13284a;
  --navy-2: #1d3a66;
  --lime: #b8e54a;
  --lime-dark: #8fbf2e;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #182230;
  --muted: #5b6b7f;
  --border: #dde4ec;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
  --ok-bg: #e7f6d5;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(19, 40, 74, 0.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--navy); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }
main { min-height: 70vh; padding: 28px 0 56px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

/* Header */
#site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo .dot { color: var(--lime); }
nav.main-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
nav.main-nav a { color: #dbe4f0; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 0.95rem; }
nav.main-nav a:hover { background: var(--navy-2); color: #fff; }
nav.main-nav a.active { background: var(--lime); color: var(--navy); font-weight: 700; }

/* Buttons */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; text-align: center; }
.btn:hover { background: var(--navy-2); }
.btn-lime { background: var(--lime); color: var(--navy); }
.btn-lime:hover { background: var(--lime-dark); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: #eef2f7; }
.btn-light { background: #fff; color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; word-break: break-word; }
.stat-card .stat-label { color: var(--muted); font-size: 0.9rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }

/* Hero / landing */
.hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 48px 36px; margin-bottom: 28px; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero h1 .hl { color: var(--lime); }
.hero p.lead { font-size: 1.15rem; color: #dbe4f0; max-width: 640px; margin: 0 0 24px; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--navy); }
.step-num { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--navy); font-weight: 800; align-items: center; justify-content: center; margin-bottom: 10px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); border-color: var(--lime-dark); }
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Status chips */
.chip { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.chip-draft { background: #e4e9f0; color: var(--navy); }
.chip-outstanding { background: #dbeafe; color: #1d4ed8; }
.chip-overdue { background: var(--danger-bg); color: var(--danger); }
.chip-paid { background: var(--ok-bg); color: #3c6e12; }
.chip-cancelled { background: #ececec; color: #666; }
.chip-scheduled { background: #dbeafe; color: #1d4ed8; }
.chip-sent { background: var(--ok-bg); color: #3c6e12; }
.chip-skipped { background: #ececec; color: #666; }
.chip-approved { background: var(--warn-bg); color: var(--warn-text); }

/* Notices */
.notice { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 0.95rem; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid #ecd27a; }
.notice-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f2b8b5; }
.notice-ok { background: var(--ok-bg); color: #2f5410; border: 1px solid #bfe08f; }
.notice-info { background: #eaf1fb; color: var(--navy); border: 1px solid #c3d4ee; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.25s ease; max-width: 92vw; text-align: center; z-index: 100; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type="search"] { max-width: 300px; }
.filter-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 0.88rem; }
.filter-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.line-item-row { display: grid; grid-template-columns: 1fr 76px 110px 110px 40px; gap: 8px; margin-bottom: 8px; align-items: end; }
.line-item-row .li-total { padding: 10px 4px; font-weight: 600; white-space: nowrap; }
.totals { max-width: 340px; margin-left: auto; }
.totals .t-row { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .t-grand { border-top: 2px solid var(--navy); font-weight: 800; font-size: 1.1rem; color: var(--navy); }

footer#site-footer { border-top: 1px solid var(--border); padding: 20px 0; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }

#print-area { display: none; }

/* Responsive */
@media (max-width: 820px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 34px 22px; }
  .hero h1 { font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2, .form-row { grid-template-columns: 1fr; }
  .line-item-row { grid-template-columns: 1fr 60px 88px 40px; }
  .line-item-row .li-total { display: none; }
  main { padding-top: 18px; }
}

/* Print: show only the printable invoice */
@media print {
  #site-header, main, #site-footer, #toast { display: none !important; }
  body { background: #fff; }
  #print-area { display: block !important; color: #182230; font-size: 12pt; padding: 24px; }
  #print-area h1 { color: #13284a; font-size: 20pt; margin: 0 0 4px; }
  #print-area table { min-width: 0; }
  #print-area .p-head { display: flex; justify-content: space-between; border-bottom: 3px solid #b8e54a; padding-bottom: 12px; margin-bottom: 16px; }
  #print-area .p-totals { max-width: 300px; margin-left: auto; }
}
