/* Atlas Office: presentation only. Loaded after the existing layout.
   Navy carries hierarchy; gold is an accent. Status colors retain their meaning. */
:root {
  --canvas: #f6f7f9;
  --color-bg: var(--canvas);
  --white: #ffffff;
  --color-surface: #ffffff;
  --ink: #24364a;
  --ink-strong: #102d48;
  --muted: #657487;
  --muted-strong: #526277;
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --border: #dfe5ec;
  --line: var(--border);
  --soft: #f0f3f7;
  --green: #187552;
  --red: #b33d4c;
  --color-success: var(--green);
  --color-danger: var(--red);
  --shadow-sm: 0 2px 6px rgba(16,45,72,.025);
  --shadow-md: 0 16px 48px rgba(16,45,72,.12);
  --shadow: var(--shadow-md);
}

/* Shell and reading hierarchy */
.app, .modal, .toast {
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app { background: var(--canvas); }
.content { padding-top: 32px; }
.page-head { margin-bottom: 28px; gap: 20px; }
.page-head h1 { font-size: clamp(27px,2.4vw,34px); line-height: 1.2; font-weight: 650; letter-spacing: -.035em; }
.page-head p { max-width: 760px; margin-top: 9px; font-size: 14px; line-height: 1.65; }
.page-kicker { color: var(--gold-dark); font-size: 10px; font-weight: 650; letter-spacing: .12em; margin-bottom: 5px; }
.section-kicker { color: var(--muted); font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-bottom: 5px; }
.section-head h2 { color: var(--navy); font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.section-head h3 { color: var(--navy); font-size: 15px; font-weight: 650; }
.grid { gap: 20px; }
.grid > .section-card + .section-card { margin-top: 0; }
.section-card { padding: 24px; }
.card { border-color: var(--border); background: #fff; box-shadow: var(--shadow-sm); }
.card .card:not(.metric-button) { box-shadow: none; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); box-shadow: none; backdrop-filter: none; }
.breadcrumb { color: var(--muted); }
.sidebar { background: var(--navy-deep); box-shadow: none; }
.sidebar-head { border-bottom-color: rgba(255,255,255,.08); }
.sidebar-scroll { scrollbar-color: #456078 var(--navy-deep); }
.nav-group { margin-top: 20px; }
.nav-group h2 { color: #adbfd0; font-size: 10px; letter-spacing: .1em; }
.nav-item { color: #cad5e0; border-radius: 8px; min-height: 43px; transition: background .15s ease,color .15s ease; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: #19364e; box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { color: #9eb3c7; }
.nav-item.active .nav-icon { color: #dfbd7c; }
.profile-card { background: #091e31; border-top-color: rgba(255,255,255,.1); }
.header-popover { background: #fff; opacity: 1; backdrop-filter: none; border-color: var(--border); box-shadow: var(--shadow-md); }
.notification-btn { display: inline-grid; place-items: center; color: var(--navy); border-color: var(--border); background: #fff; }

/* Values and surfaces */
.metric-card { padding: 22px; min-height: 128px; }
.metric-label { color: var(--muted-strong); font-size: 12px; line-height: 1.5; font-weight: 500; }
.metric-value { color: var(--navy); font-size: clamp(24px,2.1vw,32px); line-height: 1.2; font-weight: 650; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric-value.teal { color: var(--navy); }
.metric-meta { font-size: 11px; line-height: 1.55; }
.money, .metric-value, .statement-totals strong, .admin-metric strong, .transaction-facts dd { font-variant-numeric: tabular-nums lining-nums; }
.home-today { padding: 0; }
.home-metrics { gap: 0; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.home-metrics .metric-card { min-height: 170px; border: 0; border-radius: 0; padding: 28px; background: transparent; }
.home-metrics .metric-card::after { display: none; }
.home-metrics .metric-card + .metric-card { border-left: 1px solid var(--border); }
.home-metrics .metric-card:first-child { position: relative; background: var(--navy); border-radius: 15px 0 0 15px; }
.home-metrics .metric-card:first-child::before { content: ""; width: 28px; height: 3px; background: var(--gold); margin-bottom: 16px; border-radius: 3px; }
.home-metrics .metric-card:first-child .metric-label,
.home-metrics .metric-card:first-child .metric-meta { color: #cbd8e5; }
.home-metrics .metric-card:first-child .metric-value { color: #fff; }
.home-metrics .metric-card:first-child .metric-value.red { color: #ffbfc7; }
.home-metrics .metric-card:first-child .help-tip { color: #e0c28b; border-color: #688094; background: transparent; }
.home-month-result { justify-content: space-between; gap: 10px 20px; padding: 17px 0 0; font-size: 13px; }
.home-month-result small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.home-month-result > strong { font-size: 18px; }
.home-routine-actions { gap: 12px; margin: 24px 0 28px; }
.home-routine-actions .btn { min-height: 48px; font-size: 12px; font-weight: 600; gap: 10px; }
.home-routine-actions .ui-icon { color: var(--gold-dark); }
.home-analysis > summary, .statement-disclosure > summary { padding: 22px 24px; font-size: 15px; font-weight: 600; }
.home-analysis > summary::marker, .statement-disclosure > summary::marker, .form-more > summary::marker { color: var(--gold-dark); }
.home-analysis > summary small, .statement-disclosure > summary small { line-height: 1.5; font-size: 12px; }
.home-analysis .disclosure-body { padding: 0 24px 24px; }
.home-analysis .disclosure-body > .grid > section > h2 { font-size: 17px; font-weight: 650; color: var(--navy); }
.home-analysis .metric-card { background: var(--canvas); border: 0; }

/* Deliberate, consistent interaction states */
.btn { min-height: 42px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--navy); transition: background .15s ease,border-color .15s ease,box-shadow .15s ease; }
.btn:hover { transform: none; filter: none; background: #f2f5f8; border-color: #b9c6d4; box-shadow: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 2px 4px rgba(16,45,72,.1); }
.btn.primary:hover { background: #1c405f; border-color: #1c405f; }
.btn.teal { color: #fff; background: var(--gold-dark); border-color: var(--gold-dark); }
.btn.teal:hover { background: #785421; }
.btn.ghost { background: transparent; color: var(--gold-dark); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: #f7f1e6; }
.btn.danger { color: #a62d3e; border-color: #efd9dd; background: #fff7f8; }
.btn.danger:hover { background: #fdecef; border-color: #ddb0b9; }
.btn:disabled { transform: none; box-shadow: none; opacity: .48; }
.icon-btn:hover, .mini-btn:hover, .modal-close:hover { background: var(--soft); }
.app :focus-visible, .modal :focus-visible, .header-popover :focus-visible { outline: 2px solid #927035; outline-offset: 3px; }
.ui-icon { pointer-events: none; }
.tag { background: #edf2f7; color: #455c73; font-weight: 550; padding: 5px 10px; }
.tag.success { color: #166849; background: #edf7f1; }
.tag.danger { color: #a02e3e; background: #fff0f2; }
.tag.warning { color: #825914; background: #fcf3df; }
.tabs { padding: 5px; background: #eaf0f5; border-radius: 10px; }
.tab { border-radius: 7px; font-weight: 600; }
.tab.active { color: var(--navy); background: #fff; box-shadow: 0 1px 4px rgba(16,45,72,.09); }
.admin-tabs { background: #edf1f5; border-color: var(--border); border-radius: 12px; }
.admin-tabs button { font-size: 12px; font-weight: 600; }
.admin-tabs button.active { box-shadow: none; }

/* Tables: quiet chrome, visible actions and readable numbers */
.table-wrap { border-color: var(--border); border-radius: 10px; }
th { padding-block: 14px; background: #f5f7fa; color: var(--muted-strong); font-size: 11px; font-weight: 650; border-bottom-color: var(--border); }
td { padding-block: 16px; border-bottom-color: #edf0f4; color: var(--ink); font-size: 12px; line-height: 1.55; }
tbody tr:hover { background: #f7f9fc; }
tbody tr:focus-within { background: #f3f6fa; }
.transaction-name { color: var(--navy); }
.transaction-detail-link { text-decoration: none; }
.transaction-detail-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.subtle-text { color: var(--muted); line-height: 1.5; }
.statement-workspace { box-shadow: none; }
.statement-totals { margin: 20px 0 16px; border-top: 0; border-bottom: 1px solid var(--border); padding-bottom: 18px; color: var(--muted-strong); }
.statement-totals strong { margin-left: 4px; color: var(--navy); }
.statement-table .row-actions { gap: 6px; flex-wrap: nowrap; min-width: 112px; }
.statement-table .mini-btn { border-radius: 7px; background: transparent; color: var(--muted-strong); min-height: 34px; font-size: 11px; }
.statement-table .mini-btn.danger, .statement-table .mini-btn[data-action="delete-tx"] { color: #a62d3e; }
.inline-category-select { border-color: transparent; background-color: #f3f6f9; }
.inline-category-select:hover, .inline-category-select:focus { border-color: #bbc9d7; }
.filter-chip { border-color: #d8e1ea; color: var(--navy); background: #edf3f8; }
.filter-chip:hover { background: #e0eaf3; }
.statement-pager { padding-top: 18px; }
.statement-card-chip { background: #fff; }
.statement-card-chip:hover, .statement-card-chip.active { background: #faf6ee; box-shadow: none; }

/* Forms and feedback */
.app .field-input, .app select, .modal .field-input, .modal select, .modal textarea { min-height: 44px; border-color: #cfd8e3; color: var(--ink); background-color: #fff; font-size: 13px; }
.app .inline-category-select { min-height: 36px; border-color: transparent; background-color: #f3f6f9; }
.app .inline-category-select:hover, .app .inline-category-select:focus { border-color: #bbc9d7; }
.app input::placeholder, .modal input::placeholder, .modal textarea::placeholder { color: #728094; font-weight: 400; }
.field > span { color: var(--ink); font-size: 12px; font-weight: 600; }
.app .field-input:focus, .app select:focus, .modal .field-input:focus, .modal select:focus, .modal textarea:focus { border-color: #927035; box-shadow: 0 0 0 3px rgba(181,138,69,.12); }
.app input[readonly], .app input:disabled, .modal input[readonly], .modal input:disabled, .modal select:disabled { background: #eef1f5; color: #69788a; border-color: #dde3ea; cursor: not-allowed; }
.modal { background: #fff; border: 1px solid var(--border); box-shadow: 0 24px 80px rgba(10,33,55,.22); }
.modal-head { padding: 24px; border-bottom-color: var(--border); background: #fff; }
.modal-head h2 { font-size: 22px; font-weight: 650; color: var(--navy); letter-spacing: -.02em; }
.modal-body { padding: 24px; }
.modal-actions { background: #f8f9fb; border-top-color: var(--border); padding: 18px 24px; }
.modal-close { display: inline-grid; place-items: center; color: var(--muted-strong); background: var(--soft); }
.transaction-choices button { padding: 22px; min-height: 112px; transition: border-color .15s ease,background .15s ease; }
.transaction-choices button:hover { border-color: #c4a261; background: #fbf8f1; }
.transaction-choices strong { font-size: 15px; font-weight: 650; }
.form-more { padding-top: 18px; margin-top: 24px; }
.form-more summary { font-size: 13px; }
.empty { min-height: 260px; padding: 32px 24px; gap: 12px; }
.empty img { width: 112px; height: 96px; object-fit: contain; margin: 0 0 6px; }
.empty strong { font-size: 17px; font-weight: 650; color: var(--navy); }
.empty > span { max-width: 410px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.progress { height: 8px; background: #e9eef3; }
.progress > span { background: var(--navy); }
.chart-group i.in { background: var(--navy); }
.chart-group i.out { background: var(--gold); }
.legend span::before { background: var(--navy); }
.legend span:last-child::before { background: var(--gold); }
.toast, .toast.warning, .toast.error { color: var(--ink); background: #fff; border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.toast .toast-mark { color: #166849; background: #edf7f1; }
.toast.warning .toast-mark { color: #825914; background: #fcf3df; }
.toast.error .toast-mark { color: #a02e3e; background: #fff0f2; }

/* Client experience: page-only grouping, contextual actions and a focused editor. */
.statement-table .statement-day th { padding: 13px 16px; background: #f2f5f8; border-block: 1px solid #e3e9ef; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); text-align: left; }
.statement-day th > span { font-weight: 650; }
.statement-day small { margin-left: 14px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.statement-table .transaction-date { white-space: nowrap; color: var(--muted-strong); font-size: 12px; }
.statement-table .transaction-description { min-width: 190px; max-width: 350px; white-space: normal; overflow-wrap: anywhere; }
.statement-table .transaction-origin { color: var(--muted); font-size: 12px; font-weight: 400; }
.statement-group-help { margin: 16px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.statement-table .amount-cell { text-align: right; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.statement-table .transaction-more { letter-spacing: 2px; min-width: 38px; }
.transaction-options { position: fixed; z-index: 85; min-width: 215px; max-width: calc(100vw - 24px); padding: 6px; background: #fff; border: 1px solid #dce3eb; border-radius: 12px; box-shadow: 0 12px 36px rgba(10,33,55,.18); }
.transaction-options[hidden] { display: none; }
.transaction-options button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; background: #fff; text-align: left; border-radius: 7px; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.transaction-options button:hover { background: #f2f5f8; }
.transaction-options button.menu-danger { color: #a02e3e; }
.transaction-options button:focus-visible { outline: 2px solid #927035; outline-offset: -2px; }
body:has(.transaction-drawer) { overflow: hidden; }
.modal-backdrop.drawer-backdrop { display: flex; padding: 0; justify-content: flex-end; align-items: stretch; background: rgba(10,33,55,.2); backdrop-filter: none; }
.modal.transaction-drawer { width: min(560px,100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 16px 0 0 16px; display: flex; flex-direction: column; overflow: hidden; }
.transaction-drawer > .modal-head { flex: 0 0 auto; }
.transaction-drawer > form { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.transaction-drawer .modal-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.transaction-drawer .modal-actions, .transaction-drawer .modal-form-error { flex: 0 0 auto; }
.transaction-drawer .modal-actions { flex-wrap: wrap; }
.transaction-detail-summary { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.transaction-detail-summary h3 { font-size: 21px; line-height: 1.4; font-weight: 600; margin: 8px 0 16px; overflow-wrap: anywhere; }
.transaction-detail-summary > strong { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.transaction-facts dd { overflow-wrap: anywhere; }
.getting-started { margin: 0 0 28px; padding: 24px; border-top: 3px solid var(--gold); }
.getting-started-compact { max-width: 980px; }
.guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.guide-heading h2 { margin: 4px 0 6px; color: var(--navy); font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.guide-heading p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.guide-heading > button { flex-shrink: 0; }
.guide-progress { display: flex; align-items: center; gap: 16px; margin: 20px 0; font-size: 12px; color: var(--muted-strong); }
.guide-progress progress { width: 140px; max-width: 35%; height: 6px; border: 0; border-radius: 5px; overflow: hidden; background: #e9eef3; color: var(--gold); }
.guide-progress progress::-webkit-progress-bar { background: #e9eef3; }
.guide-progress progress::-webkit-progress-value { background: var(--gold); }
.guide-progress progress::-moz-progress-bar { background: var(--gold); }
.guide-current { display:grid; grid-template-columns:auto minmax(0,1fr); gap:14px; align-items:start; padding:17px; border:1px solid #d8c49c; border-radius:14px; background:linear-gradient(135deg,#fff 0%,#fffaf0 100%); }
.guide-current .guide-step-number { margin:0; background:var(--navy); color:#fff; }.guide-current h3 { margin:4px 0 6px; color:var(--navy); font-size:16px; }.guide-current p { margin:0; color:var(--muted-strong); font-size:13px; line-height:1.6; }
.guide-details { margin-top:12px; border-top:1px solid var(--border); }.guide-details > summary { padding:13px 2px 3px; color:var(--muted-strong); font-size:12px; font-weight:650; cursor:pointer; }.guide-details[open] > summary { color:var(--navy); }
.guide-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.guide-steps-compact { grid-template-columns:repeat(3,minmax(0,1fr)); }
.guide-steps > li { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfd; }
.guide-steps > li.is-current { background: #fff; border-color: #baa071; }
.guide-step-number { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 10px; border-radius: 50%; background: #e9eef3; color: var(--muted-strong); font-size: 12px; font-weight: 650; }
.is-current .guide-step-number { background: var(--navy); color: #fff; }
.is-done .guide-step-number { background: #e6f3ec; color: #166849; }
.guide-steps small { display:block; margin-bottom:4px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }.guide-steps h3 { margin: 0 0 6px; color: var(--ink); font-size: 13px; line-height: 1.5; font-weight: 650; }
.guide-steps p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.guide-step-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.guide-step-actions .btn { min-height: 40px; padding: 9px 12px; white-space: normal; font-size: 12px; }
.guide-restore { display: flex; justify-content: flex-end; margin: -12px 0 16px; }
@media (max-width:1100px) {
  .guide-steps,.guide-steps-compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-metrics .metric-card { padding: 22px; }
  .home-metrics .metric-value { font-size: 26px; }
  .home-routine-actions .btn { flex-basis: calc(50% - 12px); }
}
@media (max-width:760px) {
  .getting-started { padding: 20px; }
  .guide-heading { flex-wrap: wrap; }
  .guide-heading > button { padding-left: 0; min-height: 44px; }
  .guide-current { padding:15px; }.guide-steps,.guide-steps-compact { grid-template-columns: 1fr; }
  .guide-steps > li { display: flex; gap: 12px; }
  .guide-step-number { flex: 0 0 28px; margin-bottom: 0; }
  .guide-step-actions .btn { min-height: 44px; }
  .modal.transaction-drawer { width: 100%; border: 0; border-radius: 0; }
  .transaction-drawer .modal-actions .btn { flex: 1; }
  .content { padding: 24px 18px 40px; }
  .page-head { gap: 16px; margin-bottom: 24px; }
  .page-head p { font-size: 13px; }
  .section-card { padding: 20px; }
  .grid { gap: 16px; }
  .grid.home-metrics { grid-template-columns: 1fr 1fr; gap: 0; }
  .home-metrics .metric-card:first-child { grid-column: 1 / -1; min-height: 166px; border-radius: 15px 15px 0 0; }
  .home-metrics .metric-card { min-height: 126px; padding: 20px; }
  .home-metrics .metric-card:nth-child(2) { border-left: 0; }
  .home-metrics .metric-value { font-size: clamp(21px,5.5vw,28px); }
  .home-metrics .metric-card:first-child .metric-value { font-size: 32px; }
  .home-routine-actions { margin: 20px 0 24px; gap: 10px; }
  .home-routine-actions .btn { flex-basis: calc(50% - 10px); flex-direction: column; min-height: 76px; padding: 14px 8px; gap: 8px; }
  .home-month-result > strong { font-size: 17px; }
  .home-analysis > summary, .statement-disclosure > summary { padding: 20px; }
  .home-analysis .disclosure-body { padding: 0 20px 20px; }
  .modal-head, .modal-body { padding: 20px; }
  .modal-head h2 { font-size: 20px; }
  .modal-actions { padding: 16px 20px; }
  .modal-actions .btn { min-height: 44px; }
  .statement-table .mini-btn { min-height: 44px; padding-inline: 12px; }
  .app .inline-category-select { min-height: 44px; }
  .statement-pager .btn { min-height: 44px; }
  .header-popover { max-width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
