:root {
  --ink: #11130f; --muted: #73776d; --line: #e8e9e2; --paper: #f6f7f2; --white: #fff;
  --lime: #c7f36b; --lime-deep: #aee34e; --blue: #607bff; --coral: #ff765f; --orange: #f5a63b; --purple: #a881f5;
  --shadow: 0 12px 32px rgba(28, 32, 20, 0.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; display: flex; flex-direction: column; padding: 28px 20px 22px; color: #fff; background: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 10px 46px; color: #fff; text-decoration: none; font-size: 20px; font-weight: 780; letter-spacing: -.6px; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; color: var(--ink); background: var(--lime); border-radius: 11px 11px 11px 3px; font-size: 16px; font-weight: 900; }
.nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; color: #aeb2a8; background: transparent; border: 0; border-radius: 12px; font-weight: 650; text-align: left; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--ink); background: var(--lime); }
.nav-icon { width: 20px; font-size: 20px; line-height: 1; text-align: center; }
.sidebar-card { margin-top: auto; padding: 18px; color: #dfe2d8; background: #20231d; border: 1px solid #2d3128; border-radius: 17px; }
.sidebar-card-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 18px; color: var(--ink); background: var(--lime); border-radius: 50%; font-weight: 800; }
.sidebar-card .eyebrow { color: #858a7f; }
.sidebar-card strong { display: block; font-size: 14px; line-height: 1.4; }
.sidebar-card p:last-child { margin: 7px 0 0; color: #858a7f; font-size: 11px; line-height: 1.5; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 18px 8px 0; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.avatar-dark { color: var(--ink); background: #f2c8a7; }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer span { margin-top: 3px; color: #7d8178; font-size: 10px; }
.main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 82px; padding: 0 42px; background: rgba(246,247,242,.88); border-bottom: 1px solid rgba(220,222,213,.7); backdrop-filter: blur(12px); }
.date-chip { color: var(--muted); font-size: 13px; font-weight: 620; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 12px; font-size: 19px; }
.icon-button:hover { border-color: #cfd1c7; }
.menu-button { display: none; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 750; border: 1px solid transparent; transition: .18s ease; }
.primary-button { color: var(--ink); background: var(--lime); box-shadow: 0 4px 12px rgba(151,196,54,.16); }
.primary-button:hover { background: var(--lime-deep); transform: translateY(-1px); }
.secondary-button { color: var(--ink); background: var(--white); border-color: var(--line); }
.content { width: min(1370px, 100%); margin: 0 auto; padding: 42px; }
.view { display: none; animation: view-in .35s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: 1.45px; }
.eyebrow.accent { color: #759c2f; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 3vw, 39px); line-height: 1.1; letter-spacing: -1.6px; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -.35px; }
.page-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.month-selector { display: flex; align-items: center; gap: 12px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 13px; }
.month-selector button { width: 32px; height: 32px; color: var(--ink); background: transparent; border: 0; border-radius: 9px; }
.month-selector button:hover { background: var(--paper); }
.month-selector span { min-width: 112px; font-size: 12px; font-weight: 750; text-align: center; }
.summary-grid { display: grid; grid-template-columns: 1.28fr 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.stat-card { position: relative; min-height: 168px; padding: 23px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.stat-card-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card-dark .stat-label { color: #a3a89d; }
.stat-value { display: block; margin-top: 22px; font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -1.5px; }
.stat-card p { margin: 12px 0 0; color: #95998f; font-size: 11px; }
.trend { padding: 5px 7px; border-radius: 20px; font-size: 9px; font-weight: 850; }
.trend.positive { color: #53781a; background: #eaf8d3; }
.trend.negative { color: #c55843; background: #fff0ed; }
.stat-card-dark .trend { color: var(--lime); background: #2a3420; }
.stat-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 20px; border-radius: 9px; font-weight: 900; }
.stat-icon.income { color: #536dea; background: #edf0ff; }
.stat-icon.expense { color: #de614d; background: #fff0ed; }
.stat-card:not(.stat-card-dark) .stat-label { position: absolute; top: 29px; left: 62px; right: 22px; }
.stat-card:not(.stat-card-dark) .stat-value { margin-top: 7px; }
.mini-line { position: absolute; right: 20px; bottom: 15px; left: 20px; height: 37px; color: var(--lime); opacity: .85; }
.mini-line svg { width: 100%; height: 100%; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px; margin-bottom: 15px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.cashflow-panel, .spending-panel { min-height: 348px; padding: 24px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-income { background: var(--lime); }
.dot-expense { background: var(--ink); }
.chart-wrap { display: grid; grid-template-columns: 30px 1fr; height: 240px; margin-top: 25px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 23px; color: #a3a79d; font-size: 9px; }
.bar-chart { display: flex; justify-content: space-around; gap: 8px; padding: 0 6px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #eff0eb 25%); }
.bar-group { position: relative; display: flex; align-items: end; justify-content: center; gap: 5px; width: 17%; }
.bar { width: min(18px, 35%); min-height: 3px; border-radius: 6px 6px 2px 2px; transition: height .5s ease; }
.bar.income { background: var(--lime); }
.bar.expense { background: var(--ink); }
.bar-group label { position: absolute; bottom: -22px; color: #8e9288; font-size: 9px; }
.spending-content { display: grid; grid-template-columns: minmax(145px, 1fr) 1fr; align-items: center; gap: 18px; margin-top: 30px; }
.donut-wrap { display: grid; place-items: center; }
.donut { display: grid; place-items: center; width: 154px; height: 154px; border-radius: 50%; }
.donut::before { content: ""; grid-area: 1 / 1; width: 94px; height: 94px; background: var(--white); border-radius: 50%; }
.donut > div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 14px; }
.donut span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.category-legend { display: grid; gap: 13px; }
.category-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: 10px; }
.category-row i { width: 8px; height: 8px; border-radius: 3px; }
.category-row span { color: var(--muted); }
.category-row strong { font-size: 10px; }
.text-button { padding: 4px 0; color: #759c2f; background: transparent; border: 0; font-size: 11px; font-weight: 780; }
.transactions-preview { padding: 24px; }
.transaction-list { margin-top: 20px; }
.transaction-row { display: grid; grid-template-columns: minmax(210px, 1.3fr) .7fr .58fr .65fr auto; align-items: center; gap: 14px; min-height: 68px; border-top: 1px solid #eff0eb; }
.transaction-main { display: flex; align-items: center; min-width: 0; gap: 11px; }
.transaction-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
.transaction-main strong, .transaction-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main strong { font-size: 12px; }
.transaction-main span, .transaction-date, .transaction-category { margin-top: 3px; color: var(--muted); font-size: 10px; }
.transaction-amount { font-size: 12px; text-align: right; }
.transaction-amount.income { color: #5e851f; }
.row-actions { display: flex; opacity: 0; transition: opacity .2s; }
.transaction-row:hover .row-actions { opacity: 1; }
.row-action { width: 27px; height: 27px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; }
.row-action:hover { color: var(--ink); background: var(--paper); }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 190px; gap: 10px; padding: 20px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 13px; color: var(--muted); background: var(--paper); border: 1px solid transparent; border-radius: 11px; }
.search-box:focus-within { background: var(--white); border-color: #b8c88e; }
.search-box input { width: 100%; outline: 0; background: transparent; border: 0; font-size: 12px; }
select, .field input, .field textarea { width: 100%; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.filters select { min-height: 42px; padding: 0 12px; font-size: 11px; }
select:focus, .field input:focus, .field textarea:focus { border-color: #9dbb62; box-shadow: 0 0 0 3px rgba(199,243,107,.2); }
.table-head { display: grid; grid-template-columns: minmax(210px, 1.3fr) .7fr .58fr .65fr 60px; gap: 14px; padding: 17px 24px 8px; color: #a1a59a; font-size: 9px; font-weight: 850; letter-spacing: .7px; text-transform: uppercase; }
.full-list { margin: 0; padding: 0 24px 12px; }
.empty-state { padding: 65px 20px 80px; color: var(--muted); text-align: center; }
.empty-state div { font-size: 30px; }
.empty-state h3 { margin: 12px 0 5px; color: var(--ink); font-size: 16px; }
.empty-state p { font-size: 12px; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 15px; padding: 24px; }
.budget-summary > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.budget-summary strong { font-size: 25px; letter-spacing: -1px; }
.green-text { color: #658f22; }
.budget-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.budget-card { padding: 22px; }
.budget-title { display: flex; align-items: center; gap: 10px; }
.budget-title .transaction-icon { width: 34px; height: 34px; }
.budget-title strong { font-size: 12px; }
.budget-numbers { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 10px; }
.budget-numbers strong { font-size: 17px; }
.budget-numbers span { color: var(--muted); font-size: 9px; }
.progress { height: 8px; overflow: hidden; background: var(--paper); border-radius: 10px; }
.progress > span { display: block; height: 100%; border-radius: inherit; transition: width .5s ease; }
.budget-status { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.modal-backdrop[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(12,14,10,.6); backdrop-filter: blur(5px); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px; background: var(--white); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: modal-in .25s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.modal-header h2 { font-size: 22px; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 20px; background: var(--paper); border-radius: 12px; }
.type-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.type-toggle span { display: block; padding: 10px; color: var(--muted); border-radius: 9px; font-size: 11px; font-weight: 760; text-align: center; cursor: pointer; }
.type-toggle input:checked + span { color: var(--ink); background: var(--white); box-shadow: 0 2px 8px rgba(24,27,18,.08); }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 750; }
.field em { color: var(--muted); font-weight: 500; }
.field input, .field textarea { min-height: 43px; padding: 10px 12px; font-size: 12px; }
.field textarea { min-height: 72px; resize: vertical; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; }
.money-input:focus-within { border-color: #9dbb62; box-shadow: 0 0 0 3px rgba(199,243,107,.2); }
.money-input > span { padding-left: 12px; font-size: 12px; font-weight: 750; }
.money-input input { border: 0; box-shadow: none !important; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 6px; }
.toast { position: fixed; z-index: 80; right: 28px; bottom: 28px; display: flex; align-items: center; gap: 10px; min-width: 250px; padding: 14px 16px; color: #fff; background: var(--ink); border-radius: 13px; box-shadow: 0 14px 35px rgba(0,0,0,.22); transform: translateY(90px); opacity: 0; pointer-events: none; transition: .3s ease; }
.toast.show { transform: none; opacity: 1; }
.toast > span { display: grid; place-items: center; width: 23px; height: 23px; color: var(--ink); background: var(--lime); border-radius: 50%; font-size: 11px; font-weight: 900; }
.toast p { margin: 0; font-size: 11px; font-weight: 700; }
.mobile-overlay { display: none; }
@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: 1.2fr 1fr; }
  .stat-card-dark { grid-row: span 2; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .budget-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .main { width: 100%; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.45); }
  .mobile-overlay.show { display: block; }
  .menu-button { display: grid; }
  .topbar { height: 70px; padding: 0 18px; }
  .date-chip { display: none; }
  .topbar-actions .icon-button { display: none; }
  .topbar-actions .primary-button { min-width: 42px; width: 42px; padding: 0; overflow: hidden; white-space: nowrap; color: transparent; }
  .topbar-actions .primary-button span { color: var(--ink); font-size: 19px; }
  .content { padding: 28px 17px 90px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 22px; }
  .month-selector { position: static; align-self: stretch; width: 100%; }
  .month-selector span { flex: 1; }
  .page-heading h1 { max-width: none; font-size: 28px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 145px; padding: 18px; }
  .stat-card-dark { grid-column: span 2; grid-row: auto; }
  .stat-card:not(.stat-card-dark) .stat-label { position: static; }
  .stat-icon { margin-bottom: 12px; }
  .stat-value { font-size: 21px; }
  .stat-card:not(.stat-card-dark) .stat-value { margin-top: 14px; }
  .cashflow-panel, .spending-panel { padding: 18px; }
  .spending-content { grid-template-columns: 1fr 1fr; }
  .transactions-preview { padding: 18px; }
  .transaction-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 67px; }
  .transaction-row .transaction-category, .transaction-row .transaction-date { display: none; }
  .row-actions { display: none; }
  .filters { grid-template-columns: 1fr 1fr; padding: 15px; }
  .search-box { grid-column: span 2; }
  .table-head { display: none; }
  .full-list { padding: 0 16px 12px; }
  .full-list .row-actions { display: flex; opacity: 1; grid-column: 2; justify-content: end; margin-top: -20px; }
  .desktop-add { display: none; }
  .budget-summary { grid-template-columns: 1fr; gap: 18px; }
  .budget-summary > div + div { padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .budget-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .summary-grid { gap: 10px; }
  .stat-card { min-height: 154px; }
  .stat-card p { line-height: 1.4; }
  .chart-wrap { height: 215px; }
  .spending-content { grid-template-columns: 1fr; }
  .category-legend { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 22px 22px 0 0; padding: 21px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions > * { flex: 1; }
}

/* Authentication, PWA, and account controls */
[hidden] { display: none !important; }
.auth-screen { min-height: 100vh; min-height: 100dvh; padding: max(26px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); color: var(--ink); background: radial-gradient(circle at 12% 12%, rgba(199,243,107,.28), transparent 28%), var(--paper); }
.auth-brand { display: flex; align-items: center; gap: 10px; width: min(1120px, 100%); margin: 0 auto; font-size: 20px; font-weight: 800; letter-spacing: -.6px; }
.auth-layout { display: grid; grid-template-columns: 1.05fr .8fr; align-items: center; gap: clamp(50px, 8vw, 120px); width: min(1120px, 100%); min-height: calc(100vh - 100px); margin: 0 auto; padding: 48px 0; }
.auth-copy h1 { max-width: 650px; margin-bottom: 20px; font-size: clamp(46px, 6.2vw, 78px); line-height: .98; letter-spacing: -4px; }
.auth-copy > p:not(.eyebrow) { max-width: 540px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.auth-feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.auth-feature-list span { padding: 9px 12px; color: #4e6726; background: rgba(199,243,107,.32); border: 1px solid rgba(133,176,54,.18); border-radius: 100px; font-size: 11px; font-weight: 750; }
.auth-card { padding: 30px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 80px rgba(25,31,15,.12); }
.auth-card h2 { margin-bottom: 22px; font-size: 27px; letter-spacing: -1px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--paper); border-radius: 12px; }
.auth-tabs button { min-height: 38px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 11px; font-weight: 760; }
.auth-tabs button.active { color: var(--ink); background: var(--white); box-shadow: 0 3px 10px rgba(20,24,15,.07); }
.auth-form .field { margin-bottom: 16px; }
.auth-submit { width: 100%; margin-top: 5px; }
.password-field { display: flex; align-items: center; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 11px; }
.password-field:focus-within { border-color: #9dbb62; box-shadow: 0 0 0 3px rgba(199,243,107,.2); }
.password-field input { border: 0; box-shadow: none !important; }
.password-field button { flex: 0 0 42px; align-self: stretch; color: var(--muted); background: transparent; border: 0; }
.seed-option { display: flex; align-items: center; gap: 9px; margin: 2px 0 14px; color: var(--muted); font-size: 10px; cursor: pointer; }
.seed-option input { accent-color: #90bd3d; }
.form-error { min-height: 16px; margin: -4px 0 6px; color: #c64e3d; font-size: 10px; line-height: 1.4; }
.auth-security { margin: 18px 0 0; color: #999d93; font-size: 9px; text-align: center; }
.server-required { text-align: center; }
.server-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; color: var(--ink); background: var(--lime); border-radius: 17px; font-size: 24px; }
.server-required p { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.server-required code { padding: 2px 5px; color: var(--ink); background: var(--paper); border-radius: 5px; font-size: 10px; }
.install-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; margin-top: auto; color: #fff; background: #20231d; border: 1px solid #34382e; border-radius: 14px; text-align: left; }
.install-card > span { display: grid; place-items: center; width: 32px; height: 32px; color: var(--ink); background: var(--lime); border-radius: 9px; font-weight: 900; }
.install-card strong, .install-card small { display: block; }
.install-card strong { font-size: 11px; }
.install-card small { margin-top: 3px; color: #81867b; font-size: 9px; }
.install-card:not([hidden]) + .sidebar-card { margin-top: 12px; }
.sidebar-user { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { flex: 0 0 auto; width: 30px; height: 30px; color: #81867b; background: transparent; border: 0; border-radius: 8px; font-size: 17px; }
.logout-button:hover { color: #fff; background: #252921; }
.topbar-meta { display: flex; align-items: center; gap: 12px; }
.connection-chip { display: flex; align-items: center; gap: 5px; padding: 5px 8px; color: #66832e; background: #edf6de; border-radius: 30px; font-size: 9px; font-weight: 800; }
.connection-chip i { width: 6px; height: 6px; background: #7bad31; border-radius: 50%; }
.connection-chip.offline { color: #af5a49; background: #fff0ed; }
.connection-chip.offline i { background: #df6954; }
.offline-banner { padding: 8px 20px; color: #6e5520; background: #fff1c7; border-bottom: 1px solid #ead89f; font-size: 10px; font-weight: 700; text-align: center; }
.modal-copy { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.reset-options { display: grid; gap: 10px; }
.reset-options > button { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.reset-options > button:hover { border-color: #bdc5ae; background: var(--paper); }
.reset-options strong, .reset-options small { display: block; }
.reset-options strong { font-size: 12px; }
.reset-options small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.reset-options b { color: var(--muted); }
.reset-option-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 18px; font-weight: 800; }
.reset-option-icon.demo { color: #5f7d2c; background: #edf8d9; }
.reset-option-icon.danger { color: #c45745; background: #fff0ed; }

@media (max-width: 760px) {
  .auth-screen { padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); }
  .auth-layout { display: block; min-height: auto; padding: 48px 0 20px; }
  .auth-copy { margin-bottom: 30px; }
  .auth-copy h1 { margin-bottom: 15px; font-size: 42px; letter-spacing: -2.5px; }
  .auth-copy > p:not(.eyebrow) { font-size: 13px; }
  .auth-feature-list { margin-top: 20px; }
  .auth-card { padding: 23px; border-radius: 20px; }
  .topbar-meta { display: none; }
  .install-button:not([hidden]) { display: grid !important; }
  .sidebar-card { margin-top: auto; }
}

@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(70px + env(safe-area-inset-top)); }
  .sidebar { padding-top: calc(28px + env(safe-area-inset-top)); padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .topbar-actions #resetButton { display: grid; }
}

/* Admin portal */
.nav-item { position: relative; }
.nav-badge { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: auto; color: var(--ink); background: #ffcf65; border-radius: 20px; font-size: 8px; }
.forgot-link { display: block; padding: 0; margin: -5px 0 10px auto; color: #6d8f34; background: transparent; border: 0; font-size: 10px; font-weight: 750; }
.compact-modal { max-width: 460px; }
.generate-password-button { padding: 0; margin: -7px 0 15px; color: #668b2c; background: transparent; border: 0; font-size: 10px; font-weight: 750; }
.admin-heading { align-items: center; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 15px; }
.admin-stat { padding: 20px; }
.admin-stat span, .admin-stat small { display: block; color: var(--muted); font-size: 9px; }
.admin-stat span { font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.admin-stat strong { display: block; margin: 15px 0 5px; font-size: 29px; letter-spacing: -1px; }
.reset-queue-panel, .admin-users-panel { padding: 23px; }
.reset-queue-panel { margin-bottom: 15px; }
.count-pill { padding: 6px 9px; color: #896928; background: #fff3ce; border-radius: 20px; font-size: 9px; font-weight: 800; }
.reset-queue { display: grid; gap: 8px; margin-top: 18px; }
.reset-request { display: flex; align-items: center; gap: 12px; padding: 13px; background: #fafbf7; border: 1px solid var(--line); border-radius: 13px; }
.reset-request .avatar { color: #71582a; background: #ffdf9b; }
.reset-request-info { min-width: 0; flex: 1; }
.reset-request-info strong, .reset-request-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reset-request-info strong { font-size: 11px; }
.reset-request-info span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.reset-request button { min-height: 34px; padding: 0 12px; font-size: 9px; }
.reset-empty { padding: 23px; color: var(--muted); background: var(--paper); border-radius: 13px; font-size: 10px; text-align: center; }
.admin-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 160px 170px; gap: 9px; margin: 20px -23px 0; padding: 17px 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-filters select { min-height: 42px; padding: 0 11px; font-size: 10px; }
.admin-table-head, .admin-user-row { display: grid; grid-template-columns: minmax(220px, 1.35fr) .55fr .62fr .42fr minmax(205px, .9fr); align-items: center; gap: 12px; }
.admin-table-head { padding: 17px 4px 9px; color: #a1a59a; font-size: 8px; font-weight: 850; letter-spacing: .7px; text-transform: uppercase; }
.admin-user-row { min-height: 72px; padding: 10px 4px; border-top: 1px solid #eff0eb; }
.admin-user-main { display: flex; align-items: center; min-width: 0; gap: 10px; }
.admin-user-main .avatar { width: 36px; height: 36px; color: var(--ink); background: #eaf3d8; }
.admin-user-main strong, .admin-user-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-main strong { font-size: 11px; }
.admin-user-main span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-role-select { min-height: 34px; padding: 0 8px; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 6px 8px; border-radius: 20px; font-size: 8px; font-weight: 800; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-pill.active { color: #628127; background: #edf6de; }
.status-pill.active::before { background: #7bad31; }
.status-pill.suspended { color: #b45948; background: #fff0ed; }
.status-pill.suspended::before { background: #df6954; }
.admin-transaction-count { color: var(--muted); font-size: 10px; }
.admin-actions { display: flex; justify-content: flex-end; gap: 5px; }
.admin-action { min-width: 31px; height: 31px; padding: 0 8px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 8px; font-size: 9px; font-weight: 750; }
.admin-action:hover { color: var(--ink); border-color: #c4c8bb; background: var(--paper); }
.admin-action.danger:hover { color: #bd4f3f; border-color: #f0c0b8; background: #fff5f3; }
.admin-action:disabled, .admin-role-select:disabled { opacity: .45; cursor: not-allowed; }
.admin-user-row.pending-reset { background: #fffdf6; }
.admin-user-row.pending-reset .admin-user-main::after { content: "Reset"; padding: 4px 6px; color: #8b6b2c; background: #fff0bd; border-radius: 10px; font-size: 7px; font-weight: 850; text-transform: uppercase; }

@media (max-width: 1100px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-table-head { display: none; }
  .admin-user-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
  .admin-user-row { display: grid; grid-template-columns: 1fr auto; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
  .admin-user-main { grid-column: 1 / -1; }
  .admin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .admin-actions .admin-action { flex: 1; }
}
@media (max-width: 760px) {
  .admin-stats { gap: 9px; }
  .admin-stat { padding: 16px; }
  .admin-stat strong { font-size: 23px; }
  .admin-heading .secondary-button { width: 100%; }
  .reset-queue-panel, .admin-users-panel { padding: 17px; }
  .admin-filters { grid-template-columns: 1fr 1fr; margin: 18px -17px 0; padding: 14px 17px; }
  .admin-filters .search-box { grid-column: 1 / -1; }
  .admin-user-list { grid-template-columns: 1fr; }
  .reset-request { align-items: flex-start; flex-wrap: wrap; }
  .reset-request button { width: 100%; }
}
