/* ==========================================================================
   Daftari Langu (v13) — daftari la biashara la faragha
   Mobile-first; linatumia rangi/tokens za mfumo (--primary, --surface, --line...)
   ========================================================================== */
.df { --in: #16a34a; --out: #e11d48; --tr: #2563eb; --df-r: 16px; max-width: 1080px; margin: 0 auto; padding: 0 0 24px; }
.df .in, .df-table .in { color: var(--in); }
.df .out, .df-table .out { color: var(--out); }
.df .sp { flex: 1; }
.df .danger { color: var(--danger, #e11d48); }
.df .pad-m { padding: 14px 16px; }
.df .pad-l { padding: 18px 20px; }
.df .card + .card { margin-top: 0; }
.df-card { margin-bottom: 12px; border-radius: var(--df-r); }
@media (max-width: 900px) { .df { padding: 0 12px 24px; } .df-head { padding-top: 10px; } }

/* ---------- Kichwa + tabs ---------- */
.df-head { display: flex; align-items: center; gap: 10px; padding: 14px 2px 10px; }
.df-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text) !important; }
.df-brand img, .df-logo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; }
.df-logo { display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.df-bn { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.df-bn b { font-size: 1.05rem; max-width: 52vw; }
.df-bn small { font-size: .72rem; color: var(--muted); }
.df-bn small i { font-size: .65rem; }
.df-head .ib { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: var(--text); background: var(--surface-hover); }
.df-head .ib.on { background: var(--primary-soft); color: var(--primary); }
.df-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 12px; margin-bottom: 4px; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.df-tabs::-webkit-scrollbar { display: none; }
.df-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; font-size: .84rem; font-weight: 650; color: var(--muted); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; transition: background .15s, color .15s; }
.df-tabs a:hover { color: var(--text); }
.df-tabs a.on { background: var(--text); color: var(--bg, #fff); border-color: transparent; }
.df-toolbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; min-height: 36px; }
.df-h1 { font-size: 1.25rem; font-weight: 800; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.df-sec { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 12px; }
.df-sec.danger { color: var(--danger); }

/* ---------- Hero: pesa zote ---------- */
.df-hero { border-radius: 22px; padding: 18px 18px 14px; color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
    background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 55%), linear-gradient(135deg, color-mix(in srgb, var(--primary) 92%, #000), var(--primary));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 28%, transparent); }
.df-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.df-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.df-hero small { font-size: .78rem; opacity: .85; font-weight: 600; }
.df-big { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.df-eye { width: 38px; height: 38px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.1rem; cursor: pointer; }
.df-accts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-top: 14px; position: relative; z-index: 1; }
.df-accts::-webkit-scrollbar { display: none; }
.df-acct { flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 12px; min-width: 128px; max-width: 190px;
    border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff !important; backdrop-filter: blur(6px); }
.df-acct i { grid-row: span 2; font-size: 1.1rem; opacity: .9; }
.df-acct span { font-size: .72rem; opacity: .85; }
.df-acct b { font-size: .95rem; }
.df-acct.more { display: grid; place-items: center; min-width: 56px; font-weight: 800; }
html.df-hide [data-df-privacy] { filter: blur(7px); user-select: none; }

.df-period { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.df-period .segmented a { padding: 6px 12px; }

/* ---------- KPIs ---------- */
.df-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }

.df-kpi { display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-radius: var(--df-r); background: var(--surface); border: 1px solid var(--border, var(--line)); color: var(--text) !important; position: relative; overflow: hidden; min-width: 0; }
.df-kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.df-kpi-l { font-size: .76rem; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 5px; }
.df-kpi-l i { color: var(--c); }
.df-kpi b { font-size: 1.28rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-kpi.neg b { color: #dc2626; }
.df-chg { font-size: .72rem; font-weight: 700; color: var(--muted); }
@media (max-width: 560px) { .df-kpis { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; } .df-kpi { padding: 11px 10px 11px 12px; } .df-kpi b { font-size: 1.02rem; } .df-kpi-l { font-size: .7rem; } .df-chg { font-size: .66rem; } }
.df-chg.up { color: #15803d; } .df-chg.down { color: #dc2626; }
.df-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.df-mini-c { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 14px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); color: var(--text) !important; min-width: 0; }
.df-mini-c > i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-size: 1.05rem; flex: none; }
.df-mini-c span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.df-mini-c small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.df-mini-c b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-mini-c em { font-style: normal; font-size: .7rem; color: #dc2626; font-weight: 700; }
.df-limit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.df-limit.full { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--surface)); }
.df-limit-bar { flex-basis: 100%; height: 5px; border-radius: 3px; background: var(--field); overflow: hidden; }
.df-limit-bar span { display: block; height: 100%; background: var(--primary); }
.df-limit.full .df-limit-bar span { background: #f59e0b; }

/* ---------- Mpangilio ---------- */
.df-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.df-col { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.df-col > .chart-card, .df > .chart-card { margin-bottom: 12px; border-radius: var(--df-r); }
@media (min-width: 900px) {
    .df-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .df-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
.df-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 8px; }
.df-card-h.flush { padding: 0 0 10px; }
.df-card-h h3 { margin: 0; font-size: .95rem; font-weight: 750; display: flex; align-items: center; gap: 7px; }
.df-card-h h3 i { color: var(--muted); }

/* ---------- Mistari (rows) ---------- */
.df-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--text) !important; min-width: 0; background: none; }
.df-card-h + .df-row, .df-card > .df-row:first-child, .df-day + .df-row, .df-debt > summary.df-row { border-top-color: transparent; }
.df-card-h + p + .df-row { border-top-color: transparent; }
a.df-row:hover, summary.df-row:hover { background: var(--surface-hover); }
.df-row.sub { padding-left: 64px; background: color-mix(in srgb, var(--field) 50%, transparent); }
.df-row.arch { opacity: .55; }
.df-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; font-size: 1.1rem; font-weight: 800; color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 13%, transparent); }
.df-ic.sm { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; }
.df-ic.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 1.5rem; }
.df-rt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.df-rt b { font-size: .92rem; font-weight: 650; }
.df-rt small { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-amt { text-align: right; font-weight: 750; font-size: .95rem; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.df-amt.in { color: var(--in); } .df-amt.out { color: var(--out); } .df-amt.tr { color: var(--tr); }
.df-amt small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.df-amt span { font-size: .8rem; }
.df-day { display: flex; justify-content: space-between; padding: 12px 16px 6px; font-size: .74rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: color-mix(in srgb, var(--field) 55%, transparent); border-top: 1px solid var(--line); }
.df-card > .df-day:first-child { border-top: 0; }
.df-day b { font-variant-numeric: tabular-nums; }
.df-rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--field); color: var(--muted); flex: none; }
.df-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; }
.df-note { text-align: center; font-size: .74rem; color: var(--muted); margin: 18px 0 0; }

/* ---------- Karibu ---------- */
.df-welcome { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; border-radius: var(--df-r); background: linear-gradient(135deg, var(--primary-soft), transparent); }
.df-welcome h2 { margin: 0 0 4px; font-size: 1.1rem; }
.df-welcome p { margin: 0 0 8px; }
.df-wl-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: var(--primary); flex: none; }
.df-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .88rem; }
.df-steps a { color: var(--text) !important; font-weight: 600; }
.df-steps i { color: var(--primary); margin-right: 3px; }

/* ---------- Bajeti ---------- */
.df-bud { padding: 10px 0; border-top: 1px solid var(--line); }
.df-bud:first-of-type, .df-card-h + .df-bud { border-top: 0; }
.df-bar { height: 8px; border-radius: 5px; background: var(--field); overflow: hidden; margin: 6px 0 4px; }
.df-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--primary); transition: width .4s ease; }
.df-bud.warn .df-bar > span { background: #f59e0b; }
.df-bud.over .df-bar > span { background: #dc2626; }
.df-bud.over .bold, .df-bud.over .small.bold { color: #dc2626; }
.df-bud-f { flex-wrap: nowrap; }
.df-bud-f .input.sm { padding: 7px 9px; font-size: .85rem; min-height: 0; height: 36px; }
.df-bud-f select.input.sm { width: 86px; flex: none; }
.df-bud-in { width: 110px; flex: none; text-align: right; }
@media (max-width: 520px) { .df-bud-f .df-ic { display: none; } .df-bud-in { width: 88px; } .df-bud-f select.input.sm { width: 76px; } }

.df-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.df-shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; font-size: .78rem; font-weight: 650; color: var(--text) !important; text-align: center; }
.df-shortcuts a:hover { background: var(--surface-hover); }
.df-shortcuts i { font-size: 1.35rem; }

/* ---------- Sheet ya kuandika haraka ---------- */
.sheet .df-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 14px 14px; }
.sheet .df-quick a { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: .74rem; font-weight: 650; text-align: center; color: var(--text); line-height: 1.2; }
.sheet .df-quick .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); transition: transform .12s; }
.sheet .df-quick a:active .ic { transform: scale(.94); }

/* ---------- Vichujio ---------- */
.df-chips { padding-bottom: 10px; }
.df-filter { margin-bottom: 10px; padding: 12px 14px !important; border-radius: var(--df-r); }
.df-frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.df-frow .grow { flex: 1 1 200px; min-width: 0; }
.df-month { width: auto; flex: 0 0 auto; max-width: 180px; }
.df-more-f summary { cursor: pointer; margin-top: 10px; color: var(--muted); list-style: none; }
.df-more-f summary::-webkit-details-marker { display: none; }
.df-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.df-lab { display: flex; flex-direction: column; gap: 4px; }
.df-lab > span { font-size: .72rem; font-weight: 700; color: var(--muted); }
.df-sumbar { display: flex; gap: 8px; margin-bottom: 12px; }
.df-sumbar span { flex: 1; display: flex; flex-direction: column; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.df-sumbar small { font-size: .7rem; color: var(--muted); font-weight: 650; }
.df-sumbar b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---------- Fomu ---------- */
.df-form { border-radius: var(--df-r); margin-bottom: 12px; }
.df-form .grid-2 { gap: 0 14px; }
.df-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--field); margin-bottom: 14px; }
.df-types.sm { grid-template-columns: repeat(2, 1fr); }
.df-types.four { grid-template-columns: repeat(4, 1fr); }
.df-types label { cursor: pointer; }
.df-types input { position: absolute; opacity: 0; pointer-events: none; }
.df-types span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; border-radius: 11px; font-weight: 700; font-size: .86rem; color: var(--muted); transition: all .15s; text-align: center; }
.df-types input:checked + span { background: var(--surface-strong, #fff); color: var(--c); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.df-types input:focus-visible + span { outline: 2px solid var(--c); }
@media (max-width: 420px) { .df-types.four span { font-size: .72rem; flex-direction: column; gap: 2px; padding: 8px 2px; } }
.df-amount { display: block; margin-bottom: 14px; }
.df-amount > span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.df-amount input { width: 100%; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-size: 2rem; font-weight: 800; letter-spacing: -.01em; padding: 6px 0; color: var(--text); outline: none; font-variant-numeric: tabular-nums; border-radius: 0; }
.df-amount input:focus { border-bottom-color: var(--primary); }
.df-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.df-actions .btn { flex: 1 1 160px; justify-content: center; }
.df-danger { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 0 4px; }
.df-danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.df-receipt { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.df-receipt img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.df-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.df-icons input { position: absolute; opacity: 0; }
.df-icons span { display: grid; place-items: center; height: 40px; border-radius: 10px; background: var(--field); cursor: pointer; font-size: 1.05rem; color: var(--muted); }
.df-icons input:checked + span { background: var(--primary); color: #fff; }
.df-prefix { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.df-logo-prev { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
[data-df-show] { }
.df-quickdays { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.df-quickdays .chip { padding: 4px 10px; font-size: .74rem; }

/* ---------- Akaunti ---------- */
.df-acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.df-acc { border-radius: var(--df-r); display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--c); }
.df-acc .df-ic { --c: inherit; color: var(--c); }
.df-acc.arch { opacity: .6; }
.df-acc-bal { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- Hati: fomu ya mistari ---------- */
.df-lines-card { overflow: visible; }
.df-lines { padding: 0 12px; }
.df-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px 120px 110px 36px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.df-line.head { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; border-top: 0; padding-bottom: 2px; }
.df-line .input { padding: 9px 10px; font-size: .9rem; }
.df-line label { margin: 0; min-width: 0; }
.df-ll { display: none; }
.df-lamt { text-align: right; font-variant-numeric: tabular-nums; font-size: .92rem; }
.df-stock { display: block; font-size: .7rem; color: var(--muted); margin-top: 3px; min-height: 0; }
.df-stock.low { color: #dc2626; font-weight: 700; }
@media (max-width: 720px) {
    .df-line.head { display: none; }
    .df-line { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "d d d" "q u p" "a a x"; padding: 12px 0; }
    .df-line .df-ld { grid-area: d; }
    .df-line > label:nth-of-type(2) { grid-area: q; } .df-line > label:nth-of-type(3) { grid-area: u; } .df-line > label:nth-of-type(4) { grid-area: p; }
    .df-line .df-lamt { grid-area: a; text-align: left; font-size: 1rem; }
    .df-line [data-df-rmline] { grid-area: x; justify-self: end; }
    .df-ll { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
}
.df-lines-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 16px 16px; border-top: 1px solid var(--line); align-items: flex-start; }
.df-totals { display: grid; gap: 6px; min-width: 260px; margin-left: auto; }
.df-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .88rem; }
.df-totals > div > span { color: var(--muted); font-weight: 600; }
.df-totals .input.sm { width: 120px; padding: 6px 10px; text-align: right; }
.df-totals .grand { padding-top: 8px; border-top: 2px solid var(--line); font-size: 1.15rem; }
.df-totals .grand span { color: var(--text); font-weight: 800; }
.df-totals b { font-variant-numeric: tabular-nums; }

/* ---------- Hati: ukurasa ---------- */
.df-docbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.df-docbar form { display: contents; }
.df-linked { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.df-docgrid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 980px) { .df-docgrid { grid-template-columns: minmax(0, 1fr) 320px; } }
.df-docside { display: flex; flex-direction: column; }
.df-docside .df-row.card { border-top: 0; }
.df-debt-head .df-ic { color: var(--c); }
.df-aging { display: grid; gap: 6px; margin-top: 12px; }
.df-ag { display: grid; grid-template-columns: 96px 1fr 96px; gap: 10px; align-items: center; font-size: .76rem; }
.df-ag .df-bar { margin: 0; height: 6px; }
.df-ag span { color: var(--muted); font-weight: 600; }
.df-ag b { text-align: right; font-variant-numeric: tabular-nums; }
.df-ag.current .df-bar > span { background: #16a34a; } .df-ag.d30 .df-bar > span { background: #f59e0b; } .df-ag.d60 .df-bar > span { background: #f97316; }
.df-ag.d90 .df-bar > span { background: #ef4444; } .df-ag.d90p .df-bar > span { background: #991b1b; }
.df-debt > summary { list-style: none; cursor: pointer; }
.df-debt > summary::-webkit-details-marker { display: none; }
.df-debt + .df-debt > summary { border-top-color: var(--line); }
.df-ct-head { border-radius: var(--df-r); }

/* ---------- Jedwali la ripoti ---------- */
.df-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.df-table th, .df-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.df-table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.df-table .r { text-align: right; white-space: nowrap; }
.df-table tr.sec th { padding-top: 16px; font-size: .72rem; letter-spacing: .06em; color: var(--muted); border-bottom: 0; }
.df-table tr.tot td { font-weight: 800; border-bottom: 2px solid var(--line); }
.df-table tr.net td { font-weight: 800; font-size: 1.05rem; background: color-mix(in srgb, #16a34a 9%, transparent); border-bottom: 0; }
.df-table tr.net.neg td { background: color-mix(in srgb, #dc2626 9%, transparent); color: #b91c1c; }
.df-table.cash { font-size: .8rem; }
.df-table.cash th, .df-table.cash td { padding: 7px 4px; }
@media (max-width: 520px) { .df-table.cash { min-width: 460px; } }

/* ==========================================================================
   Hati (karatasi) — ukurasa wa hati, uchapishaji na link ya umma
   ========================================================================== */
.df-paper { --dc: var(--primary, #2f7a38); background: #fff; color: #111827; border-radius: 16px; padding: 28px 28px 22px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); border: 1px solid #e5e7eb; font-size: .9rem; position: relative; overflow: hidden; }
.df-paper::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--dc); }
.dp-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.dp-biz { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.dp-logo { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; }
.dp-bn { font-size: 1.15rem; font-weight: 800; display: block; color: #0f172a; }
.dp-meta { font-size: .78rem; color: #64748b; line-height: 1.5; margin-top: 2px; }
.dp-title { text-align: right; margin-left: auto; }
.dp-title h2 { margin: 0; font-size: 1.05rem; letter-spacing: .08em; color: var(--dc); font-weight: 900; }
.dp-no { font-weight: 800; font-size: 1rem; color: #0f172a; margin-top: 2px; }
.dp-status { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, #fff); border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent); }
.dp-parties { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 16px 0; }
.dp-parties small, .dp-pay small, .dp-terms small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 800; margin-bottom: 3px; }
.dp-parties b { font-size: 1rem; color: #0f172a; }
.dp-dates { display: flex; gap: 22px; text-align: right; }
.dp-lines { width: 100%; border-collapse: collapse; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.dp-lines th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; text-align: left; padding: 9px 8px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.dp-lines td { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.dp-lines .r { text-align: right; }
.dp-lines td:first-child, .dp-lines th:first-child { width: 28px; color: #94a3b8; }
.dp-sum { display: flex; justify-content: flex-end; padding: 8px 0 4px; }
.dp-sum-in { width: min(320px, 100%); display: grid; gap: 5px; font-variant-numeric: tabular-nums; }
.dp-sum-in > div { display: flex; justify-content: space-between; gap: 12px; }
.dp-sum-in span { color: #64748b; }
.dp-sum-in .grand { border-top: 2px solid #0f172a; padding-top: 8px; margin-top: 3px; font-size: 1.1rem; }
.dp-sum-in .grand span, .dp-sum-in .grand b { color: #0f172a; font-weight: 900; }
.dp-sum-in .due b { color: #b91c1c; font-size: 1.02rem; }
.dp-sum-in .paid span, .dp-sum-in .paid b { color: #15803d; font-weight: 800; }
.dp-pay { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.dp-pay > div { display: flex; justify-content: space-between; font-size: .8rem; color: #475569; padding: 2px 0; }
.dp-terms { margin-top: 12px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.dp-terms p { margin: 0; font-size: .82rem; color: #334155; }
.dp-foot { margin-top: 18px; text-align: center; font-size: .8rem; color: #475569; }
.dp-foot span { font-size: .68rem; color: #94a3b8; }
.dp-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 20px 0 6px; }
.df-paper .df-table { color: #111827; }
.df-paper .df-table th, .df-paper .df-table td { border-bottom-color: #eef2f7; }
@media (max-width: 560px) {
    .df-paper { padding: 20px 14px 16px; border-radius: 12px; font-size: .84rem; }
    .dp-title { text-align: left; margin-left: 0; }
    .dp-dates { text-align: left; }
    .dp-lines th:nth-child(4), .dp-lines td:nth-child(4) { display: none; }
}
html[data-mode="dark"] .df-paper { box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* ---------- Ukurasa wa kuchapisha / link ya umma ---------- */
.df-print-body { margin: 0; background: #eef2f5; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111827; --line: #e5e7eb; --muted: #64748b; --field: #f1f5f9; }
.df-print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; font-size: .88rem; }
.df-print-bar a { color: #111827; text-decoration: none; font-weight: 600; }
.df-print-bar button { border: 0; background: #2f7a38; color: #fff; padding: 9px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: .86rem; }
.df-print-wrap { max-width: 820px; margin: 20px auto 40px; padding: 0 12px; }
.df-print-note { text-align: center; font-size: .78rem; color: #64748b; margin-top: 14px; }
.df-print-body .in { color: #15803d; } .df-print-body .out { color: #b91c1c; }
.df-print-body .table-wrap { overflow-x: auto; }
@media print {
    @page { size: A4; margin: 12mm; }
    .df-print-bar, .df-print-note { display: none !important; }
    .df-print-body { background: #fff; }
    .df-print-wrap { margin: 0; max-width: none; padding: 0; }
    .df-paper { box-shadow: none; border: 0; padding: 0; border-radius: 0; }
    .df-paper::before { display: none; }
    .dp-lines th { background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .df-table.cash { min-width: 0; }
}


/* ==========================================================================
   v13.1 — Shamba & Misimu, Kalenda & Kazi
   ========================================================================== */
.df .btn-link, .btn-link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 600; }
.df-bar.thin { height: 5px; margin: 5px 0 0; }
.df-today .df-card-h h3 .muted { font-weight: 600; }
.df-act .df-check-f { display: contents; }
.df-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border, var(--line)); background: none; display: grid; place-items: center; flex: none; cursor: pointer; color: transparent; font-size: 1rem; transition: all .15s; }
.df-check:hover { border-color: #16a34a; color: #16a34a; }
.df-check.on { border-color: transparent; background: #16a34a; color: #fff; cursor: default; }
.df-check.on.skipped { background: #94a3b8; }
.df-act.done .df-rt b, .df-act.skipped .df-rt b { color: var(--muted); font-weight: 600; }
.df-act.late .df-check { border-color: #dc2626; }
.df-act .df-rt b i { margin-right: 2px; }
.df-overdue { border-color: color-mix(in srgb, #dc2626 30%, transparent); }
.df-season-head { display: flex; flex-direction: column; gap: 8px; }
.df-sh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 14px; }
.df-sh-grid > div { display: flex; flex-direction: column; min-width: 0; }
.df-sh-grid small { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.df-sh-grid b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; }
.df-stage-f { display: flex; gap: 8px; flex-wrap: wrap; }
.df-stage-f .input.sm { width: auto; flex: 1 1 140px; padding: 7px 10px; font-size: .84rem; }
.df-catbar { padding: 6px 0; }
.df-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.df-kinds label { cursor: pointer; }
.df-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.df-kinds span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); font-size: .8rem; font-weight: 650; color: var(--muted); transition: all .15s; }
.df-kinds span i { color: var(--c); }
.df-kinds input:checked + span { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); color: var(--text); }
.df-kinds input:focus-visible + span { outline: 2px solid var(--c); }
.df-types.three { grid-template-columns: repeat(3, 1fr); }
.df-inputs { display: grid; gap: 6px; }
.df-inrow { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px; }
.df-donebox { padding: 12px 14px 2px; margin-bottom: 12px; border-radius: 14px; background: color-mix(in srgb, #16a34a 6%, var(--field)); border: 1px dashed color-mix(in srgb, #16a34a 30%, transparent); }
.df-field { color: var(--text) !important; }
.df-field .df-badge { margin: 0 4px 4px 0; }
.df-table.cmp { font-size: .8rem; min-width: 720px; }
.df-table.cmp a { color: var(--text); font-weight: 650; }

/* Kalenda */
.df-cal { padding: 12px !important; }
.df-cal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.df-cal-h b { font-size: 1.05rem; text-transform: capitalize; min-width: 130px; text-align: center; }
.df-cal-h .sp { flex: 1; }
.df-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.df-cal-dow { text-align: center; font-size: .68rem; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.df-cal-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 2px; border-radius: 12px; color: var(--text) !important; background: var(--field); border: 1px solid transparent; }
.df-cal-day:hover { border-color: var(--line); }
.df-cal-day.out { opacity: .4; }
.df-cal-day .n { font-size: .85rem; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.df-cal-day.today .n { background: var(--primary); color: #fff; }
.df-cal-day.sel { border-color: var(--text); background: var(--surface); }
.df-cal-day.late::after { content: ""; position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: #dc2626; }
.df-cal-day .dots { display: flex; gap: 3px; }
.df-cal-day .dots i, .df-cal-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: inline-block; }
.df-cal-day .lbl { display: none; }
.df-cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.df-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
@media (min-width: 900px) {
    .df-cal-day { min-height: 92px; align-items: stretch; padding: 6px; }
    .df-cal-day .n { align-self: flex-start; }
    .df-cal-day .dots { display: none; }
    .df-cal-day .lbl { display: flex; flex-direction: column; gap: 2px; }
    .df-cal-day .lbl em { font-style: normal; font-size: .68rem; font-weight: 650; padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--c); }
    .df-cal-day .lbl em.done { opacity: .5; text-decoration: line-through; }
    .df-cal-day .lbl em.overdue { background: color-mix(in srgb, #dc2626 14%, transparent); border-left-color: #dc2626; }
    .df-cal-day .lbl em.more { background: none; border: 0; color: var(--muted); }
}

/* ==========================================================================
   Awamu 2C: Mifugo
   ========================================================================== */
.lv-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.lv-kinds a { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text) !important; font-size: .8rem; font-weight: 650; line-height: 1.25; min-width: 0; }
.lv-kinds a i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); font-size: 1rem; }
.lv-kinds a:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.lv-row { position: relative; }
.lv-dot { position: absolute; top: 12px; left: 46px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--surface); }
.lv-warn { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: .84rem;
    background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent); }
.lv-warn > i { font-size: 1.3rem; color: #d97706; }
.lv-warn span { display: flex; flex-direction: column; gap: 2px; }
.lv-disclaimer { display: flex; gap: 6px; align-items: flex-start; margin: 4px 4px 14px; }
.lv-log .df-rt b { font-weight: 600; }

/* ==========================================================================
   Awamu 2D: Ukusanyaji
   ========================================================================== */
.cl-total { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 12px 14px; border-radius: 14px; margin: 4px 0 12px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); font-size: .86rem; }
.cl-total b { font-size: 1.05rem; margin-left: 6px; }
.df-row input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }
