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

:root {
  --blue: #0b8db8;
  --blue-dark: #087399;
  --blue-soft: #e9f6fb;
  --nav: #118fb5;
  --ink: #333333;
  --muted: #66737c;
  --line: #cfd8df;
  --line-soft: #e7edf1;
  --bg: #f3f5f6;
  --white: #ffffff;
  --green: #2f9e44;
  --red: #c0392b;
}

* { box-sizing: border-box; }
html { font-family: Inter, Arial, Helvetica, sans-serif; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 13px; }
a { color: #087399; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }

.xero-top { background: var(--nav); color: #fff; border-bottom: 1px solid #087399; }
.top-inner { max-width: 1180px; margin: 0 auto; min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 12px; }
.company-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.top-links { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.top-links a { color: #fff; font-weight: 700; }
.xero-badge { min-width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; font-weight: 800; background: #0a779b; }

.page-title-strip { background: #fff; border-bottom: 1px solid #d9dee2; }
.page-title-inner { max-width: 1180px; margin: 0 auto; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 24px; letter-spacing: -0.03em; color: #4a4a4a; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.container { max-width: 1180px; margin: 0 auto; padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.panel { background: #fff; border: 1px solid var(--line); margin-bottom: 14px; }
.panel-heading { min-height: 30px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; font-weight: 800; }
.panel-heading a { color: #fff; font-size: 11px; font-weight: 700; }
.panel-body { padding: 10px; }
.panel-subhead { font-size: 11px; color: var(--muted); margin-top: 3px; }

.kpi-card { background: #fff; border: 1px solid var(--line); min-height: 78px; }
.kpi-card .label { background: var(--blue); color: #fff; font-weight: 800; padding: 6px 10px; }
.kpi-card .value { padding: 10px 10px 2px; font-size: 20px; line-height: 1; font-weight: 800; color: #333; font-variant-numeric: tabular-nums; }
.kpi-card .hint { padding: 0 10px 8px; font-size: 11px; color: var(--muted); }

.btn { min-height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #b9c5cc; background: linear-gradient(#fff, #edf2f5); color: #166f8c; font-size: 12px; font-weight: 800; cursor: pointer; }
.btn:hover { border-color: #7eaec0; text-decoration: none; }
.btn.primary { background: linear-gradient(#1da7cf, #0b85ad); border-color: #087399; color: #fff; }
.btn.red { background: linear-gradient(#d84b4b, #b63333); border-color: #9e2e2e; color: #fff; }

.search-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 0; }
.search-input { min-height: 30px; flex: 1 1 260px; border: 1px solid #b9c5cc; padding: 0 10px; background: #fff; color: #333; }
.search-input:focus { outline: 2px solid #bfe7f3; border-color: var(--blue); }
.meta { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0 7px; border: 1px solid var(--line); background: #f8fafb; color: #4d5962; font-weight: 700; }

.table-wrap { overflow: auto; border-top: 1px solid var(--line-soft); }
table.accounting { width: 100%; border-collapse: collapse; background: #fff; min-width: 760px; }
table.accounting th { height: 28px; background: #f1f5f8; color: #2f3f4c; font-size: 11px; font-weight: 800; text-align: left; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); padding: 4px 8px; white-space: nowrap; }
table.accounting td { height: 30px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 4px 8px; vertical-align: middle; line-height: 1.25; }
table.accounting tr:hover td { background: #eef8fc; }
table.accounting tfoot td { background: #f7fafc; border-top: 2px solid var(--blue); font-weight: 800; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.strong-link { font-weight: 800; color: #087399; }
.subtext { color: var(--muted); font-size: 11px; margin-top: 1px; }
table.accounting .subtext { display: none; }
.empty { padding: 20px !important; text-align: center; color: var(--muted); }
.negative, .danger { color: var(--red); }
.good { color: var(--green); }
.clickable-row { cursor: pointer; }

.account-row { display: grid; grid-template-columns: 120px 1fr 160px; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.account-row:last-child { border-bottom: 0; }
.account-logo { border: 1px solid #b9c5cc; min-height: 36px; display: grid; place-items: center; font-weight: 800; color: #0b80a7; background: #fafafa; }
.account-name { font-size: 16px; font-weight: 800; color: #087399; }
.account-stat { font-size: 11px; color: var(--muted); margin-top: 6px; }
.account-stat strong { display: block; color: #333; font-size: 18px; margin-top: 2px; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.info-box { border: 1px solid var(--line-soft); background: #fbfcfd; padding: 8px; }
.info-label { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.info-value { margin-top: 3px; font-weight: 700; overflow-wrap: anywhere; }
.recon-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.recon-row:last-child { border-bottom: 0; }

.report-card { background: #fff; border: 1px solid var(--line); padding: 12px; }
.report-card h2 { margin: 0 0 6px; font-size: 16px; color: #333; }
.report-card p { margin: 0 0 10px; color: var(--muted); line-height: 1.45; }

.alert { background: #fff3f3; border: 1px solid #f0b6b6; color: #a12424; padding: 10px 12px; margin-bottom: 14px; font-weight: 700; }

.page-loader { position: fixed; inset: 0; z-index: 999; background: #f3f5f6; padding-top: 66px; transition: opacity .15s ease, visibility .15s ease; }
body.ready .page-loader { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-box { max-width: 1180px; margin: 0 auto; padding: 18px; }
.skeleton-panel { background: #fff; border: 1px solid var(--line); margin-bottom: 14px; padding: 12px; }
.skeleton-line { height: 14px; margin: 10px 0; background: linear-gradient(90deg, #edf2f5 25%, #f8fafb 37%, #edf2f5 63%); background-size: 400% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton-line.wide { width: 90%; } .skeleton-line.mid { width: 58%; } .skeleton-line.short { width: 30%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
body.loading .page-loader { opacity: 1; visibility: visible; pointer-events: auto; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f3f5f6; }
.login-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); }
.login-card h1 { background: var(--blue); color: #fff; font-size: 20px; padding: 12px 14px; }
.login-content { padding: 18px; }
.form-row { margin-bottom: 12px; }
.form-label { display: block; font-weight: 800; margin-bottom: 5px; }
.form-input { width: 100%; min-height: 34px; border: 1px solid #b9c5cc; padding: 0 10px; }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .top-inner, .page-title-inner, .container { padding-left: 12px; padding-right: 12px; }
  .page-title-inner { align-items: flex-start; flex-direction: column; }
  .top-links { gap: 8px; }
  .account-row { grid-template-columns: 80px 1fr; }
  .account-row .btn { grid-column: 2; width: fit-content; }
}

.date-filter { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.date-filter label { display: grid; gap: 4px; min-width: 160px; font-weight: 800; color: var(--muted); }
.date-filter label span { font-size: 11px; text-transform: uppercase; }
.date-filter .form-input { min-height: 30px; }
