.local-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.local-header label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.local-header input { min-height: 44px; min-width: 0; max-width: 180px; font: inherit; font-size: 16px; border: 1px solid #d5e2de; border-radius: 12px; padding: 8px; background: white; }
.local-workspace .mobile-nav a { min-height: 56px; justify-content: center; font-size: 14px; }
.local-workspace .mobile-nav-more { position: static; min-width: 0; overflow: visible; }
.local-workspace .mobile-nav-more > summary { width: 100%; box-sizing: border-box; list-style: none; cursor: pointer; }
.local-workspace .mobile-nav-more > summary::-webkit-details-marker { display: none; }
.local-workspace .mobile-nav-more > summary::marker { content: ''; }
.local-workspace .mobile-nav { z-index: 11; }
.local-workspace .mobile-nav-more.active > summary { color: #235f9f; background: #e9f1fb; font-weight: 650; }
.local-workspace .mobile-nav-menu { position: absolute; right: 12px; bottom: calc(100% + 8px); display: flex; width: min(380px, calc(100vw - 40px)); max-height: min(72dvh, 600px); flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid #dce5ef; border-radius: 22px; background: #fff; box-shadow: 0 18px 48px #18365433; }
.local-workspace .mobile-nav-menu-heading { display: flex; align-items: center; justify-content: space-between; padding: 1px 2px 11px; border-bottom: 1px solid #edf1f5; }
.local-workspace .mobile-nav-close { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid #e6ebf0; border-radius: 13px; background: #f7f9fb; color: #52667b; cursor: pointer; flex: 0 0 auto; }
.local-workspace .mobile-nav-close:hover { border-color: #cbd7e2; background: #edf3f8; color: #173b5f; }
.local-workspace .mobile-nav-close > .ui-icon { width: 20px; height: 20px; }
.local-workspace .mobile-nav-menu-heading strong, .local-workspace .mobile-nav-menu-heading span { display: block; }
.local-workspace .mobile-nav-menu-heading strong { color: #173b5f; font-size: 15px; font-weight: 750; }
.local-workspace .mobile-nav-menu-heading span { margin-top: 3px; color: #718096; font-size: 12px; }
.local-workspace .mobile-nav-sections { display: grid; gap: 13px; }
.local-workspace .mobile-nav-section { min-width: 0; }
.local-workspace .mobile-nav-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; color: #718096; font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.local-workspace .mobile-nav-section h2::after { height: 1px; flex: 1; background: #edf1f5; content: ''; }
.local-workspace .mobile-nav-section-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.local-workspace .mobile-nav-menu a { display: flex; min-width: 0; min-height: 50px; align-items: center; gap: 9px; padding: 7px; border: 1px solid #edf1f5; border-radius: 14px; background: #fbfcfd; color: #344b63; font-size: 12px; font-weight: 600; line-height: 1.2; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.local-workspace .mobile-nav-menu a > .ui-icon { box-sizing: border-box; width: 36px; height: 36px; padding: 8px; flex: 0 0 36px; color: var(--icon-ink, #315a7e); background: var(--icon-tint, #edf3f7); border-radius: 11px; }
.local-workspace .mobile-nav-menu a > span { min-width: 0; overflow-wrap: anywhere; }
.local-workspace .mobile-nav-menu a:hover { transform: translateY(-1px); border-color: var(--icon-ink, #9db2c4); background: var(--icon-tint, #f2f6f9); }
.local-workspace .mobile-nav-menu a.active { border-color: #b8cce0; background: #edf4fb; color: #173b5f; font-weight: 700; }
.local-workspace .mobile-nav-more > summary:focus-visible, .local-workspace .mobile-nav-menu a:focus-visible, .local-workspace .mobile-nav-close:focus-visible { outline: 3px solid #337bd2; outline-offset: 2px; }
@media (max-width:760px) { .local-workspace .mobile-nav > .mobile-nav-more { display:block; align-self:stretch; visibility:visible; opacity:1; } .local-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; } }
.local-data-note { padding: 18px; margin-top: 24px; font-size: 14px; }
.local-data-note summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.local-data-note p { margin: 8px 0 16px; line-height: 1.5; }
.local-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; align-items: center; }
.local-toolbar a, .local-toolbar button { min-height: 44px; }
.local-list { display: grid; gap: 12px; margin: 16px 0; }
.local-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px; min-width: 0; }
.local-row > div { min-width: 0; overflow-wrap: anywhere; }
.local-row h3 { margin: 0 0 6px; font-size: 16px; }
.local-row p { margin: 4px 0; font-size: 14px; }
.local-row .local-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.local-actions button, .local-toolbar button { min-height: 44px; padding: 8px 12px; border: 1px solid #c9dcd5; border-radius: 10px; color: #075f4d; background: white; cursor: pointer; font: inherit; }
.local-form { display: grid; gap: 10px; padding: 24px; }
.local-form input, .local-form select { width: 100%; min-height: 44px; border: 1px solid #cadbd5; border-radius: 10px; padding: 10px; font: inherit; font-size: 16px; background: white; }
.local-form [hidden], .local-workspace [hidden] { display: none !important; }
.local-form details > label { display: block; margin-top: 10px; }
.local-form details > summary { min-height: 44px; cursor: pointer; }
.local-close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 28px; cursor: pointer; }
.local-workspace .quick-fab { font-size: 32px; }
.local-balance { background: #123b62; color: white; padding: 28px; border-radius: 24px; margin-bottom: 20px; }
.local-balance p { margin: 0 0 8px; }
.local-balance strong { font-size: clamp(26px, 5vw, 38px); overflow-wrap: anywhere; }
.local-search { width: 100%; min-height: 44px; padding: 12px; border: 1px solid #cadbd5; border-radius: 12px; font-size: 16px; margin: 12px 0; }
.backup-confirm { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; padding: 12px 0; }
.backup-confirm input { min-width: 24px; width: 24px; height: 24px; }
.backup-reminder { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 12px 14px; padding: 16px 18px; margin: 18px 0 22px; overflow: hidden; border: 1px solid #cfe5dc; border-radius: 20px; background: linear-gradient(112deg,#f5fbf7 0%,#fff 76%); color: #10365e; box-shadow: 0 10px 28px #174b3c0b; }
.backup-reminder::before { content: ""; position: relative; z-index: 1; grid-column: 1; grid-row: 1; width: 44px; height: 44px; border: 1px solid #cde6dc; border-radius: 14px; background-color: #e7f5ed; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2307856f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5'/%3E%3Cpath d='M5 16v4h14v-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 23px; }
.backup-reminder p { position: relative; z-index: 1; grid-column: 2; grid-row: 1; margin: 0; color: #365c53; font-size: 14px; font-weight: 600; line-height: 1.5; }
.backup-reminder > div { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.backup-reminder button { min-height: 44px; padding: 0 15px; border-radius: 12px; font-size: 13px; font-weight: 700; transition: background-color .18s ease,border-color .18s ease,transform .18s ease; }
.backup-reminder #local-backup-now { border: 1px solid #08715f; background: #07856f; color: #fff; box-shadow: 0 5px 14px #07856f24; }
.backup-reminder #local-backup-now:hover { transform: translateY(-1px); background: #066c5c; }
.backup-reminder #local-backup-later { border: 1px solid transparent; background: transparent; color: #526b60; }
.backup-reminder #local-backup-later:hover { border-color: #d5e7df; background: #fff; }
.backup-reminder button:focus-visible { outline: 3px solid #07856f; outline-offset: 3px; }
.backup-reminder[hidden] { display: none; }
#backup-section .local-form { padding: 16px; }
#backup-section button { min-height: 44px; }
.backup-help { margin: 12px 0 16px; padding: 0 14px; border: 1px solid var(--brand-line); border-radius: 12px; background: #f8fbf9; }
.backup-help > summary { min-height: 44px; font-size: 14px!important; font-weight: 650!important; }
.backup-help p { margin: 0 0 12px; color: var(--brand-muted); font-size: 13px; line-height: 1.5; }
.backup-actions-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.backup-action-card { align-content: start; box-sizing: border-box; margin: 0; border: 1px solid var(--brand-line); border-radius: 18px; background: #fbfdfc; }
.backup-action-card:focus-within { border-color: #8ec8b7; box-shadow: 0 0 0 3px #dff2eb; }
.backup-action-kicker { color: var(--brand-green); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.backup-action-card h2 { margin: 4px 0 10px!important; font-size: 19px!important; }
.backup-action-card label { color: var(--brand-navy); font-size: 13px; font-weight: 650; }
.backup-action-card input { width: 100%; box-sizing: border-box; min-height: 46px; border: 1px solid #cfddd7; border-radius: 11px; background: #fff; }
.backup-action-card .button-primary { width: 100%; min-height: 48px; margin-top: 6px; border: 0; border-radius: 12px; box-shadow: 0 7px 18px #07856f1c; font-weight: 750; }
.backup-danger-zone { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 8px; padding:14px; border:1px solid #efd2ce; border-radius:14px; background:#fffafa; }
.backup-danger-zone>div { min-width:0; }.backup-danger-zone strong,.backup-danger-zone span { display:block; }.backup-danger-zone strong { color:#8f2f27; font-size:14px; }.backup-danger-zone span { margin-top:3px; color:#7b6966; font-size:12px; line-height:1.4; }
.backup-danger-zone .button-danger { flex:0 0 auto; min-height:44px; padding:0 14px; border:1px solid #d9aaa4; border-radius:11px; background:#fff; color:#a23b32; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.local-workspace #local-content select { min-height: 44px; max-width: 100%; font-size: 16px; padding: 10px; border: 1px solid #cadbd5; border-radius: 12px; }
.local-workspace #local-content button { min-height: 44px; padding: 8px 12px; border: 1px solid #c9dcd5; border-radius: 10px; background: white; color: #075f4d; cursor: pointer; font: inherit; }
@media (max-width: 480px) { .local-header { gap: 8px; } .local-header > .text-link { font-size: 12px; } .local-header label { gap: 4px; } .local-header input { max-width: 156px; } .local-row { align-items: flex-start; flex-direction: column; gap: 10px; } .local-row .local-actions { width: 100%; justify-content: flex-start; } }

.offline-month{display:flex;justify-content:center}
.offline-month input[type=month]{min-height:44px;padding:0 14px;border:1px solid #dfe9e6;border-radius:999px;background:#f2f6f5;color:#10365e;font:inherit;font-weight:700;text-align:center}
#local-status{margin:0 4px 12px}

.filter-tabs button{flex:1;min-height:44px;border:0;border-radius:999px;background:transparent;color:#10365e;font:inherit;font-weight:700;cursor:pointer}
.filter-tabs button[aria-current=page]{background:#07856f;color:#fff}
.button-primary.compact{min-height:44px;padding:0 14px}

.workspace .filter-tabs{display:flex;gap:6px;padding:4px;background:#f2f6f5;border-radius:999px}
.workspace .filter-tabs button[aria-current=page]{background:#07856f;color:#fff;border-color:#07856f}
.workspace .filter-tabs button:not([aria-current]){background:transparent;border:0}

.workspace .filter-tabs button{background:transparent!important;border:0!important;box-shadow:none!important;color:#10365e!important}
.workspace .filter-tabs button[aria-current=page]{background:#07856f!important;color:#fff!important}

.finance-row .overdue{color:#b14d35;font-weight:600}
.finance-row .schedule-badge{display:inline-block;padding:3px 8px;border-radius:8px;font-size:12px;margin:0 0 4px}
.finance-row strong{font-variant-numeric:tabular-nums}
.empty-state .empty-icon{display:inline-grid;place-items:center;width:56px;height:56px;border-radius:50%;background:#e6f4f1;color:#07856f}
.empty-state .empty-icon svg{width:26px;height:26px}

/* Reuse the PHP workspace components, with only local-shell adaptations. */
.local-workspace .dashboard-header { grid-template-columns: 44px minmax(0, 1fr) 92px; }
.local-workspace .dashboard-header .header-brand { display: inline-flex; grid-column: 1; grid-row: 1; }
.local-workspace .header-brand img { width: 40px; height: 40px; }
.local-workspace .local-header-actions { display: flex; gap: 4px; align-items: center; justify-self: end; grid-column: 3; grid-row: 1; }
.local-workspace .notification-menu { left: auto; right: 0; }
.local-workspace .notification-bell summary > span > .ui-icon { width: 23px; height: 23px; }
.local-workspace .month-arrow { border: 0; cursor: pointer; background: transparent; }
.local-workspace .month-arrow:disabled { opacity: .35; cursor: default; }
.local-workspace .period-popover { display: grid; gap: 12px; }
.local-workspace .period-actions { grid-template-columns: 1fr; }
.local-workspace .current-month-link { font: inherit; color: #08765e; background: #fff; cursor: pointer; }
.local-workspace .list-surface { margin-bottom: 20px; }
.local-workspace #local-content .button-primary { background: #07856f; border-color: #07856f; color: #fff; }
.local-workspace #local-content .text-link { border: 0; background: transparent; padding: 6px 0; }
.local-workspace #local-content .card-heading>.button-secondary{width:auto;min-height:44px;padding:8px 14px;font-size:14px;font-weight:650}
.local-workspace #local-content .local-toolbar>.button-secondary{width:auto;min-height:44px;padding:9px 14px;font-weight:650}
.local-workspace #local-content .filter-tabs a { flex: 1; text-align: center; }
.local-workspace .management-links button { font-size: 14px; }
.local-workspace .management-filters .local-search { margin: 0; }
.local-workspace .management-filters input { min-width: 0; }
.local-workspace #local-content .sale-type-tabs button[aria-pressed="true"] { background: #07856f; border-color: #07856f; color: #fff; }
.local-workspace #local-content .pdv-chip.income { background: #e5f5ec; color: #08775e; border: 0; border-radius: 999px; }
.local-workspace #local-content .pdv-chip.expense { background: #fde8e6; color: #b83a3a; border: 0; border-radius: 999px; }
.local-workspace #local-content .sale-result { text-align: left; padding: 14px; border-color: #e3eaf3; border-radius: 15px; }
.local-workspace #local-content .sale-catalog { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.local-workspace .sale-search { min-height: 58px; margin: 0 0 12px; padding: 0 18px; border: 1px solid var(--brand-line); border-radius: 16px; background: #fff; box-shadow: 0 6px 18px #153b330b; font-size: 17px; }
.local-workspace .sale-search:focus { border-color: var(--brand-green); outline: 3px solid #07856f20; }
.local-workspace .sale-type-tabs { gap: 6px; margin: 0 0 14px; padding: 4px; border-radius: 14px; background: #e9f0ed; }
.local-workspace .sale-type-tabs button { min-height: 44px; padding: 7px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--brand-muted); font-weight: 650; }
.local-workspace .sale-type-tabs button[aria-pressed="true"] { background: #fff; color: var(--brand-deep); box-shadow: 0 2px 7px #153b3314; }
.local-workspace .sale-results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.local-workspace #local-content .sale-result { display: flex; min-width: 0; min-height: 128px; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--brand-line); border-radius: 16px; background: #fff; color: var(--brand-navy); box-shadow: 0 5px 14px #153b3309; transition: border-color .15s, box-shadow .15s, transform .15s; }
.local-workspace #local-content .sale-result:hover { transform: translateY(-1px); border-color: #9bcbbd; box-shadow: 0 8px 20px #153b3314; }
.local-workspace #local-content .sale-result:active { transform: scale(.98); }
.local-workspace .sale-result-info { display: flex; min-width: 0; align-items: flex-start; gap: 10px; }
.local-workspace .sale-result-detail { display: grid; min-width: 0; gap: 5px; }
.local-workspace .sale-result-detail strong { display: -webkit-box; overflow: hidden; color: var(--brand-navy); font-size: 14px; line-height: 1.35; text-align: left; text-overflow: ellipsis; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.local-workspace .sale-result-detail small { margin: 0; color: var(--brand-muted); font-size: 12px; text-align: left; }
.local-workspace .sale-result-image { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border-radius: 11px; background: #f2f6f5; }
.local-workspace #local-content .sale-result > strong { color: var(--brand-green); font-size: 17px; text-align: left; }
.local-workspace .sale-empty { grid-column: 1 / -1; margin: 16px 0; color: var(--brand-muted); text-align: center; }
.local-workspace .sale-history { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--brand-line); }
.local-workspace .sale-history > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; color: var(--brand-muted); cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }
.local-workspace .sale-history > summary::-webkit-details-marker { display: none; }
.local-workspace .sale-history > summary::after { content: "+"; color: var(--brand-green); font-size: 20px; }
.local-workspace .sale-history[open] > summary::after { content: "−"; }
.local-workspace .sale-history-content { display: grid; gap: 8px; padding-top: 8px; }
.local-workspace .sale-history-content .local-data-note { margin: 0; padding: 12px; }
.local-workspace .sale-history-content .local-data-note summary { font-size: 13px; }
.sale-cart-options { margin: 4px 0 12px; }
.sale-cart-options > summary { min-height: 44px; color: var(--brand-muted); cursor: pointer; font-size: 13px; }
.sale-cart-options .text-link { min-height: 44px; }
.sale-modal-catalog { display:grid; gap:8px; padding:12px; margin:0 0 10px; border:1px solid var(--brand-line); border-radius:16px; background:#f7faf8; }
.sale-modal-catalog>label { color:var(--brand-muted); font-size:12px; font-weight:700; }
.sale-modal-catalog .sale-search { min-height:44px; margin:0; padding:0 12px; font-size:15px; }
.sale-modal-catalog .sale-results { max-height:190px; grid-template-columns:1fr; gap:6px; overflow-y:auto; overscroll-behavior:contain; }
.sale-modal-catalog .sale-result { display:flex; min-height:56px; flex-direction:row; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border:1px solid var(--brand-line); border-radius:12px; background:#fff; text-align:left; }
.sale-modal-catalog .sale-result-info,.sale-modal-catalog .sale-result-detail { min-width:0; }
.sale-modal-catalog .sale-result-detail strong { display:block; overflow:hidden; color:var(--brand-navy); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.sale-modal-catalog .sale-result-detail small { color:var(--brand-muted); font-size:11px; }
.sale-modal-catalog .sale-result-image { width:36px; height:36px; flex:0 0 36px; object-fit:cover; border-radius:9px; }
.sale-modal-catalog .sale-result>strong { flex:0 0 auto; color:var(--brand-green); font-size:14px; }
.local-workspace .sale-cart-trigger { gap: 8px; font-size: 16px; padding: 10px 18px; }
.local-workspace .sale-cart-trigger small { font-size: 12px; }
.local-workspace .profile-surface { max-width: 640px; margin-inline: auto; text-align: center; border: 1px solid var(--brand-line); box-shadow: 0 12px 30px #153b3310; }
.local-workspace .profile-surface .card-heading { justify-content: center; margin-bottom: 18px; }
.local-workspace .profile-surface .card-heading h2 { font-size: 24px; }
.local-workspace .profile-surface .avatar-circle { display: grid; width: 88px; height: 88px; flex: 0 0 88px; aspect-ratio: 1; margin: 0 auto 18px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--brand-line), 0 8px 18px #153b3314; }
.local-workspace .profile-surface .avatar-circle svg { width: 40px; height: 40px; }
.local-workspace .profile-surface .profile-email { margin: 0 0 8px; color: var(--brand-deep); font-size: 18px; font-weight: 700; }
.local-workspace .profile-surface > .muted-note { max-width: 470px; margin: 0 auto 18px; line-height: 1.55; }
.local-workspace .profile-image-actions { max-width: 360px; margin: 18px auto 10px; padding: 14px; border: 1px solid var(--brand-line); border-radius: 16px; background: #f8fbf9; }
.local-workspace .profile-image-actions input { color: var(--brand-muted); font-size: 14px; }
.local-workspace .profile-image-actions input::file-selector-button { min-height: 44px; margin-right: 10px; padding: 8px 12px; border: 1px solid var(--brand-line); border-radius: 10px; background: #fff; color: var(--brand-green); cursor: pointer; font: inherit; font-weight: 650; }
.local-workspace .profile-surface > .profile-image-actions + .muted-note { margin: 0 auto 14px; font-size: 13px; }
.local-workspace .profile-surface > .button-primary { display: flex; width: min(100%, 360px); min-height: 48px; align-items: center; justify-content: center; margin: 16px auto 10px; border-radius: 12px; text-decoration: none; }
.local-workspace .profile-surface > .button-primary + .muted-note { padding: 12px; border-radius: 12px; background: #f2f6f5; font-size: 13px; }
.local-workspace .profile-surface > .text-link { justify-content: center; margin: 8px auto 0; }
.local-workspace #local-sync-section,
.local-workspace #backup-section,
.local-workspace #local-storage-section { max-width: 640px; margin-inline: auto; border: 1px solid var(--brand-line); box-shadow: 0 8px 22px #153b3309; }
.local-workspace .local-data-note summary { justify-content: space-between; gap: 12px; color: var(--brand-navy); font-size: 16px; font-weight: 700; }
.local-workspace .local-data-note summary::after { content: "+"; display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; background: #e6f4ee; color: var(--brand-green); font-size: 20px; line-height: 1; }
.local-workspace .local-data-note details[open] > summary::after { content: "−"; }
.local-workspace #local-sync-status { padding: 12px 14px; border-radius: 12px; background: #f2f6f5; color: var(--brand-navy); line-height: 1.5; }
.local-workspace #local-sync-section > button { margin-right: 14px; }
.local-workspace #backup-section .local-form h2 { margin: 4px 0; font-size: 18px; }
.local-workspace #backup-section .local-form input { min-width: 0; }
.local-workspace #backup-preview { padding: 16px; border: 1px solid var(--brand-line); border-radius: 14px; background: #f8fbf9; }
@media (max-width: 680px) { .backup-reminder { grid-template-columns: 40px minmax(0,1fr); gap: 10px 12px; padding: 14px; border-radius: 17px; }.backup-reminder::before { width: 40px; height: 40px; border-radius: 13px; }.backup-reminder p { font-size: 13px; }.backup-reminder > div { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }.backup-actions-grid { grid-template-columns: 1fr; } .backup-action-card { border-radius: 15px; } .backup-danger-zone { align-items:stretch; flex-direction:column; }.backup-danger-zone .button-danger { width:100%; } }
@media (max-width: 380px) { .backup-reminder { grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 12px; }.backup-reminder::before { width: 34px; height: 34px; border-radius: 11px; background-size: 19px; }.backup-reminder > div { grid-column: 1 / -1; }.backup-reminder button { flex: 1 1 auto; padding-inline: 10px; } }
.profile-avatar-image { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-image-actions { display: grid; max-width: 320px; gap: 8px; margin: 0 auto 10px; text-align: left; }
.profile-image-actions input { width: 100%; min-height: 44px; font: inherit; }
.profile-image-label { color: var(--brand-navy); font-size: 14px; font-weight: 650; }
.profile-image-actions .text-link { justify-self: start; }
.local-image-fields { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--brand-line); border-radius: 16px; background: #f8fbf9; }
.local-image-fields[hidden] { display: none; }
.local-image-label { color: var(--brand-navy); font-size: 14px; font-weight: 650; }
.local-image-preview { display: grid; width: 112px; height: 112px; place-items: center; overflow: hidden; border: 1px dashed #b8cbc4; border-radius: 16px; background: #fff; color: var(--brand-muted); font-size: 13px; }
.local-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.local-image-fields input[type="file"] { min-height: 44px; max-width: 100%; font: inherit; }
.local-image-fields small { color: var(--brand-muted); line-height: 1.45; }
.local-image-fields { grid-template-columns:64px minmax(0,1fr); grid-template-areas:"title title" "preview choose" "preview clear"; align-items:center; gap:4px 12px; padding:10px; }
.local-image-label { grid-area:title; }
.local-image-preview { grid-area:preview; width:64px; height:64px; border-radius:12px; }
.local-image-fields label[for="local-catalog-image"] { grid-area:choose; }
.local-image-fields input.visually-hidden { position:absolute; width:1px; height:1px; min-height:1px; padding:0; border:0; clip:rect(0,0,0,0); clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
.local-image-fields .image-upload-button { display:inline-flex; width:max-content; max-width:100%; min-height:42px; align-items:center; justify-content:center; padding:0 14px; border:1px solid #cbd6e4; border-radius:11px; background:#fff; color:#08765e; cursor:pointer; font:inherit; font-size:14px; font-weight:650; }
.local-image-fields .image-upload-button:hover { border-color:#8eb9ad; background:#f4faf7; }
.local-image-fields input.visually-hidden:focus-visible + .image-upload-button { outline:3px solid #94cdbc; outline-offset:3px; }
.local-image-fields [data-image-clear] { grid-area:clear; justify-self:start; min-height:32px; }
.local-row-image { width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover; border-radius: 12px; }
.local-row-image + strong { margin-top: 2px; }
.quick-reference-options summary { font-weight: 700; }
.quick-reference-options[hidden] { display: none; }
.quick-confirm label { justify-self: start; color: var(--brand-muted); font-size: 13px; font-weight: 650; }
.quick-confirm input:not(.quick-amount) { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd6e4; border-radius: 10px; background: #fff; color: #203247; font: inherit; font-size: 16px; }
.quick-entry-totals { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f2f6f5; color: #36504a; font-size: 14px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.local-workspace .profile-surface > .text-link { display: inline-flex; margin-top: 16px; }
.local-workspace .pwa-update-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid #d5e7e0; border-radius: 14px; background: #fff; }
.local-workspace .pwa-update-banner p { flex: 1 1 240px; min-width: 0; margin: 0; color: #526781; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.local-workspace .pwa-update-banner .button-primary { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.local-workspace .local-finance-links { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 4px 0 0; }
.local-workspace .local-finance-links + .filter-tabs { margin-top: 12px; }
@media (min-width: 761px) {
  .local-workspace .main-content { width: 100%; max-width: none; margin-left: 0; margin-right: 0; padding: 24px clamp(24px, 3vw, 48px) 96px; }
  .local-workspace .dashboard-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .local-workspace .dashboard-header > .header-brand { display: none; }
  .local-workspace .dashboard-header .local-header-actions { display: flex; align-items: center; gap: 8px; justify-self: end; grid-column: 3; grid-row: 1; }
  .local-workspace .dashboard-header .notification-bell,
  .local-workspace .dashboard-header .profile-button { grid-column: auto; grid-row: auto; }
  .local-workspace .sidebar { top: 0; height: 100dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; padding: 24px 18px 20px; }
  .local-workspace .sidebar > * { flex-shrink: 0; }
  .local-workspace .nav-caption { margin: 24px 12px 12px; }
  .local-workspace .side-nav { gap: 4px; }
  .local-workspace .side-link { min-height: 44px; gap: 12px; padding: 8px 12px; font-size: 14px; }
  .local-workspace .side-link > .ui-icon { width: 28px; height: 28px; padding: 5px; }
  .local-workspace .secondary-nav { margin-top: 12px; padding-top: 12px; }
  .local-workspace .sidebar-bottom { padding-top: 16px; }
  .local-workspace .sidebar-footnote { font-size: 12px; }
  .local-workspace .dashboard-header { margin-bottom: 12px; }
  .local-workspace #local-content .list-surface { padding: 22px; border-radius: 22px; }
  .local-workspace #local-content .card-heading h2 { font-size: 22px; }
}
@media (max-width: 520px) {
  .local-workspace .sale-results { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
  .local-workspace #local-content .sale-result { min-height: 116px; padding: 10px; }
  .local-workspace .dashboard-header { grid-template-columns: 40px minmax(0, 1fr) 88px; gap: 4px; }
  .local-workspace .local-header-actions { gap: 0; }
  .local-workspace .dashboard-header .period-picker summary { font-size: 14px; padding: 6px; white-space: normal; }
  .local-workspace .dashboard-header .period-picker summary > span { overflow-wrap: normal; }
  .local-workspace .notification-menu { right: -44px; max-width: calc(100vw - 32px); }
  .local-workspace .period-popover .period-actions { grid-template-columns: 1fr; }
}

/* Category identity: only its icon and label receive the chosen paint. */
.category-badge { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; vertical-align: middle; font-weight: 650; color: var(--category-color, #475569); }
.category-badge .category-symbol { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; background: var(--category-paint); mask-image: var(--category-mask); -webkit-mask-image: var(--category-mask); mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.category-badge .category-name { color: var(--category-color); overflow-wrap: anywhere; }
.category-gradient .category-name { background: var(--category-paint); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.category-preview { padding: 12px; border: 1px solid var(--brand-line, #dce5e2); border-radius: 10px; background: #fff; }
.category-selection { display: block; margin: 4px 0 10px; }
.quick-form input[type="color"] { width: 100%; min-height: 44px; padding: 4px; cursor: pointer; }
@media (forced-colors: active) { .category-gradient .category-name { background: none; -webkit-text-fill-color: currentColor; } .category-symbol { forced-color-adjust: none; } }

.record-list li > div > .category-badge { display: inline-flex; color: var(--category-color, #475569); }
/* Badge stays inside the existing avatar footprint and survives photo rendering. */
.local-workspace .profile-button[data-sync-state] { position: relative; overflow: visible; }
.local-workspace .profile-button[data-sync-state] img { border-radius: inherit; }
.local-workspace .profile-button:is([data-sync-state='offline'],[data-sync-state='pending'],[data-sync-state='syncing'],[data-sync-state='attention'])::before { content: ''; position: absolute; right: -1px; bottom: -1px; width: 19px; height: 19px; border: 2px solid #fff; border-radius: 50%; background: #fff; pointer-events: none; }
.local-workspace .profile-button:is([data-sync-state='offline'],[data-sync-state='pending'],[data-sync-state='syncing'],[data-sync-state='attention'])::after { content: ''; position: absolute; right: 2px; bottom: 2px; width: 17px; height: 17px; background: var(--sync-color); mask: var(--sync-icon) center / contain no-repeat; -webkit-mask: var(--sync-icon) center / contain no-repeat; pointer-events: none; }
.local-workspace .profile-button:is([data-sync-state='pending'],[data-sync-state='syncing']) { --sync-color: #996100; --sync-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7a9 9 0 0 0-15-2L2 8m0-5v5h5M4 17a9 9 0 0 0 15 2l3-3m0 5v-5h-5'/%3E%3C/svg%3E"); }
.local-workspace .profile-button[data-sync-state='offline'] { --sync-color: #b42318; --sync-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m3 3 18 18M2 8l3-2M10 5a16 16 0 0 1 12 3M5 12l4-2M15 10l4 2M8.5 16a5.5 5.5 0 0 1 7 0M12 20h.01'/%3E%3C/svg%3E"); }
.local-workspace .profile-button[data-sync-state='attention'] { --sync-color: #b42318; --sync-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6m0 4h.01'/%3E%3C/svg%3E"); }
@keyframes contas-sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { .local-workspace .profile-button[data-sync-state='syncing']::after { animation: contas-sync-spin 1.2s linear infinite; } }
.local-workspace .pick-thumb img,
.local-workspace .sale-result-image,
.local-workspace .local-row-image { object-fit: contain; }
.sync-bootstrap {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(246, 250, 249, .96);
  backdrop-filter: blur(8px);
}
.sync-bootstrap[hidden] { display: none; }
.sync-bootstrap-card {
  width: min(100%, 360px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 22px;
  border: 1px solid rgba(7, 133, 111, .14);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 54, 48, .12);
  text-align: center;
}
.sync-bootstrap-card h1 { margin: 0; font-size: 1.2rem; }
.sync-bootstrap-card p { margin: 0; color: #52645f; }
.sync-bootstrap-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d9ebe7;
  border-top-color: #07856f;
  border-radius: 50%;
  animation: contas-sync-spin .8s linear infinite;
}
@keyframes contas-sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-bootstrap-spinner { animation-duration: 1.8s; } }
.category-preset-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.category-preset-actions .button-secondary{width:auto;min-height:44px}
#local-cost-field{display:grid;gap:8px}
#local-cost-field[hidden]{display:none}

/* Shared presentation: keep business screens on the same visual scale. */
.local-workspace {
  --surface-radius: 18px;
  --control-radius: 12px;
  --control-height: 44px;
  --surface-shadow: 0 4px 20px #153b3306;
}
.local-workspace #local-content .list-surface {
  border: 1px solid var(--brand-line);
  border-radius: var(--surface-radius);
  box-shadow: var(--surface-shadow);
}
.local-workspace #local-content .card-heading {
  flex-wrap: wrap;
  gap: 12px;
}
.local-workspace #local-content .card-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.local-workspace :is(.local-toolbar, .management-filters, .management-pagination) {
  gap: 8px;
}
.local-workspace :is(.management-pagination button, .management-links button, .period-popover-close) {
  min-height: var(--control-height);
  min-width: var(--control-height);
}
.local-workspace .management-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding-top: 16px;
}
.local-workspace .management-pagination button {
  padding: 8px 14px;
  border: 1px solid var(--brand-line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--brand-deep);
}
.local-workspace .management-pagination button:disabled {
  color: var(--brand-muted);
  background: var(--brand-background);
  cursor: default;
  opacity: .65;
}
.local-workspace .management-pagination > span {
  color: var(--brand-muted);
  font-size: 13px;
  text-align: center;
}
.local-workspace .record-list li > div { min-width: 0; }
.local-workspace .record-list :is(strong, p) { overflow-wrap: anywhere; }
.local-workspace [data-money] { font-variant-numeric: tabular-nums; }
.local-workspace #local-content .muted-note {
  color: var(--brand-muted);
  line-height: 1.6;
}
@media (hover: hover) {
  .local-workspace .management-pagination button:enabled:hover {
    border-color: var(--brand-green);
    background: #edf6f2;
  }
}
@media (max-width: 520px) {
  .local-workspace #local-content .list-surface { padding: 16px; }
  .local-workspace .management-pagination { gap: 6px; }
  .local-workspace .management-pagination button { padding-inline: 10px; }
  .local-workspace .quick-form :is(input, select, textarea) { font-size: 16px; }
  .local-workspace .dashboard-header .month-switcher > .month-arrow {
    min-height: var(--control-height);
  }
}
@media (prefers-reduced-motion: reduce) {
  .local-workspace *, .local-workspace *::before, .local-workspace *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
