:root {
  color-scheme: light;
  --ink: #182b42;
  --muted: #566c82;
  --accent: #176659;
  --paper: #fff;
  --line: #dce5ed;
  --side: #12263a;
  --side-hover: #213951;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0; background: #f4f7fa; color: var(--ink); font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 3vw, 2.5rem); margin: 0 0 .25em; }
h2 { font-size: 1.2rem; margin: 0; }
a { color: #185789; }
button, input, select, textarea { font: inherit; }
input:not([type=checkbox]), select, textarea { border: 1px solid #bdcbd8; border-radius: 7px; background: #fff; padding: 7px 9px; max-width: 100%; }
button, .btn { border: 1px solid transparent; border-radius: 7px; background: var(--accent); color: #fff; padding: 7px 13px; font-weight: 650; cursor: pointer; }
button.secondary, .btn.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
button.danger, button.danger-btn { background: #a62632; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #5895d8; outline-offset: 2px; }
.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; z-index: 50; height: 100dvh; display: flex; flex-direction: column; background: var(--side); padding: 18px 12px; color: #eff6fc; }
.side-brand, .side-brand a, .side-link, .side-account button { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.side-brand { justify-content: space-between; margin: 0 0 28px; }
.side-brand a { font-size: 16px; font-weight: 740; }
.brand-icon { display: inline-grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 9px; background: #a4eddb; color: #133e37; font-weight: 850; }
.sidebar-toggle { background: var(--side-hover); min-width: 26px; padding: 1px 6px; font-size: 18px; }
.side-link { padding: 8px 9px; margin-bottom: 5px; border-radius: 7px; font-weight: 650; color: #d6e5f1; }
.side-link:hover, .side-link[aria-current=page] { background: var(--side-hover); color: #fff; }
.side-link[aria-current=page] .side-icon { color: #a4eddb; }
.side-icon { width: 20px; text-align: center; font-size: 18px; flex: none; }
.side-account { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid #375269; min-width: 0; }
.side-account strong, .side-account small { display: block; overflow: hidden; text-overflow: ellipsis; }
.side-account small { color: #bbccda; }
.side-account button { padding: 7px 0; background: transparent; margin-top: 8px; }
.app-content { padding: 27px clamp(15px, 2.8vw, 42px) 36px; min-width: 0; }
.app-content > .wrap { width: 100%; max-width: 100%; padding: 0; margin: 0; }
.app-content .top { margin-bottom: 20px; }
.app-content .muted, .muted { color: var(--muted); }
.app-content .card { overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.app-content .entry-editor { overflow: visible; padding: 14px; }
.app-content .floating-tooltip { white-space: pre-line; }
.overview-stats, .integration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin: 15px 0 23px; }
.integration-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); }
.metric, .integration-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px; }
.metric span { display: block; color: var(--muted); }
.metric strong { display: block; margin-top: 5px; font-size: 26px; font-variant-numeric: tabular-nums; }
.section-heading, .entry-heading, .integration-actions, .entry-month { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.entry-month { justify-content: flex-start; }
.entry-month label { display: inline; margin-right: 4px; }
.section-heading { margin-bottom: 9px; }
.source-status { color: var(--muted); font-size: 12px; }
.crumb { display: inline-block; margin-bottom: 8px; }
.feedback, .form-error { padding: 10px 12px; border-radius: 7px; background: #e3f2ed; color: #164e41; }
.form-error { background: #fce9ea; color: #8b2530; }
.entry-section { margin: 24px 0; scroll-margin-top: 12px; }
.app-content table { border-collapse: collapse; width: 100%; }
.app-content th, .app-content td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.app-content th { background: #eff4f8; }
.login-content { min-height: 100dvh; padding: 20px; display: grid; place-items: center; }
.login-card { width: min(100%, 375px); background: #fff; border: 1px solid var(--line); padding: 25px; border-radius: 14px; box-shadow: 0 10px 36px #12263a14; }
.login-card .brand-icon { margin-bottom: 14px; }
.login-card form { display: grid; gap: 7px; }
.login-card form button { margin-top: 9px; }
.app-shell[data-collapsed=true] { grid-template-columns: 62px minmax(0, 1fr); }
.app-shell[data-collapsed=true] .side-label { display: none; }
.app-shell[data-collapsed=true] .side-brand { flex-direction: column; }
.app-shell[data-collapsed=true] .sidebar-toggle { transform: rotate(180deg); }
@media (max-width: 750px) {
  .app-content { padding: 19px 12px; }
  .app-shell { grid-template-columns: 140px minmax(0, 1fr); }
  .app-shell[data-collapsed=true] { grid-template-columns: 50px minmax(0, 1fr); }
  .sidebar { padding: 12px 6px; }
  .entry-month { max-width: 100%; }
}
