/* Layout adapted from SSOT. All colors come from the original panel palette. */
.method-history { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.method-history summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.history-transaction { font-size: 12px; }
.history-transaction small { display: block; color: var(--muted); font-size: 10px; }
.method-history-rows > button { margin: 8px 0; }
:root {
  font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}
body { background: var(--bg); font-size: 13px; line-height: 1.5; }
button { font-weight: 600; }
button:hover { transform: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; }
h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
label { font-weight: 500; }
strong, .amount { font-variant-numeric: tabular-nums; }
input, select, textarea { border-radius: 8px; font-size: 13px; min-height: 40px; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { grid-template-columns: 240px minmax(0, 1fr); }
.shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; min-height: 0;
  padding: 24px 12px 12px; box-shadow: none; gap: 0; overflow: hidden;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.brand { padding: 0 8px; gap: 12px; margin: 0 0 26px; flex-shrink: 0; }
.sidebar-body { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.brand-mark, .shell.sidebar-collapsed .brand-mark {
  width: 36px; height: 40px; border-radius: 8px; font-size: 23px;
  font-weight: 500; color: var(--orange); background: transparent;
  border: 1px solid var(--orange); box-shadow: none;
}
.brand strong { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.brand span:not(.brand-mark) { font-size: 11px; font-weight: 400; margin-top: 0; }
.sidebar-toggle { display: none; }
.nav-section-label {
  padding: 0 12px; margin: 0 0 8px; color: var(--sidebar-muted);
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.sidebar .tabs {
  display: flex; flex-direction: column; gap: 4px; padding: 0;
  margin: 0; overflow: visible; background: transparent; border: 0; border-radius: 0;
}
.sidebar .tab {
  width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; text-align: left;
  border-radius: 8px; color: var(--sidebar-muted); font-size: 13px;
  font-weight: 500; border: 0; background: transparent; box-shadow: none;
}
.sidebar .tab .nav-label { flex: 1; }
.sidebar .tab > .ui-icon:last-child { width: 12px; height: 12px; opacity: 0; }
.sidebar .tab:hover { background: var(--soft); color: var(--orange); }
.sidebar .tab.active { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.sidebar .tab.active > .ui-icon:last-child { opacity: 1; }
.sidebar-control { border: 0; margin: 26px 0 0; padding: 0; gap: 0; }
.sidebar-shortcuts { gap: 4px; }
.sidebar .control-panel-button, .sidebar .control-panel-button.secondary {
  display: flex; gap: 10px; min-height: 40px; padding: 10px 12px; text-align: left;
  border: 0; box-shadow: none; background: transparent; color: var(--sidebar-muted);
  font-size: 13px; font-weight: 500;
}
.sidebar .control-panel-button:hover { background: var(--soft); color: var(--orange); }
.sidebar .control-panel-button.active { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.shortcut-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.shortcut-label { text-align: left; }
.archive { margin-top: 24px; padding: 16px 0 0; }
.archive summary { min-height: 28px; padding: 0 12px; font-size: 12px; font-weight: 600; }
.archive-month-button { min-height: 30px; font-size: 11px; font-weight: 500; padding-inline: 12px; }
.archive-month-days { gap: 4px; }
.day-list { gap: 4px; }
.sidebar .day-button {
  min-height: 42px; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; box-shadow: none;
}
.sidebar .day-button:hover { background: var(--soft); }
.sidebar .day-button.active { background: var(--orange-soft); border: 0; box-shadow: none; }
.sidebar .day-button strong { font-size: 12px; font-weight: 500; }
.sidebar .day-button span { font-size: 10px; font-weight: 400; }
.sidebar .day-button .day-icon { width: 24px; height: 28px; border-radius: 6px; font-size: 10px; }
.sidebar .day-button .badge { font-size: 9px; padding: 3px 5px; font-weight: 500; border: 0; }
.sidebar-footer { margin-top: auto; padding-top: 12px; flex-shrink: 0; }
.active-user-card {
  margin: 0; padding: 12px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent; gap: 3px;
}
.active-user-card span { font-size: 10px; font-weight: 400; }
.active-user-card strong { font-size: 13px; font-weight: 600; }
.active-user-card em { font-size: 10px; font-weight: 400; line-height: 1.5; }
.sidebar .logout-button {
  display: flex; min-height: 38px; margin-top: 6px; padding: 8px 12px;
  gap: 10px; background: transparent; color: var(--red); border: 0;
  font-size: 12px; box-shadow: none;
}
.sidebar .logout-button:hover { background: var(--danger-soft); }
.shell.sidebar-collapsed .sidebar { padding: 24px 10px 12px; }
.shell.sidebar-collapsed .brand { display: flex; justify-content: center; padding: 0; margin-bottom: 30px; }
.shell.sidebar-collapsed .brand div,
.shell.sidebar-collapsed .nav-section-label,
.shell.sidebar-collapsed .nav-label,
.shell.sidebar-collapsed .shortcut-label,
.shell.sidebar-collapsed .tab > .ui-icon:last-child,
.shell.sidebar-collapsed .archive,
.shell.sidebar-collapsed .active-user-card { display: none; }
.shell.sidebar-collapsed .sidebar .tab,
.shell.sidebar-collapsed .sidebar .control-panel-button,
.shell.sidebar-collapsed .sidebar .logout-button {
  width: 44px; height: 44px; min-height: 44px; margin-inline: auto;
  display: flex; justify-content: center; padding: 0; border: 0; font-size: 13px;
}
.shell.sidebar-collapsed .sidebar-control { padding: 0; }
.shell.sidebar-collapsed .sidebar .logout-button { margin-top: 6px; color: var(--red); background: transparent; box-shadow: none; }
.sidebar-backdrop { display: none; }
.workspace { padding: 0; }
.workspace-chrome {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center;
  gap: 16px; height: 64px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.workspace-menu-button { min-width: 36px; width: 36px; min-height: 36px; padding: 7px; color: var(--muted); }
.workspace-menu-button .ui-icon { width: 20px; height: 20px; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 12px; }
.workspace-breadcrumb strong { color: var(--ink); font-weight: 600; white-space: nowrap; }
.workspace-breadcrumb .ui-icon { width: 12px; height: 12px; }
.workspace-breadcrumb > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome-status { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.clock-label { display: flex; align-items: center; gap: 6px; }
.clock-label .ui-icon { width: 15px; height: 15px; }
#previewNotice { color: var(--orange); border: 1px solid var(--line); background: var(--orange-soft); border-radius: 6px; padding: 3px 8px; }
.workspace-content { max-width: 1600px; margin: 0 auto; padding: 28px 32px 32px; }
.topbar { gap: 24px; margin-bottom: 24px; }
.eyebrow { text-transform: none; font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.page-description { color: var(--muted); font-size: 12px; margin: 6px 0 0; font-weight: 400; }
.top-actions { flex-direction: row; align-items: center; gap: 12px; }
.top-actions .primary { min-height: 38px; padding-inline: 16px; font-size: 12px; box-shadow: none; }
.day-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.day-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.day-state.is-verified::before { background: var(--green); }
.summary-grid { gap: 16px; margin-bottom: 24px; }
.metric { padding: 18px 16px 14px; border-radius: 10px; box-shadow: none; min-height: 118px; }
.metric::before { display: none; }
.metric .metric-label { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 12px; }
.metric .metric-icon { position: absolute; right: 15px; top: 17px; width: 17px; height: 17px; color: var(--orange); }
.metric.positive .metric-icon { color: var(--green); }
.metric.negative .metric-icon { color: var(--red); }
.metric.neutral .metric-icon { color: var(--blue); }
.metric strong { font-size: clamp(18px, 1.65vw, 24px); font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
.metric .metric-caption { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin: 9px 0 0; }
.main-panel, .side-panel { border-radius: 10px; box-shadow: none; backdrop-filter: none; overflow: hidden; }
.panel-head { padding: 20px; min-height: 82px; background: var(--surface); gap: 12px; }
.panel-head > div:first-child { margin-right: auto; }
.panel-head .eyebrow { font-size: 10px; margin-bottom: 4px; }
.cash-total-badge { border: 0; background: transparent; box-shadow: none; padding: 0; }
.cash-total-badge > span { font-size: 10px; font-weight: 400; }
.cash-total-badge strong { font-size: 15px; font-weight: 600; }
.cash-total-badge .df-cash-total { font-size: 11px; font-weight: 500; }
.cash-scale-control { background: var(--soft); border-radius: 6px; padding: 3px; border: 1px solid var(--line); }
.cash-scale-control button { min-height: 25px; min-width: 34px; font-size: 10px; border-radius: 4px; padding: 2px 5px; }
.cash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.cash-card, .entry-card, .commission-row { border-radius: 8px; box-shadow: none; }
.cash-card header { min-height: 46px; padding: 12px 14px; font-size: 12px; }
.cash-card header strong { font-weight: 600; }
.cash-card header span { font-weight: 600; }
.cash-row { min-height: 39px; padding: 9px 14px; font-size: 11px; gap: 8px; }
.cash-row .amount { font-weight: 500; }
.cash-row:last-child { min-height: 42px; font-weight: 600; }
.cash-row:last-child .amount { font-weight: 600; }
.cash-row small { font-weight: 400; font-size: 10px; }
.expense-title { font-size: 12px; font-weight: 600; line-height: 1.5; }
.expense-title small { font-weight: 400; }
.expense-actions button { font-size: 10px; font-weight: 500; }
.monthly-report { margin: 0 20px 20px; background: var(--surface); border-radius: 8px; }
.monthly-report header { padding: 16px; }
.monthly-report h3 { font-size: 17px; }
.report-date { font-size: 11px; font-weight: 400; }
.report-date strong { font-size: 14px; font-weight: 600; }
.report-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px; gap: 10px; }
.report-item { display: grid; justify-content: stretch; align-content: start; min-height: 78px; gap: 8px; padding: 12px; }
.report-item span { font-size: 11px; font-weight: 400; }
.report-item strong { font-size: 15px; font-weight: 600; }
.report-item small { font-size: 9px; }
.control-page, .users-page, .admin-report-page { padding: 20px; gap: 16px; }
.control-block { background: var(--surface); border-radius: 8px; padding: 16px; }
.control-spoiler { padding: 0; }
.control-spoiler > summary { padding: 16px; }
.control-block-head h3 { font-size: 15px; font-weight: 600; }
.control-spoiler-body { padding: 16px; }
.control-page .control-item { padding: 12px; }
.control-item strong, .user-card strong { font-weight: 600; font-size: 13px; }
.control-item span, .user-card span { font-weight: 400; font-size: 11px; }
.control-actions button { font-size: 11px; font-weight: 500; }
.user-card, .report-filter-bar, .report-breakdown { background: var(--surface); border-radius: 8px; }
.report-filter-bar { grid-template-columns: minmax(0, 1fr) repeat(4, minmax(120px, 1fr)); padding: 16px; }
.report-filter-heading h3 { font-size: 17px; }
.report-overview { gap: 12px; }
.report-overview article strong { font-weight: 600; }
.report-table-row strong { font-weight: 500; }
.empty { font-weight: 400; padding: 42px 20px; font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 12px; }
.dialog-card { padding: 24px; gap: 16px; }
.dialog-head { padding-bottom: 8px; }
.dialog-head h2 { font-size: 20px; }
.dialog-card label { font-weight: 500; }
.login-card { padding: 32px; gap: 18px; border-radius: 12px; background: var(--surface); box-shadow: none; }
.login-card .brand-mark { width: 40px; height: 44px; }
.login-card h1 { font-size: 26px; }
.auth-helper { font-size: 11px; font-weight: 400; }
.auth-helper strong { font-weight: 600; }
@media (max-width: 1350px) {
  .workspace-content { padding: 24px; }
  .workspace-chrome { padding-inline: 24px; }
  .summary-grid { gap: 12px; }
  .metric { padding: 16px 12px 12px; }
  .metric strong { font-size: 19px; }
  .metric .metric-icon { right: 12px; top: 16px; width: 15px; height: 15px; }
  .panel-head { flex-wrap: wrap; }
  .cash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-heading { grid-column: 1 / -1; }
}
@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column; align-items: flex-end; }
}
@media (max-width: 900px) {
  .shell, .shell.sidebar-collapsed { display: block; }
  .sidebar, .shell.sidebar-collapsed .sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; z-index: 10;
    width: 240px; height: calc(100dvh - 64px); max-height: none;
    padding: 20px 12px 12px; border-right: 1px solid var(--line); border-bottom: 0;
    transform: translateX(0); transition: transform 180ms ease;
  }
  .shell.sidebar-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; }
  .shell:not(.sidebar-collapsed) .sidebar-backdrop {
    position: fixed; display: block; z-index: 9; inset: 64px 0 0;
    background: var(--ink); opacity: .22; border-radius: 0; padding: 0; width: 100%; height: calc(100dvh - 64px);
  }
  .sidebar .brand { margin-bottom: 24px; }
  .sidebar-shortcuts { display: grid; overflow: visible; padding: 0; }
  .day-list { display: grid; overflow: visible; padding-bottom: 0; }
  .archive-month-days { display: grid; }
  .sidebar .day-button { flex: initial; min-height: 42px; }
  .workspace-chrome { padding-inline: 20px; gap: 12px; }
  .workspace-content { padding: 24px 20px; }
  .top-actions { flex-direction: row; align-items: center; }
  .chrome-status { gap: 10px; }
  .chrome-status .clock-label { display: none; }
  .workspace-breadcrumb { font-size: 11px; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .workspace-chrome { padding-inline: 14px; gap: 10px; }
  .workspace-content { padding: 20px 14px; }
  .workspace-breadcrumb { gap: 6px; }
  .workspace-breadcrumb strong { font-size: 11px; }
  .chrome-status { font-size: 9px; }
  #previewNotice { padding: 3px 5px; font-size: 9px; }
  .topbar { flex-direction: column; gap: 14px; margin-bottom: 20px; }
  h1 { font-size: 25px; }
  .page-description { font-size: 11px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-actions button { flex: 0 0 auto; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
  .metric { min-height: 109px; padding: 14px 12px 12px; }
  .metric:last-child { grid-column: 1 / -1; }
  .metric strong { font-size: 20px; white-space: nowrap; }
  .metric .metric-caption { font-size: 9px; }
  .metric .metric-icon { top: 14px; }
  .panel-head { padding: 16px; gap: 12px; align-items: flex-start; }
  .panel-head > div:first-child { flex: 1 1 100%; }
  .cash-scale-control { margin-right: auto; }
  .cash-total-badge { order: 0; width: auto; justify-items: end; }
  .cash-total-badge strong { font-size: 13px; }
  .cash-grid { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
  .cash-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cash-row.expense-row { grid-template-columns: minmax(0, 1fr); }
  .expense-row > .amount { grid-column: 1; grid-row: auto; margin-left: 0; }
  .monthly-report { margin: 0 16px 16px; }
  .monthly-report header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .report-date { justify-items: start; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .report-item { min-height: 72px; padding: 10px; }
  .report-item strong { font-size: 13px; }
  .control-page, .users-page, .admin-report-page { padding: 16px; }
  .control-block { padding: 14px; }
  .control-spoiler { padding: 0; }
  .report-filter-bar, .report-overview { grid-template-columns: minmax(0, 1fr); }
  .report-filter-heading { grid-column: auto; }
  .dialog-card { padding: 20px; }
  .login-card { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.group-warning { color: var(--red, #d63c3c); font-weight: 600; line-height: 1.5; }
.cash-card header strong small { display: block; font-size: 11px; font-weight: 400; margin-top: 4px; opacity: .8; }
