:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18332b;
  background: #f5f7f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
html { overflow-x: hidden; scrollbar-gutter: stable; scrollbar-color: #b8c7d3 transparent; }
body { min-height: 100dvh; overflow-x: clip; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .side-nav::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, .sidebar::-webkit-scrollbar-track, .side-nav::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, .side-nav::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #b8c7d3; background-clip: padding-box; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; display: flex; width: 250px; flex-direction: column;
  min-height: 0; padding: 29px 18px 22px; border-right: 1px solid #e6ece8; background: #fff; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; color: #174e40; font-size: 21px; font-weight: 750; letter-spacing: -.8px; }
.brand-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: #0b6b53; color: #fff; font-size: 17px; }
.sidebar-copy { margin: 46px 12px 13px; color: #9aa69f; font-size: 9px; font-weight: 750; letter-spacing: 1.1px; }
.side-nav { display: grid; flex: 0 0 auto; gap: 6px; }
.side-link { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 11px; color: #75817b; font-size: 13px; font-weight: 550; }
.side-link > span { width: 18px; color: #839189; font-size: 17px; text-align: center; }
.side-link.active { background: #eaf4f0; color: #0b6b53; }
.side-link.active > span, .side-link.master-link > span { color: #0b6b53; }
.side-link.disabled { opacity: .68; }
.side-link.master-link { margin-top: 13px; border: 1px solid #e1eee8; background: #f7fbf8; color: #21654f; }
.sidebar-bottom { display: grid; gap: 13px; margin-top: auto; }
.connection-label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: #718078; font-size: 11px; }
.online-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #2aa37a; }
.logout-button { width: 100%; min-height: 44px; border: 1px solid #e5ebe7; border-radius: 10px; background: #fff; color: #64726b; cursor: pointer; font-size: 12px; }
.logout-button:hover { border-color: #cddbd4; background: #f7faf8; }

.main-content { width: min(1120px, calc(100% - 250px)); min-height: 100vh; margin-left: 250px; padding: 39px 54px 42px; }
.eyebrow { display: block; margin: 0 0 8px; color: #839189; font-size: 9px; font-weight: 750; letter-spacing: 1.15px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 0; color: #18332b; font-size: 26px; font-weight: 650; letter-spacing: -.85px; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 7px 11px 7px 7px; border: 1px solid #e6ece8; border-radius: 999px; background: #fff; }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #e8f3ed; color: #0b6b53; font-size: 13px; font-weight: 750; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.user-pill strong, .user-pill small { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill strong { color: #45574e; font-size: 11px; font-weight: 650; }
.user-pill small { margin-top: 2px; color: #94a098; font-size: 10px; }

.welcome-banner { position: relative; display: flex; min-height: 220px; align-items: center; justify-content: space-between; overflow: hidden; margin-top: 34px; padding: 32px 38px; border-radius: 20px; background: #e6f2ed; }
.welcome-banner h2 { margin: 0 0 10px; color: #154e40; font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -1.2px; line-height: 1.16; }
.welcome-banner p { margin: 0; color: #5f7f74; font-size: 13px; }
.banner-symbol { display: grid; width: 94px; height: 94px; place-items: center; margin-right: 34px; border: 1px solid #cee2d8; border-radius: 28px; transform: rotate(-9deg); background: #fff; color: #dfa83c; font-size: 50px; box-shadow: 0 15px 35px #174e4012; }

.master-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 23px; padding: 19px 22px; border: 1px solid #dcebe3; border-radius: 15px; background: #fbfdfb; }
.master-panel .eyebrow { margin-bottom: 6px; color: #42816a; }
.master-panel h2 { margin: 0 0 5px; font-size: 16px; font-weight: 650; }
.master-panel p { max-width: 680px; margin: 0; color: #75847c; font-size: 12px; line-height: 1.6; }
.master-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #e8f4ed; color: #34795f; font-size: 10px; font-weight: 700; }

.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 35px 0 15px; }
.section-title .eyebrow { margin-bottom: 6px; }
.section-title h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #e6ece8; border-radius: 999px; background: #fff; color: #748079; font-size: 10px; }
.local-badge .online-dot { width: 7px; height: 7px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.summary-card { min-height: 143px; padding: 17px; border: 1px solid #e7ece9; border-radius: 15px; background: #fff; }
.summary-symbol { display: grid; width: 32px; height: 32px; place-items: center; margin-bottom: 14px; border-radius: 10px; font-size: 15px; }
.summary-symbol.green { background: #e6f3ed; color: #338263; }
.summary-symbol.amber { background: #fbf1dc; color: #af7c24; }
.summary-symbol.blue { background: #eaf0fb; color: #567db3; }
.summary-symbol.lilac { background: #f0ebfa; color: #7c65ac; }
.summary-label { display: block; color: #7b8981; font-size: 10px; }
.summary-card strong { display: inline-block; margin-top: 6px; color: #20372e; font-size: 22px; font-weight: 650; }
.summary-card small { margin-left: 5px; color: #a0aaa4; font-size: 10px; }
.dashboard-note { margin: 20px 0 0; color: #86928b; font-size: 11px; }

.login-layout { display: grid; min-height: calc(100vh - 80px); grid-template-columns: minmax(0, 1fr) minmax(310px, 410px); align-items: center; gap: 8%; }
.register-layout { display: grid; min-height: calc(100vh - 80px); grid-template-columns: minmax(0, 1fr) minmax(350px, 450px); align-items: center; gap: 6%; }
.login-intro { max-width: 490px; padding: 20px 0; }
.login-intro h1 { margin: 12px 0 15px; color: #174e40; font-size: clamp(35px, 5vw, 57px); font-weight: 650; letter-spacing: -2.4px; line-height: 1.08; }
.login-intro > p { max-width: 410px; color: #718078; font-size: 14px; line-height: 1.8; }
.trust-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 19px; padding: 10px 12px; border: 1px solid #e1ebe5; border-radius: 999px; background: #fff; color: #62746a; font-size: 11px; }
.login-card { padding: 29px; border: 1px solid #e6ece8; border-radius: 19px; background: #fff; box-shadow: 0 18px 60px #173a2c0a; }
.login-card-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 18px; border-radius: 13px; background: #eaf4f0; color: #0b6b53; font-size: 21px; }
.login-card h2 { margin: 0 0 7px; font-size: 20px; font-weight: 650; letter-spacing: -.5px; }
.login-card > p { margin: 0 0 20px; color: #849088; font-size: 12px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 7px; color: #516159; font-size: 11px; font-weight: 650; }
.login-form input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #dfe7e2; border-radius: 10px; outline: none; background: #fff; color: #263a31; font-size: 13px; }
.login-form input:focus { border-color: #4b9d7e; box-shadow: 0 0 0 3px #0b6b5314; }
.primary-button { display: flex; min-height: 46px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 0 15px; border: 0; border-radius: 10px; background: #0b6b53; color: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.primary-button:hover { background: #095c48; }
.primary-button span { font-size: 17px; }
.login-footnote { margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0ee; color: #929d96; font-size: 10px; line-height: 1.6; }
.login-footnote a, .back-link { color: #0b6b53; font-weight: 650; }
.login-footnote a:hover, .back-link:hover { text-decoration: underline; }
.register-card { padding: 25px; }
.register-card > .back-link { display: inline-block; margin-bottom: 18px; font-size: 11px; }
.register-card .login-card-icon { margin-bottom: 13px; }
.register-card > p { margin-bottom: 14px; }
.register-form { gap: 7px; }
.register-form input { min-height: 42px; }
.register-form .field-help { margin-top: -3px; color: #8a968f; font-size: 10px; line-height: 1.5; }
.optional-label { color: #9aa69f; font-size: 10px; font-weight: 400; }
.image-picker { display: flex; align-items: center; gap: 13px; margin-top: 2px; }
.image-preview { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px dashed #cddbd3; border-radius: 15px; background: #f7faf8; color: #6b8277; font-size: 23px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-picker-copy { display: grid; justify-items: start; gap: 5px; }
.image-picker-copy small { color: #929d96; font-size: 10px; }
.upload-button { display: inline-flex; min-height: 44px; align-items: center; padding: 0 11px; border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; color: #516159; cursor: pointer; font-size: 12px; font-weight: 600; }
.upload-button:hover { border-color: #a7c7b7; background: #f7faf8; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.register-form input.visually-hidden { width: 1px; min-height: 1px; padding: 0; border: 0; }
.visually-hidden:focus + .upload-button { outline: 2px solid #4b9d7e; outline-offset: 2px; }
.alert { margin: 0 0 14px; padding: 11px 12px; border: 1px solid #f1d7d2; border-radius: 9px; background: #fff5f3; color: #9a4338; font-size: 11px; line-height: 1.5; }
.alert[data-state="warning"] { border-color: #e8dfb5; background: #fffbee; color: #745f20; }
.setup-card { max-width: 590px; margin: 12vh auto; padding: 30px; border: 1px solid #e6ece8; border-radius: 18px; background: #fff; }
.setup-card h1 { font-size: 26px; }
.setup-card p { color: #718078; font-size: 13px; line-height: 1.7; }
.setup-card code { color: #0b6b53; }
.mobile-nav { display: none; }

@media (min-width: 1370px) {
  .main-content { margin-right: auto; margin-left: calc(250px + (100vw - 250px - 1120px) / 2); }
}
@media (max-width: 1050px) {
  .main-content { padding-right: 32px; padding-left: 32px; }
  .login-layout, .register-layout { gap: 4%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main-content { width: 100%; min-height: 100vh; margin: 0; padding: 25px 19px 100px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 22px; }
  .user-pill { max-width: 45%; padding-right: 8px; }
  .user-pill strong { max-width: 105px; font-size: 9px; }
  .user-pill small { font-size: 9px; }
  .welcome-banner { min-height: 194px; margin-top: 25px; padding: 25px 23px; }
  .welcome-banner h2 { font-size: 28px; }
  .welcome-banner p { max-width: 230px; font-size: 11px; line-height: 1.6; }
  .banner-symbol { position: absolute; right: -34px; bottom: -23px; width: 83px; height: 83px; margin: 0; opacity: .5; }
  .master-panel { align-items: flex-start; padding: 16px; }
  .master-panel p { font-size: 11px; }
  .master-badge { padding: 6px 8px; font-size: 9px; }
  .section-title { align-items: flex-end; margin-top: 29px; }
  .section-title h2 { font-size: 15px; }
  .local-badge { font-size: 9px; }
  .summary-grid { gap: 10px; }
  .summary-card { min-height: 132px; padding: 13px; }
  .summary-card strong { font-size: 20px; }
  .summary-label { font-size: 9px; }
  .summary-card small { display: block; margin: 2px 0 0; }
  .login-layout { min-height: calc(100vh - 120px); grid-template-columns: 1fr; align-content: center; gap: 22px; padding: 14px 0; }
  .register-layout { min-height: calc(100vh - 120px); grid-template-columns: 1fr; align-content: center; gap: 18px; padding: 14px 0; }
  .login-intro { padding: 0; }
  .login-intro h1 { max-width: 450px; margin: 7px 0 10px; font-size: 36px; letter-spacing: -1.6px; }
  .login-intro > p { margin-bottom: 0; font-size: 12px; line-height: 1.6; }
  .trust-note { margin-top: 13px; padding: 8px 10px; font-size: 10px; }
  .login-card { padding: 22px; }
  .register-card { padding: 20px; }
  .setup-card { margin: 7vh 0; padding: 23px; }
  .mobile-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; min-height: 67px; grid-template-columns: repeat(5, 1fr); padding: 7px 6px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #e5ebe7; background: #fffffff0; backdrop-filter: blur(12px); }
  .mobile-nav-item { display: flex; min-width: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #89948e; font-size: 9px; }
  .mobile-nav-item > span { font-size: 16px; line-height: 1; }
  .mobile-nav-item.active { color: #0b6b53; font-weight: 650; }
  .mobile-nav-item.action > span { display: grid; width: 36px; height: 36px; place-items: center; margin-top: -11px; border-radius: 12px; background: #0b6b53; color: #fff; font-size: 23px; box-shadow: 0 6px 16px #0b6b5338; }
}
@media (prefers-reduced-motion: no-preference) {
  .summary-card { transition: transform 160ms ease, box-shadow 160ms ease; }
  .summary-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px #173a2c0a; }
}
/* Workspace: mobile first, shared by the four main destinations. */
.workspace { color: #203247; background: #f1f4f8; }
.workspace button, .workspace a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.workspace [hidden] { display: none !important; }
.workspace .ui-icon { width: 24px; height: 24px; flex: 0 0 auto; vertical-align: middle; }
.workspace .sidebar { width: 240px; border-color: #e2e8f0; padding: 36px 20px 24px; }
.workspace .brand { gap: 9px; color: #193e68; font-size: 27px; letter-spacing: -1px; }
.workspace .brand-icon { background: #193e68; border-radius: 12px; width: 38px; height: 38px; font-size: 28px; }
.brand-dot { color: #168f7b; margin-left: -9px; }
.nav-caption { margin: 48px 14px 16px; color: #63758a; font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.workspace .side-link { min-height: 52px; padding: 12px 14px; color: #53677e; font-size: 16px; gap: 14px; }
.workspace .side-link.active { background: #eaf1fa; color: #245e9e; }
.workspace .side-link:hover { background: #f1f5fa; }
.sidebar-footnote { padding: 0 14px; color: #63758a; font-size: 13px; }
.workspace .main-content { width: min(1100px, calc(100% - 240px)); margin-left: 240px; padding: 36px 40px 48px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-kicker { margin: 0 0 5px; color: #62758e; font-size: 15px; line-height: 1.5; }
.dashboard-header h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); letter-spacing: -.8px; line-height: 1.2; }
.profile-button { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid #e1e8f0; border-radius: 50%; background: #fff; color: #405974; overflow: hidden; }
.profile-button img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.balance-card { min-width: 0; padding: 24px 28px; border-radius: 26px; color: #fff; background: #193e68; }
.balance-heading, .balance-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.balance-heading { color: #c6d7ec; font-size: 16px; }
.icon-button { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; flex: 0 0 auto; border: 0; border-radius: 50%; background: #edf3fa; color: #193e68; cursor: pointer; }
.privacy-button { color: #d6e4f4; background: #ffffff12; }
.balance-value { display: block; margin: 12px 0 24px; font-size: clamp(28px, 4.5vw, 46px); font-weight: 700; letter-spacing: -1px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.balance-footer { color: #c6d7ec; font-size: 14px; flex-wrap: wrap; }
.balance-footer a { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; color: #fff; }
.balance-footer .ui-icon { width: 17px; height: 17px; }
.amount-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.amount-card { min-width: 0; padding: 22px 24px 16px; border: 1px solid transparent; border-radius: 24px; background: #fff; }
.amount-label { display: flex; align-items: center; gap: 8px; color: #60748e; font-size: 16px; }
.amount-card strong { display: block; margin-top: 12px; font-size: clamp(21px, 2.6vw, 30px); letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.amount-hint { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: #63758a; font-size: 13px; }
.amount-hint .ui-icon { width: 16px; height: 16px; }
.income { color: #138474; }.expense { color: #c05b3e; }.blue { color: #286bb3; }
.surface { min-width: 0; padding: 26px; border-radius: 26px; background: #fff; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-heading h2 { margin: 0; font-size: clamp(19px, 2vw, 23px); font-weight: 650; letter-spacing: -.5px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; gap: 4px; color: #2567ad; font-size: 15px; white-space: nowrap; }
.text-link .ui-icon { width: 18px; height: 18px; }
.period-label { margin: 0 0 24px; color: #62758a; font-size: 14px; }
.result-content { display: flex; align-items: center; gap: 28px; }
.margin-ring { width: 160px; height: 160px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#168f7b var(--progress), #e6ecf3 0); }
.margin-ring.negative { background: #f7e1da; }
.margin-ring > div { display: flex; align-items: center; justify-content: center; flex-direction: column; width: 128px; height: 128px; border-radius: 50%; background: #fff; }
.margin-ring span { color: #60748e; font-size: 12px; }
.margin-ring strong { color: #193e68; font-size: 31px; }
.margin-ring.negative strong { color: #b14d35; }
.result-legend { display: grid; flex: 1; min-width: 0; gap: 18px; margin: 0; }
.result-legend > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.result-legend dt { display: flex; align-items: center; gap: 9px; font-size: 15px; color: #526781; }
.result-legend dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: #a4b2c4; }
.legend-dot.income { background: #168f7b; }.legend-dot.expense { background: #e9a644; }.legend-dot.result { background: #8e9fb4; }
.quick-symbol { display: grid; place-items: center; color: #286bb3; border: 2px solid; border-radius: 50%; width: 22px; height: 22px; }
.quick-symbol .ui-icon { width: 15px; height: 15px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.quick-action { display: flex; min-width: 0; min-height: 108px; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px 4px; border: 1px solid transparent; border-radius: 20px; background: #eff4fa; color: #354e6c; cursor: pointer; font-size: 16px; font-weight: 550; }
.quick-action .ui-icon { width: 27px; height: 27px; }
.quick-action:hover, .amount-card:hover { border-color: #b8cde5; background: #f8fbff; }
.quick-action:active { background: #dce9f8; }
.workspace :is(a, button, input):focus-visible { outline: 3px solid #337bd2; outline-offset: 4px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 30; padding: 14px; border-radius: 12px; background: #fff; transform: translateY(-150%); }.skip-link:focus { transform: none; }
.button-primary { display: inline-flex; min-height: 48px; justify-content: center; align-items: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 13px; background: #193e68; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.button-primary:hover { background: #245584; }.button-primary:disabled { opacity: .65; cursor: wait; }.compact { padding: 10px 14px; }
.filter-tabs { display: flex; gap: 6px; padding: 5px; margin: 24px 0; border-radius: 14px; background: #f0f4f9; }
.filter-tabs a { display: flex; min-height: 46px; align-items: center; justify-content: center; flex: 1; padding: 10px; border-radius: 10px; color: #526781; }
.filter-tabs a[aria-current] { color: #193e68; background: #fff; box-shadow: 0 2px 8px #193e6810; font-weight: 650; }
.list-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: #60748e; }
.list-total strong { color: #203247; font-size: 24px; overflow-wrap: anywhere; }
.empty-state { padding: 40px 12px; text-align: center; }.empty-state h3 { font-size: 20px; margin: 16px 0 8px; }.empty-state p { margin: 8px 0 22px; color: #60748e; line-height: 1.6; }
.empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; background: #eff4fa; color: #286bb3; border-radius: 20px; }
.record-list { margin: 24px 0 0; padding: 0; list-style: none; }.record-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-top: 1px solid #e8edf4; }.record-list li > div { min-width: 0; }.record-list strong { font-size: 16px; overflow-wrap: anywhere; }.record-list li > strong { flex: 0 1 45%; text-align: right; }.record-list li > div > span { display: block; margin-top: 7px; color: #62758a; font-size: 14px; }.record-list .overdue { color: #b14d35; }
.report-values { margin: 30px 0; }.report-values > div { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid #e8edf4; }.report-values dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }.report-values > div:last-child { color: #193e68; font-size: 20px; }.muted-note, .data-note { color: #60748e; font-size: 14px; line-height: 1.7; }.data-note { background: #f0f4f9; padding: 16px; border-radius: 12px; }
.profile-surface { max-width: 600px; }.profile-email { overflow-wrap: anywhere; }.workspace .logout-button { min-height: 48px; font-size: 16px; margin-top: 16px; color: #a14935; }
.success-message { padding: 14px 18px; color: #126657; border-radius: 14px; background: #def2e9; font-size: 15px; }
.workspace .alert { font-size: 14px; line-height: 1.6; }
.quick-dialog { width: min(100% - 32px, 500px); max-height: calc(100dvh - 40px); margin: auto; padding: 28px; border: 0; border-radius: 26px; background: #fff; color: #203247; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 24px 100px #102b4a30; }
.quick-dialog::backdrop { background: #10243e75; backdrop-filter: blur(3px); }
dialog, dialog * { scrollbar-width: thin; scrollbar-color: #c4d1cb transparent; }
dialog { scrollbar-gutter: stable; }
dialog:hover, dialog:focus-within { scrollbar-color: #9fb5ab transparent; }
dialog::-webkit-scrollbar, dialog *::-webkit-scrollbar { width: 6px; height: 6px; }
dialog::-webkit-scrollbar-track, dialog *::-webkit-scrollbar-track { background: transparent; }
dialog::-webkit-scrollbar-thumb, dialog *::-webkit-scrollbar-thumb { background: #c4d1cb; border-radius: 999px; }
dialog::-webkit-scrollbar-thumb:hover, dialog *::-webkit-scrollbar-thumb:hover { background: #9fb5ab; }
@media (forced-colors: active) { dialog, dialog * { scrollbar-color: auto; } }
body.dialog-open { overflow: hidden; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }.sheet-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.5px; }
.quick-form { display: grid; gap: 9px; }.quick-form label { font-size: 15px; font-weight: 550; }.quick-form input:not([type=hidden]) { width: 100%; min-width: 0; min-height: 52px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid #cbd6e4; border-radius: 12px; background: #fff; color: #203247; font: inherit; font-size: 16px; }.quick-form small { color: #62758a; margin: -10px 0 10px; font-size: 13px; }.form-field { display: grid; gap: 9px; }.form-note { color: #60748e; line-height: 1.6; font-size: 14px; margin: 4px 0 10px; }.save-button { width: 100%; }.quick-form .optional-label { font-size: 13px; color: #62758a; }
/* Readable auth forms and comfortable touch targets also apply before login. */
.login-form label { font-size: 14px; }.login-form input, .register-form input { min-height: 48px; font-size: 16px; }.primary-button { min-height: 48px; font-size: 16px; }.login-card > p, .login-intro > p { font-size: 15px; }.login-footnote, .register-form .field-help, .image-picker-copy small { font-size: 13px; }.upload-button { min-height: 44px; font-size: 14px; }.back-link { display: inline-flex; align-items: center; min-height: 44px; }.login-footnote a { display: inline-flex; min-height: 44px; align-items: center; }
.device-management { margin-top: 14px; }.device-management h2 { margin-bottom: 6px; }.device-list { display: grid; gap: 8px; margin-top: 12px; }.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #e5ece8; border-radius: 10px; background: #fbfdfc; }.device-row strong, .device-row small { display: block; }.device-row small { margin-top: 3px; color: #7d8b83; font-size: 12px; }.device-row form { flex: 0 0 auto; }
@media (min-width: 1370px) { .workspace .main-content { margin-left: calc(240px + (100vw - 240px - 1100px) / 2); } }
@media (min-width: 1000px) { .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.balance-card, .amount-grid { grid-column: 1 / -1; }.balance-card { padding: 26px 32px; }.result-content { gap: 20px; flex-wrap: wrap; justify-content: center; }.result-legend { flex-basis: 100%; }.quick-card { display: flex; flex-direction: column; }.quick-grid { flex: 1; align-items: center; }.quick-action { min-height: 140px; } }
@media (max-width: 760px) {
  .workspace .main-content { width: 100%; margin: 0; padding: 24px 16px calc(108px + env(safe-area-inset-bottom)); }
  .workspace .sidebar { display: none; }.dashboard-header { margin-bottom: 24px; }.dashboard-header h1 { font-size: 27px; }
  .workspace .mobile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 76px; padding: 9px 12px max(9px, env(safe-area-inset-bottom)); border-color: #e1e8f0; background: #f8fafdf5; }
  .workspace .mobile-nav-item { min-height: 54px; gap: 6px; color: #5d7088; font-size: 12px; border-radius: 14px; }
  .workspace .mobile-nav-item.active { color: #235f9f; background: #e9f1fb; font-weight: 650; }.workspace .mobile-nav-item .ui-icon { width: 23px; height: 23px; }.workspace .mobile-nav-item > span { font-size: 12px; line-height: 1.3; }
  .dashboard-grid { gap: 16px; }.balance-card { padding: 20px; border-radius: 24px; }.balance-value { font-size: clamp(29px, 8vw, 40px); margin: 12px 0 18px; }.balance-footer { font-size: 13px; gap: 0; }.balance-footer > span { max-width: 60%; }
  .amount-grid { gap: 12px; }.amount-card { padding: 18px 14px 14px; border-radius: 22px; }.amount-label { gap: 5px; font-size: 15px; }.amount-label .ui-icon { width: 20px; height: 20px; }.amount-card strong { font-size: clamp(20px, 5.5vw, 27px); }
  .surface { padding: 20px; border-radius: 24px; }.result-content { gap: 18px; }.margin-ring { width: 126px; height: 126px; }.margin-ring > div { width: 100px; height: 100px; }.margin-ring span { font-size: 10px; }.margin-ring strong { font-size: 27px; }.result-legend { gap: 15px; }.result-legend > div { display: block; }.result-legend dt { font-size: 14px; gap: 7px; }.result-legend dd { margin: 5px 0 0 17px; font-size: 15px; }
  .quick-grid { gap: 10px; margin-top: 18px; }.quick-action { min-height: 100px; border-radius: 18px; font-size: 15px; }.text-link { font-size: 14px; gap: 0; }.period-label { margin-bottom: 20px; }.card-heading h2 { font-size: 20px; }
  .quick-dialog { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }.sheet-heading { margin-bottom: 22px; }
  .record-list li { flex-wrap: wrap; gap: 12px; }.record-list li > strong { flex-basis: auto; }.report-values > div { flex-wrap: wrap; }.compact { padding: 10px 12px; font-size: 15px; }
}
@media (max-width: 350px) { .surface { padding: 16px; }.card-heading h2 { font-size: 18px; }.result-content { gap: 12px; }.margin-ring { width: 110px; height: 110px; }.margin-ring > div { width: 88px; height: 88px; }.margin-ring span { font-size: 9px; }.result-legend dd { font-size: 14px; }.quick-action { font-size: 14px; }.amount-card { padding: 16px 11px; }.amount-card strong { font-size: 20px; } }
@media (prefers-reduced-motion: no-preference) { .workspace :is(.quick-action, .amount-card, .profile-button, .side-link) { transition: background-color .15s ease, border-color .15s ease; } }
.workspace .margin-ring.values-hidden { background: #e6ecf3; }
@media (min-width: 761px) {
  .workspace .sidebar { z-index: 31; transform: translateX(-102%); visibility: hidden; opacity: 0; transition: transform .2s ease, opacity .2s ease, visibility 0s linear .2s; box-shadow: 12px 0 30px #173a2c00; }
  .workspace.sidebar-open .sidebar, body.sidebar-open .workspace .sidebar { transform: translateX(0); visibility: visible; opacity: 1; transition-delay: 0s; box-shadow: 12px 0 30px #173a2c18; }
  .workspace .main-content { width: 100%; max-width: none; margin-left: 0; margin-right: 0; padding-right: 48px; padding-left: 48px; }
  .local-workspace .dashboard-header .local-header-nav { position: relative; z-index: 29; display: flex; align-items: center; gap: 5px; justify-self: start; grid-column: 1; grid-row: 1; }
  .local-workspace .dashboard-header .notification-bell,
  .local-workspace .dashboard-header .profile-button { grid-column: auto; grid-row: auto; }
  .sidebar-toggle, .sidebar-back, .sidebar-home, .sidebar-shortcut { position: static; display: inline-grid; width: 44px; height: 44px; min-width: 44px; min-height: 44px; place-items: center; padding: 0; border: 1px solid #d5e0eb; border-radius: 50%; background: #fff; color: #193e68; box-shadow: 0 6px 18px #173a2c12; cursor: pointer; }
  .sidebar-toggle:hover, .sidebar-back:hover, .sidebar-home:hover, .sidebar-shortcut:hover { border-color: #aebfd0; background: #f6f9fc; }
  .local-header-nav .sidebar-toggle .ui-icon, .local-header-nav .sidebar-back .ui-icon, .local-header-nav .sidebar-home .ui-icon { width: 24px; height: 24px; }
  .local-header-nav .sidebar-shortcut .ui-icon { width: 24px; height: 24px; }
  .sidebar-shortcut-pos { display: block; width: 27px; height: 27px; background: currentColor; -webkit-mask: url("brand/ui-icons/ui-pos.png") center / contain no-repeat; mask: url("brand/ui-icons/ui-pos.png") center / contain no-repeat; }
  .sidebar-scrim { position: fixed; z-index: 30; inset: 0; display: none; border: 0; background: #102b4426; cursor: pointer; }
  body.sidebar-open .sidebar-scrim { display: block; }
}
@media (max-width: 760px) { .local-header-nav, .sidebar-toggle, .sidebar-back, .sidebar-home, .sidebar-shortcut, .sidebar-scrim { display: none !important; } }
/* PWA installation is available without login and does not imply offline finance. */
[hidden] { display: none !important; }
.app-logo { display: block; width: 44px; height: 44px; flex: 0 0 auto; object-fit: contain; }
.brand-name { display: inline-block; }
.install-page { min-height: 100dvh; }
.install-layout { width: min(620px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 max(32px, env(safe-area-inset-bottom)); }
.install-layout > .back-link { margin-bottom: 16px; color: #245e9e; font-size: 15px; }
.install-card { padding: clamp(24px, 5vw, 40px); }
.install-app-icon { display: block; width: 80px; height: 80px; object-fit: contain; border-radius: 22px; margin-bottom: 24px; }
.install-card h1 { margin: 0; font-size: clamp(25px, 5vw, 32px); line-height: 1.2; letter-spacing: -.8px; }
.install-summary { color: #526781; font-size: 16px; line-height: 1.6; margin: 16px 0 20px; }
.install-status { padding: 14px 16px; background: #edf3fa; border-radius: 14px; color: #354e6c; font-size: 14px; line-height: 1.6; }
.install-button { width: 100%; margin: 6px 0 20px; }
.install-instruction { border-bottom: 1px solid #e1e8f0; }
.install-instruction summary { padding: 18px 0; min-height: 52px; cursor: pointer; font-size: 16px; font-weight: 600; color: #203247; }
.install-instruction ol { padding-left: 22px; color: #526781; line-height: 1.8; font-size: 15px; }
.install-instruction li { margin-bottom: 10px; padding-left: 2px; }
.login-footnote a + a { margin-left: 12px; }
/* Compact period navigation and one global quick-action entry point. */
.period-toolbar { display: flex; justify-content: center; margin: -8px 0 22px; }
.month-switcher { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid #dce4ee; border-radius: 999px; background: #ffffff75; }
.month-arrow { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; color: #526781; border-radius: 50%; }
.month-arrow:hover { background: #e5edf7; }.month-arrow[aria-disabled] { opacity: .35; }
.month-arrow .ui-icon { width: 18px; height: 18px; }
.period-picker { position: relative; min-width: 0; }
.period-picker summary { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; color: #354e6c; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; border-radius: 999px; }
.period-picker summary::-webkit-details-marker { display: none; }.period-picker summary::marker { content: ''; }
.period-picker summary small { margin-left: 3px; color: #62758a; font-size: 13px; font-weight: 400; }
.period-picker summary .ui-icon { width: 15px; height: 15px; }
.period-picker summary:hover { background: #e9eff7; }.workspace summary:focus-visible { outline: 3px solid #337bd2; outline-offset: 3px; }
.period-popover { position: absolute; z-index: 15; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); display: grid; gap: 12px; width: 250px; padding: 20px; border: 1px solid #dce4ee; border-radius: 20px; background: #fff; box-shadow: 0 14px 45px #193e6826; }
.period-popover label { color: #526781; font-size: 14px; }.period-popover input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid #cbd6e4; border-radius: 10px; color: #203247; background: #fff; font: inherit; font-size: 16px; }
.current-month-link { display: flex; min-height: 44px; align-items: center; justify-content: center; color: #245e9e; font-size: 14px; }
.quick-fab { position: fixed; z-index: 10; right: 32px; bottom: 32px; width: 60px; height: 60px; display: grid; place-items: center; padding: 0; border: 1px solid #bad3fa; border-radius: 22px; background: #8db6f5; color: #132b49; box-shadow: 0 6px 22px #193e682e; cursor: pointer; }
.quick-fab:hover { background: #a3c5fa; }.quick-fab:active { background: #76a5ed; }.quick-fab .ui-icon { width: 30px; height: 30px; stroke-width: 2; }
.actions-dialog { padding-bottom: 24px; }.actions-list { display: grid; gap: 10px; }
.action-row { display: flex; width: 100%; align-items: center; gap: 14px; min-height: 76px; padding: 12px; border: 1px solid transparent; border-radius: 18px; background: #f1f5fa; color: #203247; font-size: 16px; font-weight: 550; text-align: left; cursor: pointer; }
.action-row:hover { background: #e7eff9; border-color: #b8cde5; }.action-row > .ui-icon:last-child { width: 18px; height: 18px; margin-left: auto; color: #62758a; }.action-row-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: #fff; }
.workspace .result-card { grid-column: 1 / -1; }.workspace .main-content { padding-bottom: 128px; }.no-script-note { text-align: center; padding: 20px; color: #526781; }
@media (min-width: 1000px) { .period-toolbar { justify-content: flex-start; }.workspace .result-content { flex-wrap: nowrap; justify-content: flex-start; gap: 40px; }.workspace .result-legend { flex-basis: auto; max-width: 500px; } }
@media (max-width: 760px) { .quick-fab { right: 20px; bottom: calc(94px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; }.workspace .main-content { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }.period-toolbar { margin: -8px 0 20px; }.actions-dialog { padding-bottom: max(24px, env(safe-area-inset-bottom)); } }
/* One header row: brand, centered month, profile. */
.workspace .dashboard-header { display: grid; grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr); align-items: center; gap: 12px; margin: 0 0 24px; }
.header-brand { display: inline-flex; min-width: 0; min-height: 44px; align-items: center; justify-self: start; }
.header-brand picture { display: block; }.header-brand img { display: block; width: 160px; max-width: 100%; height: auto; }
.workspace .dashboard-header .period-toolbar { margin: 0; justify-self: center; justify-content: center; min-width: 0; }
.workspace .dashboard-header .profile-button { justify-self: end; width: 44px; height: 44px; }
.secondary-nav { padding-top: 18px; margin-top: 18px; border-top: 1px solid #e6edf5; }
@media (min-width: 761px) {
  .workspace .header-brand { display: none; }
  .workspace .dashboard-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .workspace .dashboard-header .period-toolbar { grid-column: 2; }
  .workspace .dashboard-header .profile-button { grid-column: 3; }
}
.workspace .quick-dialog { position: fixed; inset: auto; top: calc(var(--dialog-top, 0px) + var(--dialog-height, 100dvh) * .5); left: 50%; transform: translate(-50%, -50%); margin: 0; width: min(calc(100vw - 32px), 500px); max-width: 500px; max-height: calc(var(--dialog-height, 100dvh) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 24px; border-radius: 24px; overflow-y: auto; scroll-padding: 16px; }
.quick-form select, .product-fields input, .product-fields select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #cbd6e4; border-radius: 12px; padding: 11px 12px; background: #fff; color: #203247; font: inherit; font-size: 16px; margin-bottom: 10px; }
.product-fields { display: grid; gap: 9px; }.product-extra summary { min-height: 44px; display: flex; align-items: center; color: #245e9e; cursor: pointer; }.product-extra label { display: block; margin-bottom: 9px; }.product-extra[open] { padding-bottom: 6px; }
.catalog-item-actions { text-align: right; }.catalog-item-actions .text-link { justify-content: flex-end; }
/* Quick sale: catalog and checkout stay readable as two columns or one. */
.sale-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.sale-search-label { display: block; color: #526781; font-size: 14px; margin: 24px 0 9px; }
#sale-search { width: 100%; min-width: 0; min-height: 52px; border: 1px solid #cbd6e4; border-radius: 14px; padding: 12px 14px; background: #f8fafc; color: #203247; font: inherit; font-size: 16px; }
.sale-type-tabs { display: flex; gap: 6px; margin-top: 14px; }.sale-type-tabs button { flex: 1; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: #f0f4f9; color: #526781; font: inherit; font-size: 14px; cursor: pointer; }.sale-type-tabs button[aria-pressed=true] { background: #e4eefb; color: #193e68; border-color: #b8cde5; }
.sale-search-status { margin: 14px 0; font-size: 13px; }.sale-results { display: grid; gap: 8px; max-height: 500px; overflow-y: auto; overscroll-behavior-y: contain; }
.sale-result { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 74px; padding: 14px; border: 1px solid #e3eaf3; border-radius: 15px; color: #203247; background: #fff; text-align: left; cursor: pointer; }.sale-result:hover { background: #f1f6fc; border-color: #b8cde5; }.sale-result > span { min-width: 0; }.sale-result strong { font-size: 15px; overflow-wrap: anywhere; }.sale-result small { display: block; margin-top: 6px; color: #62758a; font-size: 13px; }.sale-result > strong { flex-shrink: 0; }.sale-result:disabled { opacity: .5; cursor: default; }
.cart-count { font-size: 14px; color: #62758a; }.sale-feedback { color: #245e9e; font-size: 14px; line-height: 1.6; margin-top: 14px; }.sale-feedback:empty { display: none; }.sale-cart { list-style: none; padding: 0; margin: 18px 0; }.cart-empty { color: #62758a; font-size: 15px; line-height: 1.6; padding: 16px 0; }
.cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 18px 0; border-bottom: 1px solid #e6edf5; }.cart-item-title { min-width: 0; }.cart-item-title strong { font-size: 15px; overflow-wrap: anywhere; }.cart-item-title small { display: block; font-size: 13px; color: #62758a; margin-top: 6px; }.cart-remove { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #f8ece7; color: #a14935; font-size: 24px; cursor: pointer; }.cart-line-total { justify-self: end; align-self: center; font-size: 16px; overflow-wrap: anywhere; }
.cart-stepper { display: inline-flex; align-items: center; width: 152px; gap: 4px; }.cart-stepper button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #edf3fa; color: #193e68; font-size: 23px; cursor: pointer; }.cart-stepper input { width: 56px; min-width: 0; height: 44px; padding: 6px 2px; border: 1px solid #cbd6e4; border-radius: 10px; background: #fff; text-align: center; font-size: 16px; color: #203247; -moz-appearance: textfield; }.cart-stepper input::-webkit-inner-spin-button, .cart-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sale-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 20px; color: #526781; }.sale-total strong { font-size: clamp(24px, 3vw, 30px); color: #193e68; overflow-wrap: anywhere; }.sale-payment-note { font-size: 13px; margin-bottom: 0; }
@media (max-width: 1100px) { .sale-layout { grid-template-columns: minmax(0, 1fr); }.header-brand img { width: 125px; } }
@media (max-width: 760px) {
  .workspace .dashboard-header { gap: 8px; }.header-brand { width: 44px; height: 44px; }.header-brand picture, .header-brand img { width: 40px; height: 40px; }
  .workspace .quick-dialog { width: calc(100vw - 24px); padding: 20px; border-radius: 22px; max-height: calc(var(--dialog-height, 100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .sale-layout { gap: 16px; }.sale-results { max-height: 300px; }.sale-result > strong { flex-shrink: 1; text-align: right; }.sale-catalog .card-heading h2 { font-size: 20px; }.actions-dialog .action-row { min-height: 62px; padding: 9px 12px; }.actions-dialog .sheet-heading { margin-bottom: 16px; }
}
@media (max-width: 420px) {
  .workspace .dashboard-header { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 5px; }
  .dashboard-header .month-switcher { gap: 0; padding: 0; background: transparent; border-color: transparent; }
  .dashboard-header .period-picker summary { gap: 0; padding: 3px 5px; min-width: 76px; font-size: 14px; }
  .dashboard-header .period-picker summary small { display: block; margin: 0; text-align: center; font-size: 11px; }.dashboard-header .period-picker summary > .ui-icon { display: none; }
  .dashboard-header .month-arrow { width: 44px; }.sale-total strong { font-size: 24px; }.cart-stepper { width: 144px; }.cart-stepper input { width: 48px; }
}
@media (max-height: 500px) { .workspace .quick-dialog { padding: 16px 20px; }.quick-dialog .sheet-heading { margin-bottom: 16px; }.quick-dialog .sheet-heading h2 { font-size: 22px; } }
.header-brand { max-width: 100%; }.header-brand picture { max-width: 100%; }
/* Dialog content must shrink inside its viewport; only vertical scrolling is allowed. */
.workspace .quick-dialog { min-width: 0; overflow-x: hidden; overscroll-behavior-x: none; }
.quick-dialog > *, .quick-dialog .quick-form, .quick-dialog .form-field, .quick-dialog .product-fields, .quick-dialog .schedule-fields, .quick-dialog .actions-list, .quick-dialog .product-extra { min-width: 0; max-width: 100%; }
.quick-dialog .quick-form, .quick-dialog .form-field, .quick-dialog .product-fields, .quick-dialog .schedule-fields { grid-template-columns: minmax(0, 1fr); }
.quick-dialog .sheet-heading > div { flex: 1; min-width: 0; }.quick-dialog .sheet-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.quick-dialog .action-row > span:not(.action-row-icon) { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.quick-dialog :is(label, p, small, summary) { overflow-wrap: anywhere; }
.quick-dialog :is(input, select, button) { max-width: 100%; }
.quick-dialog input[type=date] { display: block; min-inline-size: 0; inline-size: 100%; max-inline-size: 100%; }
.quick-dialog input[type=date]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.quick-dialog input[type=date]::-webkit-datetime-edit { min-width: 0; padding: 0; }
.schedule-fields { display: grid; gap: 9px; }.schedule-preview { margin: 0 0 10px; padding: 12px 14px; background: #edf3fa; border-radius: 12px; font-size: 14px; color: #354e6c; line-height: 1.6; }
.record-list .schedule-badge { display: inline-block; width: fit-content; max-width: 100%; padding: 4px 8px; background: #eaf1fa; color: #245e9e; font-size: 12px; border-radius: 8px; margin-top: 8px; }
.recurrence-manager { margin-top: 20px; }.recurrence-manager > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 600; cursor: pointer; }.recurrence-manager > summary span { font-size: 14px; color: #62758a; }
.recurrence-toggle { min-height: 44px; border: 1px solid #cbd6e4; border-radius: 12px; background: #f0f4f9; color: #245e9e; padding: 10px 16px; font: inherit; font-size: 14px; cursor: pointer; }.recurrence-toggle:hover { background: #e4eefb; }
@media (max-width: 380px) { .workspace .quick-dialog { padding: 18px 16px; }.quick-dialog .sheet-heading { gap: 8px; }.quick-dialog .sheet-heading h2 { font-size: 22px; } }

/* A single focused catalog keeps checkout available from every screen size. */
.sale-layout { grid-template-columns: minmax(0, 1fr); }
.sale-catalog { min-width: 0; }
.sale-catalog .card-heading { align-items: center; }
.sale-catalog .card-heading h2 { margin: 0; }
.sale-intro { margin: 6px 0 0; color: #62758a; font-size: 14px; line-height: 1.5; }
.sale-connectivity { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; background: #edf3fa; color: #354e6c; font-size: 13px; line-height: 1.5; }
.sale-connectivity[data-state="offline"] { background: #fff4e3; color: #855616; }
.sale-connectivity[data-state="ready"] { background: #e5f4ed; color: #21654f; }
.sale-connectivity[data-state="error"] { background: #fff0ed; color: #a14935; }
.sale-cart-trigger { display: flex; width: auto; min-width: 205px; height: 68px; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 18px; border-radius: 20px; background: #193e68; color: #fff; box-shadow: 0 8px 25px #193e6838; }
.sale-cart-trigger:hover, .sale-cart-trigger:active { background: #245584; }
.sale-cart-trigger > .ui-icon { width: 26px; height: 26px; flex: 0 0 auto; }
.sale-cart-trigger > span { display: grid; gap: 2px; text-align: left; }
.sale-cart-trigger strong { font-size: 15px; font-weight: 700; }
.sale-cart-trigger small { color: #d2deed; font-size: 12px; }
.sale-cart-dialog, .sale-payment-dialog { width: min(calc(100vw - 32px), 580px); max-width: 580px; max-height: min(90dvh, 850px); padding: 26px; }
.sale-payment-dialog { width: min(calc(100vw - 32px), 620px); max-width: 620px; }
.sale-cart-summary, .sale-payment-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #e1e8f0; color: #62758a; font-size: 14px; }
.sale-cart-summary strong, .sale-payment-total strong { color: #193e68; font-size: 24px; }
.sale-cart { max-height: min(45dvh, 420px); overflow: auto; overscroll-behavior: contain; }
.sale-cart .cart-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.sale-cart .cart-item-title { overflow-wrap: anywhere; }
.sale-cart .cart-stepper { grid-column: 1; }
.sale-cart .cart-line-total { grid-column: 2; grid-row: 2; }
.sale-cart-dialog #sale-form { padding-top: 16px; border-top: 1px solid #e1e8f0; }
.sale-payment-help { margin: 13px 0; color: #62758a; font-size: 14px; line-height: 1.5; }
.payment-method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.payment-method { display: flex; min-width: 0; min-height: 64px; align-items: center; gap: 10px; padding: 10px; border: 1px solid #dce4ee; border-radius: 14px; background: #fff; color: #354e6c; text-align: left; cursor: pointer; }
.payment-method:hover { border-color: #b8cde5; background: #f8fbff; }
.payment-method[aria-pressed="true"] { border-color: #286bb3; background: #edf4fd; box-shadow: 0 0 0 1px #286bb3; }
.payment-method-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #eaf1fa; color: #245e9e; font-size: 18px; font-weight: 700; }
.payment-method > span:last-child { display: grid; min-width: 0; gap: 3px; }
.payment-method strong { font-size: 14px; }
.payment-method small { color: #71839a; font-size: 11px; line-height: 1.3; }
.payment-lines { display: grid; gap: 8px; margin-top: 14px; }
.payment-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, .65fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid #e1e8f0; border-radius: 12px; }
.payment-line-title { min-width: 0; color: #354e6c; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.payment-line label { display: grid; gap: 4px; color: #71839a; font-size: 11px; }
.payment-line input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 9px; border: 1px solid #cbd6e4; border-radius: 9px; background: #fff; color: #203247; font: inherit; font-size: 15px; }
.payment-line .cart-remove { width: 44px; height: 44px; }
.payment-line-cash { grid-column: 1 / -1; }
.sale-payment-account, .sale-payment-due { margin-top: 14px; }
.sale-payment-account label, .sale-payment-due label { color: #526781; font-size: 13px; font-weight: 600; }
.sale-payment-account select, .sale-payment-due input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd6e4; border-radius: 11px; background: #fff; color: #203247; font: inherit; font-size: 16px; }
.sale-payment-feedback { min-height: 24px; margin: 12px 0 0; color: #62758a; font-size: 13px; line-height: 1.5; }
.sale-payment-feedback[data-state="error"] { color: #a14935; }
.sale-payment-feedback[data-state="success"] { color: #21654f; }
.sale-payment-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.sale-payment-actions .button-primary, .button-secondary { width: 100%; min-height: 48px; justify-content: center; font: inherit; font-size: 15px; }
.button-secondary { padding: 10px 14px; border: 1px solid #cbd6e4; border-radius: 13px; background: #fff; color: #354e6c; cursor: pointer; }
.button-secondary:hover { background: #f0f4f9; }
.sale-confirmation { margin: 14px 0 0; padding: 12px; border-radius: 12px; background: #e5f4ed; color: #21654f; font-size: 14px; line-height: 1.5; }
.offline-sales { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e1e8f0; }
.offline-sales h3 { margin: 0 0 8px; color: #354e6c; font-size: 15px; }
.offline-sales ul { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.offline-sale-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 11px 12px; border-radius: 12px; background: #f5f7fa; }
.offline-sale-row strong { color: #354e6c; font-size: 13px; overflow-wrap: anywhere; }
.offline-sale-row small { grid-column: 1; color: #71839a; font-size: 11px; line-height: 1.4; }
.offline-sale-row button { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 44px; padding: 7px 10px; border: 1px solid #dce4ee; border-radius: 9px; background: #fff; color: #354e6c; cursor: pointer; font: inherit; font-size: 12px; }
.offline-sale-row[data-state="conflict"] { background: #fff4e3; }
@media (max-width: 760px) {
  .sale-catalog .card-heading { align-items: flex-start; }
  .sale-catalog .card-heading .text-link { min-height: 44px; }
  .sale-cart-trigger { right: 16px; bottom: calc(94px + env(safe-area-inset-bottom)); min-width: 192px; height: 62px; border-radius: 18px; }
  .sale-cart-dialog, .sale-payment-dialog { width: calc(100vw - 24px); max-width: 620px; max-height: calc(var(--dialog-height, 100dvh) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 20px; border-radius: 22px; }
  .sale-cart { max-height: min(38dvh, 330px); }
}
@media (max-width: 420px) {
  .sale-catalog .card-heading { gap: 8px; }
  .sale-catalog .card-heading .text-link { font-size: 13px; }
  .payment-method-grid { gap: 7px; }
  .payment-method { min-height: 60px; gap: 7px; padding: 8px; }
  .payment-method-icon { width: 32px; height: 32px; }
  .payment-method strong { font-size: 13px; }
  .payment-method small { font-size: 10px; }
  .payment-line { grid-template-columns: minmax(0, 1fr) minmax(88px, .7fr) auto; padding: 8px; }
  .sale-payment-actions { grid-template-columns: minmax(0, 1fr); }
  .sale-payment-actions .button-primary { grid-row: 1; }
}

.action-group summary { padding: 16px 4px; cursor: pointer; font-weight: 600; }
.action-group + .action-group { border-top: 1px solid var(--border, #e5e7eb); }
.action-group .action-row { font-size: .9rem; min-height: 44px; }
.background-sync-status { max-width: 680px; margin: 8px auto; padding: 0 20px; }
.local-sales-report { margin-top: 16px; }
.local-sales-report > summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-size: .9rem; }
.local-sales-report > summary strong { float: right; margin-left: 12px; }
.settlement-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; max-width: 48%; }
.settlement-link { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.settlement-description { overflow-wrap: anywhere; font-weight: 600; }
.finance-records li > div:first-child { flex: 1; }
.management-editor { width: 100%; max-width: 560px; padding: 24px; margin: 0 auto 24px; }
.management-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.management-filters input, .management-filters select { min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd6e4; border-radius: 10px; background: #fff; color: #203247; font: inherit; font-size: 16px; }
.management-filters input { flex: 1 1 180px; }
.management-filters select { flex: 0 1 130px; }
.management-filters .button-secondary { width: auto; min-height: 44px; }
.management-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 50%; }
.management-records li > div:first-child { flex: 1; }
.management-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.management-links a, .management-pagination a, .management-account-link { display: inline-flex; align-items: center; min-height: 44px; }
.management-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 20px; color: #62758a; font-size: 14px; }
.quick-form textarea { width: 100%; min-height: 90px; padding: 12px; border: 1px solid #cbd6e4; border-radius: 12px; font: inherit; font-size: 16px; resize: vertical; }
.quick-reference-options { margin-bottom: 12px; }
.template-apply { min-height: 44px; width: fit-content; border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }
.management-account-link + .management-account-link { margin-left: 16px; }
@media (max-width: 380px) { .management-editor { padding: 18px 16px; } .management-links { gap: 8px; } }

/* Shared navigation and scrolling: keep controls reachable at every viewport size. */
.workspace .sidebar > .secondary-nav {
  min-height: 0;
  margin-right: -8px;
  padding-right: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8c7d3 transparent;
}
.workspace .sidebar-bottom { flex: 0 0 auto; padding-top: 12px; background: #fff; }
.workspace .main-content, .workspace .surface, .workspace .card-heading { min-width: 0; }
.notification-menu, .period-popover { max-width: calc(100vw - 24px); max-height: min(70dvh, 520px); overflow: auto; overscroll-behavior: contain; }
.mobile-nav-more { position: static; min-width: 0; }
.mobile-nav-more > summary { box-sizing: border-box; width: 100%; list-style: none; cursor: pointer; }
.mobile-nav-more > summary::-webkit-details-marker { display: none; }
.mobile-nav-more > summary::marker { content: ''; }
.mobile-nav-more.active > summary { color: #235f9f; background: #e9f1fb; font-weight: 650; }
.mobile-nav-menu { position: absolute; right: 12px; bottom: calc(100% + 8px); display: flex; width: min(380px, calc(100vw - 24px)); max-height: min(72dvh, 600px); flex-direction: column; gap: 12px; overflow: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid #dce5ef; border-radius: 22px; background: #fff; box-shadow: 0 18px 48px #18365433; }
.mobile-nav-menu-heading { position: sticky; z-index: 1; top: -16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -16px -16px 0; padding: 16px 16px 12px; border-bottom: 1px solid #edf1f5; background: #fff; }
.mobile-nav-menu-heading strong, .mobile-nav-menu-heading span { display: block; }
.mobile-nav-menu-heading strong { color: #173b5f; font-size: 15px; }
.mobile-nav-menu-heading span { margin-top: 3px; color: #718096; font-size: 12px; }
.mobile-nav-close { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #edf3fa; color: #193e68; cursor: pointer; }
.mobile-nav-section-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-nav-section-links a { display: flex; min-width: 0; min-height: 52px; align-items: center; gap: 9px; padding: 8px; border: 1px solid #edf1f5; border-radius: 14px; background: #fbfcfd; color: #344b63; font-size: 12px; font-weight: 600; }
.mobile-nav-section-links a .ui-icon { width: 25px; height: 25px; flex: 0 0 25px; }
.mobile-nav-section-links a span { min-width: 0; overflow-wrap: anywhere; }
.mobile-nav-section-links a.active { border-color: #b8cce0; background: #edf4fb; color: #173b5f; }
@media (max-width: 760px) {
  .workspace .mobile-nav { z-index: 20; }
  .workspace .mobile-nav > .mobile-nav-more { display: block; align-self: stretch; visibility: visible; opacity: 1; }
  .workspace .mobile-nav-more > summary.mobile-nav-item { display: flex; width: 100%; height: 100%; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
}
@media (max-width: 380px) {
  .workspace .mobile-nav { padding-right: 4px; padding-left: 4px; }
  .workspace .mobile-nav-item { min-width: 0; font-size: 11px; }
  .workspace .mobile-nav-item .ui-icon { width: 21px; height: 21px; }
  .mobile-nav-menu { right: 6px; width: calc(100vw - 12px); padding: 14px; }
  .mobile-nav-menu-heading { top: -14px; margin: -14px -14px 0; padding: 14px; }
}
@media (forced-colors: active) {
  html, .workspace .sidebar > .secondary-nav { scrollbar-color: auto; }
}
