:root {
    --ink: #17313a;
    --muted: #6d8588;
    --line: #dce9e5;
    --paper: #f7fbf8;
    --white: #ffffff;
    --teal: #0e8275;
    --teal-dark: #09675f;
    --mint: #dff2e9;
    --yellow: #f8c85d;
    --coral: #ee8068;
    --shadow: 0 12px 30px rgba(34, 75, 70, .08);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'DM Sans', sans-serif; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; padding-bottom: 86px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: auto; padding: 0 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: var(--white); background: var(--teal); border-radius: 10px 10px 10px 3px; }
.date-chip { color: var(--muted); font-size: 13px; }
.date-chip a { color: var(--teal); font-weight: 700; }
.main-content { width: min(100% - 40px, 960px); margin: 0 auto; padding: 28px 0 20px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; margin: 0 0 8px; }
h1, h2 { font-family: 'Space Grotesk', sans-serif; margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.05; }
h2 { font-size: 21px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading p { color: var(--muted); margin: 9px 0 0; font-size: 15px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.panel-heading { margin-bottom: 22px; }
.panel-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { margin-bottom: 17px; }
.field label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-field input { width: auto; }
input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fbfefd; color: var(--ink); font: inherit; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 130, 117, .12); }
.input-with-symbol { position: relative; }
.input-with-symbol input { padding-right: 50px; }
.input-symbol { position: absolute; right: 15px; top: 13px; color: var(--muted); font-size: 14px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); padding: 12px; text-align: center; font-size: 14px; font-weight: 600; }
.segmented input:checked + label { border-color: var(--teal); background: var(--mint); color: var(--teal-dark); }
.primary-button { width: 100%; border: 0; border-radius: 10px; cursor: pointer; padding: 14px; color: var(--white); background: var(--teal); font: inherit; font-weight: 700; transition: background .2s, transform .2s; }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.side-note { background: var(--ink); color: var(--white); border-radius: 18px; padding: 23px; min-height: 172px; }
.side-note .eyebrow { color: var(--yellow); }
.side-note strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 33px; margin: 19px 0 5px; }
.side-note span { color: #afc5c3; font-size: 13px; }
.flash { padding: 13px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.flash.success { background: var(--mint); color: var(--teal-dark); }
.flash.error { background: #fde6df; color: #a04432; }
.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; margin-bottom: 22px; }
.summary-card { background: var(--white); border: 1px solid var(--line); border-radius: 15px; padding: 18px; }
.summary-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-value { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 26px; margin-top: 9px; }
.summary-card.fresh { border-top: 4px solid var(--teal); }
.summary-card.dried { border-top: 4px solid var(--coral); }
.summary-card.gpay { border-top: 4px solid #6888d8; }
.summary-card.cash { border-top: 4px solid var(--yellow); }
.summary-card.net { border-top: 4px solid var(--teal-dark); }
.unit { color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; }
.report-section { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.collection-list { margin-top: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.total-badge { background: var(--mint); color: var(--teal-dark); border-radius: 20px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 600px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-align: left; text-transform: uppercase; padding: 11px 8px; border-bottom: 1px solid var(--line); }
td { padding: 13px 8px; border-bottom: 1px solid #edf3f0; font-size: 13px; }
.action-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.action-cell form { margin: 0; }
.edit-link, .delete-link, .cancel-link { font: inherit; font-size: 12px; font-weight: 700; }
.icon-action { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 18px; line-height: 1; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.icon-action:hover { transform: translateY(-1px); }
.edit-link { color: var(--teal); }
.edit-link:hover { background: var(--mint); border-color: var(--teal); }
.delete-link { color: #c45745; padding: 0; }
.delete-link:hover { background: #fde6df; border-color: #e4a99d; }
.cancel-link { display: block; color: var(--muted); text-align: center; margin-top: 14px; }
.type-pill, .payment-pill { display: inline-block; border-radius: 14px; padding: 5px 9px; font-size: 11px; font-weight: 700; }
.type-pill.load { background: var(--mint); color: var(--teal-dark); }
.type-pill.collection { background: #fff0df; color: #a9631b; }
.payment-pill { background: #eef2ff; color: #5268a3; }
.empty-state { color: var(--muted); text-align: center; padding: 28px 10px; font-size: 14px; }
.payment-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payment-breakdown div { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.payment-breakdown span { color: var(--muted); font-size: 13px; }
.payment-breakdown strong { font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.bottom-nav { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: min(11vw, 110px); height: 72px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -5px 20px rgba(34, 75, 70, .06); }
.nav-item { display: flex; min-width: 76px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.nav-icon { display: grid; place-items: center; width: 28px; height: 27px; font-size: 23px; line-height: 1; }
.nav-item.active { color: var(--teal); }
.nav-item.active .nav-icon { background: var(--mint); border-radius: 9px; width: 39px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top right, #dff2e9, transparent 45%), var(--paper); }
.auth-panel { width: min(100%, 410px); background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; }
.auth-panel .brand { margin-bottom: 58px; }
.auth-panel h1 { margin-bottom: 8px; }
.auth-copy { color: var(--muted); margin: 0 0 26px; }
@media (max-width: 700px) {
    .topbar { padding: 0 20px; height: 64px; }
    .date-chip { font-size: 11px; }
    .main-content { width: min(100% - 28px, 560px); padding-top: 24px; }
    .page-heading { display: block; margin-bottom: 21px; }
    .form-layout { grid-template-columns: 1fr; }
    .side-note { min-height: 0; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .bottom-nav { gap: 0; justify-content: space-around; padding: 0 4px; }
    .nav-item { flex: 1 1 0; min-width: 0; }
    .panel, .report-section { padding: 18px; }
    .table-wrap { overflow-x: hidden; }
    table { min-width: 0; table-layout: fixed; }
    th, td { padding: 10px 3px; font-size: 10px; overflow-wrap: anywhere; }
    .collection-management th:nth-child(5), .collection-management td:nth-child(5),
    .expenditure-management th:nth-child(3), .expenditure-management td:nth-child(3) { display: none; }
    .action-cell { gap: 4px; }
    .icon-action { width: 27px; height: 27px; font-size: 16px; }
}
@media (max-width: 390px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    h1 { font-size: 32px; }
}
