:root {
    --orange: #f47735;
    --orange-dk: #d9611f;
    --bg: #fbf1e8;
    --surface: #ffffff;
    --ink: #2a2520;
    --muted: #8a7c70;
    --line: #ecdfd2;
    --link: #bf5a14;
    --pos: #1c7d54;
    --neg: #c0392b;
    --card-shadow: 0 1px 2px rgba(74,48,20,.05), 0 2px 6px rgba(74,48,20,.06);
    --radius: 12px;
}
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; margin: 0; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px 64px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }

/* Header */
header { background: var(--surface); border-top: 3px solid var(--orange); border-bottom: 1px solid var(--line); padding: 13px 24px; }
.header-inner { max-width: 1060px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; color: var(--ink); font-size: 15px; letter-spacing: -.01em; }
.brand img { height: 36px; }
.user { color: var(--muted); font-size: 13.5px; }

/* Page heading */
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 32px 0 20px; }
.page-head h1 { font-size: 23px; font-weight: 600; margin: 0; letter-spacing: -.02em; }
.fy-badge { font-size: 12px; font-weight: 600; color: #9c4710; background: #fbe2cf; padding: 3px 11px; border-radius: 20px; }
.back { font-size: 14px; margin: 26px 0 4px; }
.detail-title { font-size: 22px; font-weight: 600; margin: 6px 0 22px; letter-spacing: -.02em; }
.detail-title .num { font-family: ui-monospace, Menlo, monospace; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 16px 18px; }
.tile .label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 7px; }
.tile .value { font-size: 25px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .value.pos { color: var(--pos); }
.tile .value.neg { color: var(--neg); }

/* Toolbar (FY + search) */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.toolbar select, .toolbar input[type=search] { font: inherit; font-size: 14px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.toolbar input[type=search] { min-width: 240px; }
.toolbar select:focus, .toolbar input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,119,53,.22); }
.btn { font: inherit; font-size: 14px; padding: 7px 18px; border: none; background: var(--orange); color: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--orange-dk); }

/* Card wrapping a table */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.card-head .meta { font-size: 12.5px; color: var(--muted); }

/* Excel-style tables */
table { border-collapse: collapse; width: 100%; border: 2px solid #333; }
th, td { text-align: left; padding: 5px 11px; border: 1px solid #b0b0b0; vertical-align: top; }
th { font-weight: 600; background: #f0f0f0; }
thead th { background: linear-gradient(#8c8c8c, #6e6e6e); color: #fff; border-color: #5a5a5a; font-size: 13px; }
tbody tr:nth-child(even) { background: #f2f3f5; }
.num { font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.amount { text-align: right; font-variant-numeric: tabular-nums; }
.negative { color: var(--neg); }
.total td, .total th { font-weight: 600; background: #e9eaec; }
.info-table { width: auto; max-width: 600px; margin-bottom: 24px; }
.info-table th { width: 180px; }

/* Pager */
.pager { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 14px; }
.pager .disabled { color: #c2b6a9; }
.pager .page-of { color: var(--muted); }

/* Text helpers */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); margin-top: 24px; }
.spaced { margin-top: 32px; }

/* Login hero */
body.login { margin: 0; padding: 0; background: var(--bg); }
.login-hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: url('/static/img/landscape.jpg') center/cover no-repeat; }
.login-card { background: rgba(255, 255, 255, 0.96); padding: 40px; border-radius: var(--radius); text-align: center; max-width: 360px; box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28); border-top: 3px solid var(--orange); }
.login-card img { height: 76px; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card .tag { color: var(--muted); margin: 0 0 24px; }
.signin { display: inline-block; padding: 12px 22px; background: var(--orange); color: #fff; border-radius: 8px; font-weight: 600; }
.signin:hover { background: var(--orange-dk); text-decoration: none; }
