@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #233348;
  --muted: #748093;
  --primary: #53699d;
  --primary-strong: #3f568c;
  --primary-soft: #e8edf7;
  --accent: #ddb278;
  --accent-soft: #f8eee0;
  --surface: #f4f5f2;
  --panel: #fff;
  --panel-subtle: #f9faf8;
  --line: #e3e7e4;
  --green: #5d8974;
  --green-soft: #e3f1e9;
  --orange: #b7793b;
  --orange-soft: #f7ebdb;
  --red: #b85f5a;
  --red-soft: #f6e5e3;
  --shadow: 0 18px 45px rgba(48, 59, 70, .08);
  color-scheme: light;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}

:root[data-palette="sage"] {
  --primary: #58796d;
  --primary-strong: #41645a;
  --primary-soft: #e3ece7;
  --accent: #b6a06d;
  --accent-soft: #f2eddf;
  --surface: #f3f5f1;
}
:root[data-palette="sand"] {
  --primary: #80684f;
  --primary-strong: #66513d;
  --primary-soft: #eee6dd;
  --accent: #bb8b66;
  --accent-soft: #f5e9e0;
  --surface: #f6f3ee;
}
:root[data-palette="lavender"] {
  --primary: #6f668f;
  --primary-strong: #574f76;
  --primary-soft: #e9e5f0;
  --accent: #b38b91;
  --accent-soft: #f3e6e8;
  --surface: #f5f3f7;
}

* { box-sizing: border-box; }

.app-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink, #17223b);
  background: var(--surface, #f5f6f2);
}

.app-loading span {
  width: 38px;
  height: 38px;
  border: 4px solid #dce4f1;
  border-top-color: #536899;
  border-radius: 50%;
  animation: loading-spin .8s linear infinite;
}

@keyframes loading-spin { to { transform: rotate(360deg); } }
html { background: var(--surface); }
.login-screen { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-card { width: min(100%, 440px); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.login-card .brand-mark { margin: auto; }
.login-card .primary-btn { width: 100%; margin-block: 16px; }
.support-content { padding: 24px; }
.support-content input { width: 100%; padding: 12px; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--surface); }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; padding: 28px 18px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface), white 50%); }
.brand { width: 100%; display: flex; gap: 12px; align-items: center; padding: 0 8px 26px; border: 0; background: none; text-align: left; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--primary); box-shadow: 0 10px 25px color-mix(in srgb, var(--primary), transparent 70%); }
.brand-mark .icon { width: 27px; height: 27px; }
.brand strong { display: block; font-size: 1.28rem; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: .72rem; }
.side-nav { display: grid; gap: 7px; }
.side-nav button, .sidebar-foot > button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 15px; border: 0; border-radius: 12px; color: #536073; background: transparent; font-weight: 600; text-align: left; transition: .2s ease; }
.side-nav button:hover, .sidebar-foot > button:hover { background: color-mix(in srgb, var(--primary-soft), transparent 25%); color: var(--primary-strong); }
.side-nav button.active, .sidebar-foot > button.active { color: var(--primary-strong); background: var(--primary-soft); }
.side-nav button.active .icon { stroke-width: 2.3; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.staging-note { margin: 0 8px; padding: 12px 14px; display: grid; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: color-mix(in srgb, var(--panel), transparent 25%); font-size: .73rem; }
.staging-note b { color: var(--primary); }

.workspace { grid-column: 2; min-width: 0; }
.topbar { min-height: 104px; padding: 22px 38px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface), white 30%); }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: .79rem; font-weight: 600; }
.topbar h1 { margin: 0; font-size: clamp(1.7rem, 2.4vw, 2.35rem); line-height: 1.15; letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.notify-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid var(--panel); border-radius: 50%; background: var(--red); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); text-align: left; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 700; }
.user-chip b, .user-chip small { display: block; }
.user-chip b { font-size: .79rem; }
.user-chip small { color: var(--muted); font-size: .65rem; }
.primary-btn, .soft-btn, .ghost-btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; padding: 9px 16px; font-weight: 700; }
.primary-btn { border: 1px solid var(--primary); color: #fff; background: var(--primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary), transparent 75%); }
.primary-btn:hover { background: var(--primary-strong); }
.soft-btn { border: 1px solid color-mix(in srgb, var(--primary), transparent 75%); color: var(--primary-strong); background: var(--primary-soft); }
.ghost-btn { border: 1px solid var(--line); background: var(--panel); }
.text-btn { border: 0; color: var(--primary); background: transparent; font-weight: 700; }

.content { width: 100%; max-width: 1510px; margin: auto; padding: 28px 38px 64px; }
.toast { position: fixed; z-index: 100; top: 94px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; color: #fff; background: #27374a; box-shadow: var(--shadow); font-size: .85rem; animation: pop .2s ease; }
@keyframes pop { from { transform: translate(-50%, -8px); opacity: 0; } }

.scope-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.scope-row p { margin: 0; color: var(--muted); font-size: .8rem; }
.segmented { width: min(520px, 100%); padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel), transparent 30%); }
.segmented button { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 600; }
.segmented button.active { color: #fff; background: var(--primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary), transparent 78%); }

.hero-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.balance-card, .next-card { min-height: 180px; position: relative; overflow: hidden; padding: 28px; border-radius: 21px; box-shadow: var(--shadow); }
.balance-card { color: #fff; background: linear-gradient(125deg, var(--primary-strong), var(--primary)); }
.balance-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; bottom: -125px; border: 35px solid rgba(255,255,255,.08); border-radius: 50%; }
.balance-card > div:first-child { position: relative; z-index: 2; display: grid; }
.balance-card strong { margin: 4px 0; font-size: clamp(2.2rem, 4vw, 3.5rem); letter-spacing: -.05em; }
.balance-card small { color: rgba(255,255,255,.7); }
.balance-art { position: absolute; right: 32px; top: 30px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.14); }
.balance-art .icon { width: 31px; height: 31px; }
.card-kicker { color: inherit; opacity: .75; font-size: .82rem; font-weight: 600; }
.next-card { border: 1px solid color-mix(in srgb, var(--accent), transparent 45%); background: linear-gradient(145deg, var(--accent-soft), var(--panel)); }
.next-card strong { display: block; margin-top: 15px; font-size: 1.4rem; }
.next-card p { margin: 4px 0 16px; color: var(--muted); }

.asset-strip { margin: 18px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.asset-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); text-align: left; box-shadow: 0 7px 22px rgba(48,59,70,.04); }
.asset-card:hover { border-color: color-mix(in srgb, var(--primary), transparent 55%); transform: translateY(-1px); }
.asset-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.asset-icon.car { color: var(--green); background: var(--green-soft); }
.asset-icon.personal { color: var(--orange); background: var(--orange-soft); }
.asset-icon .icon { width: 27px; height: 27px; }
.asset-copy { min-width: 0; display: grid; align-items: center; grid-template-columns: auto 1fr; column-gap: 8px; }
.asset-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-copy small { grid-column: 1 / -1; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.visibility { width: max-content; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 7px; color: var(--green); background: var(--green-soft); font-size: .62rem; font-style: normal; font-weight: 600; }
.visibility.private { color: var(--orange); background: var(--orange-soft); }
.visibility .icon { width: .8rem; height: .8rem; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-grid article { padding: 19px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.metric-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.metric-icon.due { color: var(--orange); background: var(--orange-soft); }
.metric-icon.jobs { color: var(--green); background: var(--green-soft); }
.metric-grid small, .metric-grid strong { display: block; }
.metric-grid small { color: var(--muted); font-size: .7rem; }
.metric-grid strong { font-size: 1.42rem; letter-spacing: -.03em; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 8px 25px rgba(48,59,70,.035); }
.panel-title { min-height: 66px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 1rem; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.list { padding: 4px 16px 12px; }
.list-row { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.row-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.row-main { min-width: 0; flex: 1; }
.row-main b, .row-main small { display: block; }
.row-main b { font-size: .83rem; }
.row-main small { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.row-money { display: grid; justify-items: end; }
.row-money b { font-size: .85rem; }
.row-money button { margin-top: 3px; border: 0; color: var(--primary); background: none; font-size: .66rem; font-weight: 700; }
.estimate { margin-left: 4px; border-radius: 5px; padding: 2px 5px; color: var(--orange); background: var(--orange-soft); font-size: .56rem; font-style: normal; }
.status { width: max-content; display: inline-flex; border-radius: 999px; padding: 5px 8px; color: var(--orange); background: var(--orange-soft); font-size: .64rem; font-style: normal; font-weight: 700; }
.status.scheduled, .status.paid { color: var(--green); background: var(--green-soft); }
.empty-mini { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .78rem; }

.calendar-panel { overflow: hidden; }
.month-controls { display: flex; align-items: center; gap: 8px; }
.month-controls button { min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.month-controls .text-btn { min-width: auto; border: 0; }
.month-controls b { min-width: 135px; text-align: center; font-size: .8rem; }
.calendar { overflow: auto; }
.weekdays, .cal-grid { min-width: 740px; display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays { border-bottom: 1px solid var(--line); color: var(--muted); background: var(--panel-subtle); font-size: .67rem; font-weight: 700; text-align: center; }
.weekdays span { padding: 8px; }
.cal-cell { min-height: 96px; padding: 7px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: inherit; background: var(--panel); font: inherit; text-align: left; }
.calendar-panel .cal-cell { min-height: 82px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.muted { background: var(--panel-subtle); opacity: .55; }
.day-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: .69rem; }
.cal-cell.today .day-number { color: #fff; background: var(--primary); }
.cal-events { display: grid; gap: 3px; margin-top: 4px; }
.cal-event { overflow: hidden; padding: 3px 5px; border-left: 3px solid var(--primary); border-radius: 4px; color: var(--primary-strong); background: var(--primary-soft); font-size: .58rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.subscription { border-color: var(--orange); color: var(--orange); background: var(--orange-soft); }
.cal-event.task { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.cal-event.contract, .cal-event.warranty { border-color: #7b6aa8; color: #67568f; background: #eeeafb; }
.cal-event.paid { opacity: .55; text-decoration: line-through; }
.full-calendar { overflow: hidden; }
.legend { padding: 12px 20px; display: flex; gap: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.legend i.subscription { background: var(--orange); }
.legend i.task { background: var(--green); }
.legend i.expiry { background: #7b6aa8; }

.section-intro { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.intro-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.task-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.member-checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.member-checks > span { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.member-checks input { width: auto; }
.notification-list { display: grid; gap: 8px; }
.notification-list article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.notification-list article div { display: grid; gap: 3px; }
.notification-list article small { color: var(--muted); }
.section-intro h2 { margin: 0; font-size: 1.25rem; }
.section-intro p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.filter-row { margin-bottom: 14px; display: flex; gap: 8px; overflow: auto; }
.filter { flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font-size: .75rem; }
.filter.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.filter b { margin-left: 4px; }
.table-panel { overflow: hidden; }
.bill-table { min-width: 920px; }
.table-head, .table-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr .8fr .8fr .7fr; gap: 15px; align-items: center; padding: 13px 19px; }
.table-head { color: var(--muted); background: var(--panel-subtle); font-size: .68rem; font-weight: 700; }
.table-row { min-height: 76px; border-top: 1px solid var(--line); font-size: .75rem; }
.table-row:first-of-type { border-top: 0; }
.table-name { display: flex; align-items: center; gap: 10px; }
.table-name b, .table-name small, .table-row > span > small { display: block; }
.table-name small, .table-row > span > small { color: var(--muted); font-size: .63rem; }
.table-actions { text-align: right; }

.asset-page-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.asset-detail-card, .blank-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.asset-cover { height: 120px; display: grid; place-items: center; color: var(--primary); background: linear-gradient(145deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft), white 45%)); }
.asset-cover.car { color: var(--green); background: linear-gradient(145deg, var(--green-soft), #f3f8f4); }
.asset-cover .icon { width: 60px; height: 60px; stroke-width: 1.2; }
.asset-detail-head { padding: 16px 17px 8px; display: flex; justify-content: space-between; align-items: start; }
.asset-detail-head h3 { margin: 0 0 7px; }
.asset-detail-card > p { margin: 0; padding: 0 17px 16px; color: var(--muted); font-size: .75rem; }
.asset-summary { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: var(--panel-subtle); }
.asset-summary span { padding: 13px 17px; }
.asset-summary span + span { border-left: 1px solid var(--line); }
.asset-summary small, .asset-summary b { display: block; }
.asset-summary small { color: var(--muted); font-size: .64rem; }
.blank-card { padding: 35px; display: grid; justify-items: center; text-align: center; }
.blank-card h3 { margin: 12px 0 3px; }
.blank-card p { margin: 0; color: var(--muted); font-size: .76rem; }

.report-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 18px; }
.report-total { padding: 28px; display: grid; align-content: center; border-radius: 18px; color: #fff; background: var(--primary); box-shadow: var(--shadow); }
.report-total span { opacity: .75; font-size: .8rem; }
.report-total strong { font-size: 2.8rem; letter-spacing: -.05em; }
.report-total small { opacity: .65; }
.report-grid .panel { padding: 22px; }
.report-grid h2 { margin: 0 0 18px; font-size: 1rem; }
.bar-list { display: grid; gap: 15px; }
.bar-list span { display: flex; justify-content: space-between; font-size: .75rem; }
.bar-list em { color: var(--muted); font-style: normal; }
.bar-list i { height: 8px; display: block; overflow: hidden; border-radius: 999px; background: var(--primary-soft); }
.bar-list u { height: 100%; display: block; border-radius: inherit; background: var(--primary); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.settings-section { padding: 22px; }
.settings-heading { display: flex; align-items: center; gap: 14px; }
.settings-heading > div { flex: 1; }
.settings-heading h2 { margin: 0; font-size: 1rem; }
.settings-heading p { margin: 2px 0 0; color: var(--muted); font-size: .72rem; }
.settings-icon, .payment-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.palette-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.palette-option { position: relative; padding: 14px; display: grid; justify-items: start; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-subtle); }
.palette-option.active { border: 2px solid var(--primary); padding: 13px; }
.palette-option > span { width: 100%; height: 54px; padding: 12px; display: flex; gap: 5px; align-items: end; border-radius: 9px; background: var(--pale); }
.palette-option > span i { display: block; width: 23px; height: 23px; border-radius: 50%; background: var(--swatch); }
.palette-option > span i:nth-child(2) { opacity: .65; }
.palette-option > span i:nth-child(3) { opacity: .35; }
.palette-option b { margin-top: 8px; font-size: .76rem; }
.palette-option em { position: absolute; right: 12px; bottom: 12px; color: var(--primary); font-size: .6rem; font-style: normal; }
.member-list, .payment-list { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; }
.member-list > div, .payment-list > div { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.member-list > div:last-child, .payment-list > div:last-child { border-bottom: 0; }
.member-list span:nth-child(2), .payment-list span:nth-child(2) { flex: 1; }
.member-list b, .member-list small, .payment-list b, .payment-list small { display: block; }
.member-list b, .payment-list b { font-size: .78rem; }
.member-list small, .payment-list small { color: var(--muted); font-size: .66rem; }
.member-list > div > em { color: var(--muted); font-size: .68rem; font-style: normal; }
.demo-switch { margin-top: 14px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: 12px; background: var(--primary-soft); }
.demo-switch b { font-size: .78rem; }
.demo-switch p { margin: 2px 0 0; color: var(--muted); font-size: .68rem; }
.account-box .info-note { margin: 16px 0; padding: 12px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--accent-soft); font-size: .72rem; }
.danger-link { padding: 0; border: 0; color: var(--red); background: none; font-size: .72rem; font-weight: 700; }

.modal-backdrop { position: fixed; z-index: 200; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(28, 38, 49, .46); backdrop-filter: blur(4px); }
.modal { width: min(530px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 28px 80px rgba(15,25,35,.22); }
.modal.wide { width: min(820px, 100%); }
.modal > header { position: sticky; z-index: 2; top: 0; padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel), transparent 4%); }
.modal > header h2 { margin: 0; font-size: 1.12rem; }
.modal form { padding: 20px; }
.modal label { display: grid; gap: 5px; margin-bottom: 14px; color: var(--ink); font-size: .73rem; font-weight: 600; }
.modal input, .modal select, .modal textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); outline: none; background: var(--panel-subtle); font: inherit; }
.modal textarea { min-height: 92px; resize: vertical; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.modal label small { color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full, .form-grid .check-row { grid-column: 1 / -1; }
.check-row { min-height: 58px; grid-template-columns: auto 1fr !important; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-subtle); }
.check-row input { width: 19px; min-height: 19px; }
.check-row b, .check-row small { display: block; }
.linked-task-toggle { margin-top: 8px; border-color: color-mix(in srgb, var(--primary) 42%, var(--line)); background: var(--primary-soft); }
.linked-task-fields { grid-column: 1 / -1; margin: 0 0 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-subtle); }
.linked-task-fields[hidden] { display: none !important; }
.linked-task-heading { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.linked-task-heading > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--primary-strong); background: var(--primary-soft); }
.linked-task-heading > div { display: grid; gap: 2px; }
.linked-task-heading small { color: var(--muted); }
.linked-task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.linked-task-grid .full { grid-column: 1 / -1; }
.linked-record-card { margin: 12px 0; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-subtle); }
.linked-record-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); }
.linked-record-card > div { display: grid; gap: 3px; }
.linked-record-card small { color: var(--muted); }
.modal-note { padding: 12px 14px; display: flex; align-items: center; gap: 9px; border-radius: 10px; color: var(--primary-strong); background: var(--primary-soft); font-size: .7rem; }
.modal footer { padding-top: 19px; display: flex; justify-content: flex-end; gap: 9px; }
.bill-summary { margin: 20px 20px 0; padding: 18px; border-radius: 14px; background: var(--primary-soft); }
.bill-summary > div { display: grid; margin-bottom: 14px; }
.bill-summary > div span { color: var(--muted); font-size: .7rem; }
.bill-summary > div strong { color: var(--primary-strong); font-size: 2rem; }
.bill-summary dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bill-summary dl div { display: grid; }
.bill-summary dt { color: var(--muted); font-size: .62rem; }
.bill-summary dd { margin: 0; font-size: .74rem; font-weight: 600; }
.snooze-box { padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px dashed color-mix(in srgb, var(--orange), transparent 45%); border-radius: 11px; background: var(--orange-soft); }
.snooze-box b { display: flex; align-items: center; gap: 6px; font-size: .75rem; }
.snooze-box p { margin: 2px 0 0; color: var(--muted); font-size: .64rem; }

.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { width: 82px; padding: 22px 10px; }
  .brand { justify-content: center; padding: 0 0 24px; }
  .brand > span:last-child, .side-nav button span, .sidebar-foot > button span, .staging-note { display: none; }
  .side-nav button, .sidebar-foot > button { justify-content: center; padding: 14px; }
  .workspace { grid-column: 2; }
  .asset-strip { grid-template-columns: repeat(2, 1fr); }
  .asset-strip .asset-card:last-child { grid-column: 1 / -1; }
  .asset-page-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 70px; }
  .sidebar { display: none; }
  .workspace { display: block; }
  .topbar { min-height: 78px; padding: 14px 16px; }
  .topbar .eyebrow, .user-chip span:last-child, .topbar > .top-actions > .icon-btn { display: none; }
  .topbar h1 { font-size: 1.55rem; }
  .user-chip { padding: 4px; border: 0; background: transparent; }
  .topbar .primary-btn { width: 42px; padding: 0; }
  .topbar .primary-btn span { display: none; }
  .content { padding: 18px 14px 30px; }
  .scope-row { display: grid; }
  .scope-row p { display: none; }
  .hero-grid, .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
  .balance-card, .next-card { min-height: 155px; padding: 22px; }
  .asset-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .asset-card { min-width: 85%; scroll-snap-align: start; }
  .asset-strip .asset-card:last-child { grid-column: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { padding: 14px; }
  .metric-grid article:last-child { grid-column: 1 / -1; }
  .calendar-panel .panel-title { align-items: start; }
  .calendar-panel .month-controls .text-btn { display: none; }
  .section-intro { align-items: start; }
  .section-intro .primary-btn { width: 44px; padding: 0; font-size: 0; }
  .section-intro .primary-btn .icon { width: 1.35rem; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .bill-table { min-width: 0; display: grid; gap: 12px; }
  .table-head { display: none; }
  .table-row { padding: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
  .table-name { grid-column: 1 / -1; }
  .table-row > span:not(.table-name):not(.table-actions)::before { content: attr(data-label); display: block; color: var(--muted); font-size: .58rem; }
  .table-actions { align-self: end; }
  .asset-page-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: 1fr 1fr; }
  .settings-heading { flex-wrap: wrap; }
  .settings-heading > .soft-btn { margin-left: 56px; }
  .demo-switch { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full, .form-grid .check-row { grid-column: auto; }
  .linked-task-fields { grid-column: auto; }
  .linked-task-grid { grid-template-columns: 1fr; }
  .linked-task-grid .full { grid-column: auto; }
  .linked-record-card { grid-template-columns: auto 1fr; }
  .linked-record-card .soft-btn { grid-column: 1 / -1; justify-content: center; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .snooze-box { align-items: start; flex-direction: column; }
  .mobile-nav { position: fixed; z-index: 40; inset: auto 0 0; height: 72px; padding: 7px 6px max(7px, env(safe-area-inset-bottom)); display: flex; overflow-x: auto; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel), transparent 3%); backdrop-filter: blur(15px); scrollbar-width: none; }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav button { min-width: 72px; padding-inline: 5px; display: grid; flex: 1 0 72px; justify-items: center; gap: 2px; border: 0; color: var(--muted); background: transparent; font-size: .56rem; }
  .mobile-nav button.active { color: var(--primary); font-weight: 700; }
  .mobile-nav .icon { width: 1.25rem; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid article:last-child { grid-column: auto; }
  .palette-grid { grid-template-columns: 1fr; }
  .balance-card strong { font-size: 2.3rem; }
  .panel-title { padding: 15px; }
  .list { padding-inline: 11px; }
  .row-main small { max-width: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Approved Direction C — exact visual source of truth */
.app-shell { grid-template-columns: 190px minmax(0, 1fr); }
.sidebar { width: 190px; padding: 20px 13px 16px; border-right-color: #e0e3ef; background: #fff; }
.brand { gap: 10px; padding: 0 5px 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; box-shadow: none; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 1px; font-size: 10px; }
.side-nav { gap: 5px; }
.side-nav button, .sidebar-foot > button { min-height: 42px; padding: 8px 11px; gap: 10px; border-radius: 12px; color: #65718e; font-size: 13px; }
.side-nav button.active, .sidebar-foot > button.active { color: var(--primary-strong); background: var(--primary-soft); }
.sidebar-foot { gap: 12px; padding-top: 14px; border-top: 1px solid #e7e9f1; }
.staging-note { display: none; }
.workspace { grid-column: 2; }
.topbar { min-height: auto; padding: 22px 24px 0; border-bottom: 0; background: transparent; }
.topbar h1 { font-size: 23px; font-weight: 750; letter-spacing: 0; }
.topbar-sub { margin: 3px 0 0; color: #75809a; font-size: 12px; }
.top-actions { gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-color: #e0e3ef; border-radius: 11px; box-shadow: none; }
.user-chip { min-height: 38px; gap: 7px; padding: 4px 8px 4px 4px; border: 0; border-radius: 999px; box-shadow: none; }
.user-chip .avatar { width: 30px; height: 30px; background: #f4d7f0; color: #8c3a7e; font-size: 11px; }
.user-chip b { font-size: 11px; }
.user-chip small { display: none; }
.topbar .primary-btn { min-height: 38px; padding: 8px 12px; border-radius: 9px; box-shadow: none; font-size: 12px; }
.content { max-width: none; padding: 19px 24px 28px; }

.c-spotlight { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.c-hero-card { min-height: 174px; padding: 20px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary), white 26%)); }
.c-hero-label { font-size: 12px; opacity: .82; }
.c-hero-value { display: block; margin-top: 5px; font-size: 35px; font-weight: 750; letter-spacing: -.04em; }
.c-breakdown { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 19px; font-size: 11px; }
.c-breakdown span { min-width: 86px; }
.c-breakdown b { display: block; margin-top: 2px; font-size: 14px; }
.c-next-card { min-height: 174px; padding: 19px; border: 1px solid #e3e5ef; border-radius: 22px; background: #fff; }
.c-next-label { display: flex; align-items: center; gap: 7px; color: #646f8a; font-size: 12px; }
.c-next-label .icon { width: 16px; height: 16px; }
.c-next-card strong { display: block; margin-top: 12px; font-size: 18px; }
.c-next-card p { margin: 5px 0 0; color: #e07631; font-size: 12px; }
.c-warm-btn { width: 100%; min-height: 38px; margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #f3c89f; border-radius: 10px; color: #9b5527; background: #fff0e4; font-size: 11px; font-weight: 700; }
.c-warm-btn .icon { width: 16px; height: 16px; }

.c-assets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.c-asset-card { min-height: 113px; padding: 15px; display: block; border: 1px solid #e3e5ef; border-radius: 17px; background: #fff; text-align: left; }
.c-asset-card:hover { border-color: color-mix(in srgb, var(--primary), transparent 55%); }
.c-asset-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.c-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #24776f; background: #e8f4f3; }
.c-symbol.car { color: #7752b6; background: #f0eafb; }
.c-symbol.personal { color: #b8652f; background: #fff0e4; }
.c-symbol .icon { width: 17px; height: 17px; }
.c-asset-card > strong { display: block; margin-top: 12px; font-size: 13px; }
.c-asset-card > small { display: block; margin-top: 3px; color: #7b849c; font-size: 10px; }
.c-asset-card .visibility { padding: 4px 7px; font-size: 9px; }

.c-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.c-card { padding: 18px; border: 1px solid #e3e5ef; border-radius: 20px; background: #fff; }
.c-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.c-card-head h2 { margin: 0; font-size: 14px; }
.c-card-head .text-btn { padding: 0; font-size: 11px; }
.c-list { display: grid; }
.c-item { min-height: 57px; display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #edf0f6; }
.c-item:first-child { border-top: 0; }
.c-dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--primary-strong); background: var(--primary-soft); }
.c-dot .icon { width: 16px; height: 16px; }
.c-item b, .c-item small { display: block; }
.c-item b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.c-item small { overflow: hidden; color: #818aa1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.c-chip { padding: 6px 9px; border-radius: 9px; color: #4f5c77; background: #f3f5fb; font-size: 11px; font-style: normal; white-space: nowrap; }

.c-calendar-area { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.c-calendar { width: auto; margin-top: 0; padding: 18px; overflow: hidden; border: 1px solid #e3e5ef; border-radius: 20px; background: #fff; }
.c-calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.c-calendar-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 14px; }
.c-calendar .month-controls button { width: 34px; height: 34px; border-color: #e0e3ef; border-radius: 10px; background: #f7f8fc; }
.c-calendar .month-controls b { min-width: 96px; font-size: 12px; }
.c-calendar .calendar { border: 0; }
.c-calendar .weekdays { border-bottom: 0; background: #fff; color: #8a93a8; font-size: 10px; }
.c-calendar .weekdays span { padding: 7px 5px; }
.c-calendar .cal-cell { min-height: 74px; padding: 7px; border-color: #edf0f6; background: #fff; }
.c-calendar .cal-cell.muted { color: #b4bac8; background: #fafbfe; opacity: 1; }
.c-calendar .day-number { width: 23px; height: 23px; border-radius: 8px; font-size: 10px; }
.c-calendar .cal-events { gap: 0; margin-top: 0; }
.c-calendar .cal-event { display: block; margin-top: 4px; padding: 4px 5px; border: 0; border-radius: 7px; color: var(--primary-strong); background: var(--primary-soft); font-size: 9px; line-height: 1.25; }
.c-calendar .cal-event.task { color: #267567; background: #e8f6f2; }
.c-calendar .cal-event.subscription { color: #b6642e; background: #fff0e5; }
.c-calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: #7b859d; font-size: 10px; }
.c-calendar-legend span { display: flex; align-items: center; gap: 5px; }
.c-calendar-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.c-calendar-legend i.task { background: #4ca891; }
.c-calendar-legend i.warning { background: #e68a4e; }
.c-calendar .cal-cell.selected { background: color-mix(in srgb, var(--primary-soft), white 35%); box-shadow: inset 0 0 0 2px var(--primary); }
.c-mobile-calendar-toggle { display: none; }
.c-agenda-view { display: none; }
.c-calendar-detail { min-height: 280px; overflow: hidden; border: 1px solid #e3e5ef; border-radius: 20px; background: #fff; }
.c-detail-head { min-height: 72px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f6; }
.c-detail-head span { color: #7b849c; font-size: 12px; }
.c-detail-head h2 { margin: 2px 0 0; font-size: 18px; }
.c-detail-head .text-btn { font-size: 12px; }
.c-detail-list { padding: 5px 17px 12px; }
.c-detail-item { min-height: 68px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 11px; align-items: center; border-bottom: 1px solid #edf0f6; }
.c-detail-item:last-child { border-bottom: 0; }
.c-detail-item b, .c-detail-item small { display: block; }
.c-detail-item b { font-size: 14px; }
.c-detail-item small { margin-top: 2px; color: #818aa1; font-size: 12px; }
.c-detail-item .soft-btn { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.c-detail-empty { min-height: 240px; display: grid; align-content: center; justify-items: center; color: #7b849c; text-align: center; }
.c-detail-empty > .icon { width: 34px; height: 34px; margin-bottom: 10px; color: var(--primary); }
.c-detail-empty b { color: var(--ink); font-size: 15px; }
.c-detail-empty p { margin: 3px 0 14px; font-size: 12px; }
.calendar-agenda-list { display: grid; }
.calendar-agenda-list > button { min-height: 62px; padding: 9px 3px; display: grid; grid-template-columns: 38px 34px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid #edf0f6; background: transparent; text-align: left; }
.calendar-agenda-list > button:last-child { border-bottom: 0; }
.calendar-agenda-list b, .calendar-agenda-list small { display: block; }
.calendar-agenda-list b { font-size: 13px; }
.calendar-agenda-list small { color: #818aa1; font-size: 11px; }
.agenda-date { text-align: center; }
.agenda-date b { font-size: 17px; }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { width: 82px; padding: 20px 10px 16px; }
  .brand { justify-content: center; }
  .brand > span:last-child, .side-nav button span, .sidebar-foot > button span { display: none; }
  .side-nav button, .sidebar-foot > button { justify-content: center; }
  .workspace { grid-column: 2; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .topbar { padding: 16px 14px 0; }
  .topbar h1 { font-size: 20px; }
  .topbar-sub { max-width: 210px; font-size: 10px; }
  .content { padding: 16px 14px 28px; }
  .c-spotlight, .c-lower { grid-template-columns: 1fr; }
  .c-assets { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .c-asset-card { min-width: 78%; scroll-snap-align: start; }
  .c-calendar { padding: 13px; }
}

/* Readability pass */
body { font-size: 16px; }
.brand strong { font-size: 20px; }
.brand small { font-size: 12px; line-height: 1.35; }
.side-nav button, .sidebar-foot > button { font-size: 15px; }
.topbar h1 { font-size: 28px; }
.topbar-sub { font-size: 14px; }
.user-chip b { font-size: 13px; }
.topbar .primary-btn { font-size: 14px; }

.c-hero-label { font-size: 14px; }
.c-hero-value { font-size: 42px; }
.c-breakdown { gap: 24px; font-size: 13px; }
.c-breakdown b { font-size: 17px; }
.c-next-label { font-size: 14px; }
.c-next-card strong { font-size: 22px; }
.c-next-card p { font-size: 14px; }
.c-warm-btn { font-size: 14px; }
.c-asset-card > strong { font-size: 16px; }
.c-asset-card > small { font-size: 13px; }
.c-asset-card .visibility { font-size: 11px; }
.c-card-head h2, .c-calendar-head h2 { font-size: 17px; }
.c-card-head .text-btn { font-size: 13px; }
.c-item b { font-size: 15px; }
.c-item small { margin-top: 2px; font-size: 12px; }
.c-chip { font-size: 13px; }

.c-calendar { width: auto; }
.c-calendar .weekdays, .c-calendar .cal-grid { min-width: 0; }
.c-calendar .weekdays { font-size: 12px; }
.c-calendar .day-number { font-size: 12px; }
.c-calendar .cal-event { font-size: 11px; }
.c-calendar .month-controls b { font-size: 14px; }
.c-calendar-legend { font-size: 12px; }

.scope-row p, .section-intro p { font-size: 13px; }
.segmented button, .filter { font-size: 14px; }
.section-intro h2 { font-size: 20px; }
.panel-title h2, .report-grid h2, .settings-heading h2 { font-size: 17px; }
.panel-title p, .settings-heading p, .demo-switch p, .account-box .info-note { font-size: 13px; }
.row-main b, .table-row, .member-list b, .payment-list b { font-size: 14px; }
.row-main small, .table-name small, .table-row > span > small, .member-list small, .payment-list small { font-size: 12px; }
.status, .visibility { font-size: 11px; }
.table-head { font-size: 12px; }
.modal label { font-size: 14px; }
.modal-note, .snooze-box p { font-size: 12px; }

@media (max-width: 1100px) {
  .c-calendar-area { grid-template-columns: 1fr; }
  .c-calendar { width: 100%; }
}

@media (max-width: 760px) {
  .topbar h1 { font-size: 23px; }
  .topbar-sub { font-size: 12px; }
  .c-hero-value { font-size: 36px; }
  .c-card-head h2, .c-calendar-head h2 { font-size: 16px; }
  .c-mobile-calendar-toggle { margin-bottom: 11px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 10px; background: var(--panel-subtle); }
  .c-mobile-calendar-toggle button { min-height: 34px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 700; }
  .c-mobile-calendar-toggle button.active { color: var(--primary-strong); background: #fff; box-shadow: 0 3px 10px rgba(48,59,70,.08); }
  .c-month-view, .c-agenda-view { display: none; }
  .c-month-view.active, .c-agenda-view.active { display: block; }
  .c-calendar .cal-cell { min-height: 52px; padding: 5px; }
  .c-calendar .cal-events { min-height: 9px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px; }
  .c-calendar .cal-event { width: 7px; height: 7px; margin: 0; padding: 0; display: block; overflow: hidden; border-radius: 50%; color: transparent; background: var(--primary); font-size: 0; }
  .c-calendar .cal-event.task { background: #4ca891; }
  .c-calendar .cal-event.subscription { background: #e68a4e; }
  .c-calendar .cal-events small { display: none; }
  .c-calendar-legend { justify-content: center; }
  .c-calendar-detail { min-height: 0; }
  .c-detail-head { min-height: 62px; padding: 13px 15px; }
  .c-detail-list { padding-inline: 14px; }
  .c-detail-item { grid-template-columns: 36px minmax(0,1fr) auto; }
}

/* Source ownership and detail pages */
.general-categories { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.general-categories button { min-width: 150px; padding: 13px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel); }
.general-categories button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary), transparent 82%); }
.general-categories .row-icon { grid-row: 1 / 3; }
.general-categories b { font-size: 14px; }
.general-categories small { color: var(--muted); font-size: 11px; }
.general-task-panel { margin-top: 18px; overflow: hidden; }

.calendar-filter-bar { margin-bottom: 14px; padding: 12px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.calendar-filter-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.calendar-filter-bar b { margin-right: 3px; font-size: 12px; }
.calendar-filter-bar button { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel-subtle); font-size: 12px; }
.calendar-filter-bar button.active { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; }
.calendar-page-layout .full-calendar { min-width: 0; }

.asset-detail-card { width: 100%; padding: 0; color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 8px 24px rgba(40, 53, 72, .04); transition: transform .16s ease, box-shadow .16s ease; }
.asset-detail-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(40, 53, 72, .09); }
.asset-detail-head > .icon { margin-top: 5px; color: var(--muted); }
.asset-back { margin: 0 0 12px; padding: 8px 0; color: var(--primary-strong); background: transparent; font-weight: 700; }
.asset-detail-hero { margin-bottom: 16px; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, var(--panel), var(--primary-soft)); }
.asset-detail-hero.car { background: linear-gradient(135deg, var(--panel), var(--green-soft)); }
.asset-detail-hero > div:first-child { display: flex; align-items: center; gap: 14px; }
.asset-detail-hero h2 { margin: 2px 0; font-size: 24px; }
.asset-detail-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.asset-metrics { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.asset-metrics article { min-height: 92px; padding: 16px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.asset-metrics small { color: var(--muted); font-size: 12px; }
.asset-metrics strong { font-size: 20px; }
.asset-detail-columns { margin-bottom: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.asset-detail-columns > .panel { min-width: 0; overflow: hidden; }
.fuel-history { display: grid; }
.fuel-history > div { padding: 13px 18px; display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.fuel-history span { display: grid; gap: 2px; }
.fuel-history small { color: var(--muted); font-size: 11px; }
.contact-list { display: grid; }
.contact-list > div { padding: 13px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.contact-list span { display: grid; gap: 2px; }
.contact-list small { color: var(--muted); }
.contact-list a { padding: 8px 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; text-decoration: none; }
.contact-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; }
.c-chip { border: 0; cursor: pointer; }

.asset-add-intro { padding: 18px 20px 0; color: var(--muted); font-size: 14px; }
.asset-add-intro p { margin: 0; }
.asset-add-grid { padding: 16px 20px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.asset-add-choice { position: relative; min-height: 142px; padding: 17px; display: grid; align-content: start; gap: 7px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); text-align: left; background: var(--panel-subtle); cursor: pointer; }
.asset-add-choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.asset-add-choice.recommended { border-color: color-mix(in srgb, var(--primary), transparent 42%); background: var(--primary-soft); }
.asset-add-choice > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary-strong); background: var(--panel); }
.asset-add-choice strong { font-size: 15px; }
.asset-add-choice small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.asset-add-choice em { position: absolute; top: 12px; right: 12px; padding: 4px 8px; border-radius: 999px; color: var(--primary-strong); background: var(--panel); font-size: 10px; font-style: normal; font-weight: 700; }
.modal > .asset-add-grid + footer { padding: 14px 20px 20px; }

/* Main categories and subcategories */
.main-category-grid { display: grid; gap: 10px; }
.main-category-grid article { min-height: 74px; padding: 13px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-subtle); }
.main-category-grid article > span:nth-child(2) { display: grid; gap: 2px; }
.main-category-grid article small { color: var(--muted); font-size: 12px; }
.main-category-grid article > em { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--primary-soft); font-size: 11px; font-style: normal; font-weight: 700; }
.category-actions { display: flex; align-items: center; gap: 7px; }
.danger-link.compact { margin: 0; padding: 8px 10px; min-height: 36px; border: 1px solid color-mix(in srgb, var(--red), transparent 55%); border-radius: 10px; font-size: 12px; }
.subcategory-tabs { margin-bottom: 12px; padding-bottom: 4px; display: flex; gap: 7px; overflow-x: auto; }
.subcategory-tabs button { min-height: 38px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel-subtle); font-size: 12px; }
.subcategory-tabs button.active { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; }
.subcategory-tabs .icon { width: 16px; height: 16px; }
.archived-row { opacity: .68; }
.archived-row > em { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--panel-subtle); font-size: 11px; font-style: normal; font-weight: 700; }

@media (max-width: 1100px) {
  .general-categories { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .asset-detail-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .intro-actions { justify-content: flex-start; }
  .section-intro { flex-direction: column; }
  .section-intro .intro-actions .primary-btn { width: auto; padding: 0 14px; font-size: 13px; }
  .general-categories { display: flex; }
  .calendar-filter-bar { padding: 10px; }
  .calendar-filter-bar > div { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .calendar-filter-bar button { flex: 0 0 auto; }
  .asset-detail-hero { align-items: flex-start; flex-direction: column; }
  .asset-detail-hero .intro-actions { width: 100%; }
  .asset-metrics { grid-template-columns: 1fr 1fr; }
  .fuel-history > div { grid-template-columns: 1fr 1fr; }
  .fuel-history > div > span:nth-child(3) { grid-column: 1 / -1; }
  .fuel-history > div > .soft-btn { justify-self: start; }
  .contact-list > div { align-items: flex-start; flex-direction: column; }
  .asset-add-grid { grid-template-columns: 1fr; }
  .main-category-grid article { grid-template-columns: auto minmax(0, 1fr); }
  .category-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.danger-btn { background: #a53b43; color: white; border: 0; border-radius: 12px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; }
.danger-btn:disabled { opacity: .5; cursor: wait; }
.recycle-list { padding: 20px; }
.recycle-list article { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border, #ddd); }
.recycle-list article div { min-width: 0; }
.recycle-list small { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.modal footer { flex-wrap: wrap; }
.settings-section, .settings-heading > div { min-width: 0; }
.recycle-list + footer { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
@media (max-width: 650px) {
  .member-list > div, .payment-list > div, .settings-section .list-row { flex-wrap: wrap; }
  .member-list span:nth-child(2), .payment-list span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
  .settings-section .list-row .row-main { flex-basis: 100%; }
  .recycle-list article { flex-wrap: wrap; }
  .recycle-list article > div { flex: 1 1 180px; overflow-wrap: anywhere; }
}
