:root { color-scheme: light; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; color: #18211d; background: #f6f8f6; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-panel { width: min(100%, 420px); background: #fff; border: 1px solid #dfe7e1; border-radius: 22px; padding: 40px; box-shadow: 0 20px 40px -24px rgba(31, 73, 51, .25); }
.eyebrow { color: #19734c; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .78rem; }
h1 { margin: 8px 0 10px; letter-spacing: -.04em; }
.muted { color: #66716b; line-height: 1.5; }
.stack-form { display: grid; gap: 10px; margin-top: 24px; }
label { font-weight: 600; font-size: .9rem; }
input { min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid #cbd7cf; border-radius: 10px; font: inherit; }
input:focus { outline: 3px solid rgba(25, 115, 76, .18); border-color: #19734c; }
button { min-height: 44px; border: 0; border-radius: 10px; background: #19734c; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:active { transform: translateY(1px); }
.form-error { margin-top: 18px; padding: 12px; border-radius: 10px; background: #fff0ed; color: #a33b2a; }

select { min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid #cbd7cf; border-radius: 10px; background: #fff; font: inherit; }
a { color: #19734c; }
.portal-shell { width: min(100% - 32px, 1120px); margin: 0 auto; padding: 24px 0 48px; }
.portal-header { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }
.portal-header h1 { margin-bottom: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions form { margin: 0; }
.button-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: 0 14px; border: 1px solid #cbd7cf; border-radius: 10px; background: #fff; color: #18211d; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
.button-secondary:hover { border-color: #19734c; color: #19734c; }
.metric-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
.metric-card { display: grid; gap: 4px; padding: 18px; border: 1px solid #dfe7e1; border-radius: 18px; background: #fff; box-shadow: 0 12px 26px -24px rgba(31, 73, 51, .5); }
.metric-card strong { font-size: 2rem; letter-spacing: -.05em; }
.metric-label { font-weight: 700; }
.metric-caption, .location-zone, .table-hint { color: #66716b; font-size: .83rem; }
.metric-entry { border-top: 4px solid #19734c; }
.metric-exit { border-top: 4px solid #d66a4a; }
.metric-balance { border-top: 4px solid #3c6252; }
.empty-state, .report-location { margin-top: 18px; padding: 20px; border: 1px solid #dfe7e1; border-radius: 18px; background: #fff; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-heading h2, .section-heading h3 { margin: 4px 0 0; }
.section-heading .eyebrow { margin: 0; }
.location-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 18px 0; color: #66716b; }
.location-summary b { color: #18211d; }
.report-chart { display: grid; grid-template-columns: repeat(7, minmax(34px, 1fr)); gap: 6px; align-items: end; min-height: 180px; padding: 14px 8px 8px; border: 1px solid #edf1ed; border-radius: 14px; background: linear-gradient(to top, #f2f6f3 1px, transparent 1px) 0 100% / 100% 25% repeat-y; }
.report-day { display: grid; grid-template-rows: 1fr auto auto; align-items: end; gap: 5px; min-width: 0; height: 150px; text-align: center; }
.report-bars { display: flex; align-items: end; justify-content: center; gap: 3px; height: 100%; }
.report-bar { display: block; width: min(12px, 35%); min-height: 2px; border-radius: 5px 5px 2px 2px; }
.report-bar-entry { background: #19734c; }
.report-bar-exit { background: #d66a4a; }
.report-day strong { font-size: .78rem; }
.report-day small { color: #66716b; font-size: .68rem; white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; margin: 10px 0 18px; color: #66716b; font-size: .8rem; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.legend-entry { background: #19734c; }
.legend-exit { background: #d66a4a; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf1ed; text-align: left; white-space: nowrap; }
thead th { color: #66716b; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.report-table th small { display: block; margin-top: 3px; color: #89938d; font-weight: 400; font-size: .72rem; }
.source-list { margin-top: 24px; }
.compact-heading { margin-bottom: 8px; }
.report-note { margin: 18px 2px 0; color: #66716b; font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-shell { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 24px 0 48px; }
.page-header { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.page-header h1 { margin-bottom: 4px; }
.page-header form { margin: 0; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.admin-card { padding: 18px; border: 1px solid #dfe7e1; border-radius: 18px; background: #fff; box-shadow: 0 12px 26px -24px rgba(31, 73, 51, .5); }
.admin-card h2 { margin: 4px 0 0; font-size: 1.1rem; }
.admin-card .stack-form { margin-top: 18px; }
.token-panel { display: grid; gap: 12px; margin: 16px 0; padding: 16px; border: 1px solid #cfe5d7; border-radius: 16px; background: #eef8f1; }
.token-panel h2 { margin: 4px 0; }
.token-value { display: block; overflow-wrap: anywhere; padding: 12px; border-radius: 10px; background: #fff; color: #17623f; font-size: .84rem; line-height: 1.5; }
.table-card { margin-top: 16px; }
.inline-form { display: inline-flex; gap: 6px; margin: 0; }
.inline-form .button-secondary, .inline-form button { min-height: 38px; padding-inline: 10px; font-size: .82rem; }
.empty-cell { color: #66716b; text-align: center; }
.table-hint { display: block; margin-top: 4px; }
.filter-card, .chart-card, .table-card { padding: 18px; border: 1px solid #dfe7e1; border-radius: 18px; background: #fff; box-shadow: 0 12px 26px -24px rgba(31, 73, 51, .5); }
.filter-card { margin-bottom: 24px; }
.filter-form { display: grid; gap: 12px; }
.filter-field { display: grid; gap: 7px; }
.filter-form button { margin-top: 4px; }
.selected-location-heading { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 18px; }
.selected-location-heading h2 { margin: 0; }
.date-range, .chart-meta { color: #66716b; font-size: .84rem; }
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.chart-card h2 { margin: 4px 0 0; font-size: 1.1rem; }
.bar-chart { display: grid; grid-template-columns: repeat(7, minmax(30px, 1fr)); gap: 6px; align-items: end; min-height: 188px; margin-top: 20px; padding: 0 2px 8px; border-bottom: 1px solid #dfe7e1; background: linear-gradient(to top, #edf2ee 1px, transparent 1px) 0 0 / 100% 25% repeat-y; }
.bar-day { display: grid; grid-template-rows: 1fr auto auto; align-items: end; gap: 5px; min-width: 0; height: 160px; text-align: center; }
.bar-columns { display: flex; align-items: end; justify-content: center; gap: 3px; height: 100%; }
.bar { display: block; width: min(14px, 36%); min-height: 2px; border-radius: 5px 5px 2px 2px; }
.bar-entry, .hour-entry { background: #19734c; }
.bar-exit, .hour-exit { background: #d66a4a; }
.bar-day strong { font-size: .78rem; }
.bar-day small { color: #66716b; font-size: .7rem; }
.hour-chart { display: flex; align-items: end; gap: 2px; height: 188px; margin-top: 20px; padding: 0 2px 8px; border-bottom: 1px solid #dfe7e1; background: linear-gradient(to top, #edf2ee 1px, transparent 1px) 0 0 / 100% 25% repeat-y; }
.hour-column { display: flex; align-items: end; justify-content: center; gap: 1px; width: 100%; height: 160px; }
.hour-bar { display: block; width: 45%; min-height: 1px; border-radius: 3px 3px 1px 1px; }
.hour-labels { display: flex; justify-content: space-between; margin-top: 6px; color: #89938d; font-size: .68rem; }
.chart-legend { margin-top: 14px; }
.table-card { margin-top: 16px; }
.table-card .section-heading { margin-bottom: 8px; }
.table-card table { min-width: 560px; }
.direction-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.direction-in { background: #e4f3e9; color: #17623f; }
.direction-out { background: #fff0ed; color: #a33b2a; }
.notice-info { margin: 16px 0; padding: 14px 16px; border: 1px solid #cfe5d7; border-radius: 14px; background: #eef8f1; color: #17623f; line-height: 1.5; }
.notice { margin: 16px 0; padding: 14px 16px; border-radius: 14px; line-height: 1.5; }
.notice-success { border: 1px solid #cfe5d7; background: #eef8f1; color: #17623f; }
.notice-error { border: 1px solid #f0c7be; background: #fff0ed; color: #a33b2a; }

@media (min-width: 720px) {
  .portal-shell { padding-top: 38px; }
  .portal-header { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .report-location { padding: 26px; }
  .filter-form { grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(150px, 1fr)) auto; align-items: end; }
  .filter-form button { margin-top: 0; }
  .selected-location-heading { flex-direction: row; align-items: end; justify-content: space-between; }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-card, .chart-card, .table-card { padding: 22px; }
  .admin-shell { padding-top: 38px; }
  .page-header { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-card { padding: 22px; }
}

@media print {
  body { background: #fff; }
  .report-shell { width: 100%; padding: 0; }
  .report-header .page-actions, .report-note { display: none; }
  .report-location, .metric-card { box-shadow: none; break-inside: avoid; }
  .report-location { margin-top: 16px; }
}
