:root {
  color-scheme: light;
  --ink: #18243a;
  --muted: #526179;
  --line: #dce3ed;
  --paper: #fff;
  --ground: #f3f5fa;
  --accent: #254bc8;
  --accent-dark: #1b399f;
  --accent-soft: #eef2ff;
  --sidebar: #121d34;
  --sidebar-muted: #aab9d6;
  --danger: #a12e44;
  --radius: 13px;
  --shadow: 0 3px 12px rgb(22 41 77 / 5%);
  font-family: Inter, "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); line-height: 1.65; }
main { min-width: 0; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #6786f3;
  outline-offset: 3px;
}
h1, h2, h3 { line-height: 1.35; margin: 0 0 .8rem; }
h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.25rem); font-weight: 750; letter-spacing: -.038em; }
h2 { font-size: 1.22rem; font-weight: 750; letter-spacing: -.022em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9rem; }
p:last-child { margin-bottom: 0; }

.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.workspace-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--sidebar);
  color: #f8fbff;
}
.sidebar-top { padding: 1.48rem 1.12rem; }
.brand { display: inline-flex; align-items: center; gap: .62rem; color: #fff; text-decoration: none; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-wordmark { font-size: 1.04rem; font-weight: 780; letter-spacing: .105em; }
.brand-mark { position: relative; display: inline-block; width: 2.3rem; height: 2.3rem; border-radius: 9px; background: #5276fa; }
.brand-mark::before, .brand-mark::after { position: absolute; content: ""; border-radius: 2px; background: #fff; }
.brand-mark::before { width: .29rem; height: 1.05rem; top: .58rem; left: .69rem; transform: skewY(-16deg); }
.brand-mark::after { width: .29rem; height: .77rem; top: .58rem; left: 1.25rem; transform: skewY(-16deg); opacity: .72; }
button[data-install-app][hidden] { display: none; }
.sidebar-body { display: flex; flex: 1; flex-direction: column; min-height: min-content; }
.sidebar-nav { flex: 1; padding: .12rem .78rem 1rem; }
.nav-section { display: grid; gap: .1rem; margin: 0 0 .85rem; }
.nav-section:last-child { margin: 0; }
.nav-section-label {
  color: var(--sidebar-muted);
  margin: 0 .72rem .19rem;
  font-size: .73rem;
  letter-spacing: .065em;
  font-weight: 650;
}
.sidebar-nav a {
  position: relative;
  color: #dae4f7;
  display: block;
  text-decoration: none;
  padding: .42rem .73rem;
  border-radius: 7px;
  font-size: .88rem;
  line-height: 1.55;
}
.sidebar-nav a:hover, .account-link:hover { background: #25324d; color: #fff; }
.sidebar-nav a[aria-current] { background: #2b3e68; color: #fff; font-weight: 750; }
.sidebar-nav a[aria-current]::after {
  position: absolute;
  content: "";
  top: 25%;
  bottom: 25%;
  right: .55rem;
  width: 3px;
  border-radius: 3px;
  background: #a4b6ff;
}
.sidebar-account { display: flex; flex-direction: column; padding: .65rem .8rem 1rem; border-top: 1px solid #354360; gap: .34rem; }
.account-link { display: grid; color: var(--sidebar-muted); gap: .05rem; text-decoration: none; border-radius: 7px; padding: .42rem .62rem; font-size: .75rem; }
.account-email { color: #f0f4ff; font-size: .82rem; overflow-wrap: anywhere; }
.sidebar-account .logout-button, .sidebar-top .menu-toggle {
  color: #e9efff;
  background: transparent;
  border-color: #526483;
  padding: .3rem .57rem;
  font-size: .77rem;
}
.sidebar-account .logout-button:hover, .sidebar-top .menu-toggle:hover { background: #25324d; }
.sidebar-top .menu-toggle { display: none; }
.workspace-content { min-width: 0; }
.workspace-bar {
  min-height: 59px;
  padding: .8rem clamp(1rem, 3vw, 2.25rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .83rem;
}
.workspace-company { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.workspace-bar time { white-space: nowrap; }
.workspace-main, main.wrap { max-width: 1530px; margin: auto; padding: 1.8rem clamp(1rem, 3vw, 2.25rem) 3rem; }
.workspace-main:focus { outline: none; }
.skip-link { position: fixed; left: .85rem; top: .85rem; z-index: 3; transform: translateY(-150%); padding: .6rem .9rem; background: #fff; border: 2px solid var(--accent); }
.skip-link:focus { transform: translateY(0); }
.page-title { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .65rem 1.2rem; margin-bottom: 1.2rem; }

.card, .subnav, .notice {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(.92rem, 2vw, 1.32rem);
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.card .card { box-shadow: none; }
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .45rem; }
.subnav a { font-size: .89rem; padding: .39rem .66rem; text-decoration: none; border-radius: 7px; }
.subnav a:hover, .subnav a[aria-current] { background: var(--accent-soft); }
.subnav a[aria-current] { font-weight: 750; }
.notice { background: #edf8f3; border-color: #aed9cb; color: #21574a; }
.error { background: #fff1f3; border-color: #e7b3bd; color: #742433; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 1rem; }
.grid > * { min-width: 0; }
.kpi { font-size: clamp(1.45rem, 3vw, 2.08rem); font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.actions, .filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: .8rem; }
.actions:last-child, .filters:last-child { margin-bottom: 0; }
form.inline { display: inline; }
.fields, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: .85rem; margin-bottom: .9rem; }
label { display: flex; gap: .28rem; flex-direction: column; color: var(--ink); font-size: .88rem; font-weight: 650; min-width: 0; }
.registration-field { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem; align-items: stretch; }
.registration-prefix { display: grid; place-items: center; min-width: 2rem; padding-inline: .35rem; border: 1px solid #b2bed1; border-radius: 8px; background: var(--accent-soft); }
.check { flex-direction: row; align-items: center; gap: .6rem; align-self: end; padding: .55rem 0; }
input, select, textarea, button, .button { font: inherit; }
input:not([type=checkbox]), select, textarea {
  width: 100%;
  min-height: 2.53rem;
  padding: .41rem .6rem;
  border: 1px solid #b2bed1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=file]::file-selector-button { font: inherit; border: 0; border-radius: 4px; margin-right: .5rem; background: var(--accent-soft); color: var(--accent-dark); padding: .08rem .44rem; }
textarea { min-height: 6rem; resize: vertical; }
button, .button {
  display: inline-block;
  cursor: pointer;
  padding: .49rem .82rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); color: #fff; }
.button.secondary, button.secondary { color: var(--accent-dark); background: #fff; border-color: #aab8d2; }
.button.secondary:hover, button.secondary:hover { background: var(--accent-soft); }
button.danger { color: var(--danger); background: #fff; border-color: #dba4af; }
button.danger:hover { background: #fff1f3; }
button:disabled { opacity: .56; cursor: default; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: .89rem; }
caption { text-align: left; margin-bottom: .65rem; font-weight: 750; }
th { font-weight: 720; background: #f0f3fa; white-space: nowrap; color: #35445e; }
td, th { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
.card details { margin: .75rem 0; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; }
.card details > summary { color: var(--accent-dark); cursor: pointer; font-weight: 700; font-size: .87rem; }
.card details[open] > summary { margin-bottom: .65rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { display: inline-block; border-radius: 6px; padding: .13rem .45rem; background: #edf2ff; color: #28447b; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.table-form td { padding: .38rem; min-width: 6rem; }
.table-form td:first-child { min-width: 10rem; }
.table-form tbody tr:hover { background: transparent; }
.document { max-width: 920px; margin-inline: auto; }
.document-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1rem; }
.document h2 { margin-top: 1rem; }
.document .total { margin: 1.15rem 0; border-bottom: 2px solid var(--ink); width: fit-content; font-size: 1.55rem; font-weight: 750; }
.record-details { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.record-details dt { color: var(--muted); }
.record-details dd { margin: 0; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.dashboard { display: grid; gap: 1.15rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: .88rem; }
.metric {
  --metric-accent: var(--accent);
  --metric-background: #eef2ff;
  display: grid;
  align-content: start;
  min-width: 0;
  gap: .18rem;
  padding: 1.05rem 1.13rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--metric-accent);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.metric:hover { background: var(--metric-background); color: var(--ink); }
.metric-teal { --metric-accent: #147e78; --metric-background: #eaf8f6; }
.metric-violet { --metric-accent: #7950be; --metric-background: #f4effb; }
.metric-amber { --metric-accent: #a96822; --metric-background: #fbf3e9; }
.metric-label { color: var(--muted); font-weight: 700; font-size: .88rem; }
.metric-value { font-size: clamp(1.48rem, 2.7vw, 2.11rem); font-weight: 780; letter-spacing: -.04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; line-height: 1.22; }
.metric-value span { font-size: .82rem; font-weight: 650; letter-spacing: 0; }
.metric-note { font-size: .77rem; color: var(--muted); }
.dashboard-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 365px), 1fr)); gap: .88rem; }
.dashboard-panel { margin: 0; min-width: 0; }
.panel-header { display: flex; gap: .4rem 1rem; justify-content: space-between; align-items: baseline; flex-wrap: wrap; margin: 0 0 .72rem; }
.panel-header h2 { margin: 0; }
.panel-header a, .panel-header .muted { font-size: .78rem; }
.trend-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.trend-list { display: grid; gap: .63rem; padding: .18rem 0; }
.trend-list li { display: grid; grid-template-columns: 2.6rem minmax(15px, 1fr) max-content; align-items: center; gap: .5rem; font-size: .82rem; }
.trend-list meter { width: 100%; height: .83rem; border: 0; background: #edf0f7; border-radius: .6rem; }
.trend-list meter::-webkit-meter-bar { background: #edf0f7; border: 0; }
.trend-list meter::-webkit-meter-optimum-value { background: #607dee; }
.trend-list meter::-moz-meter-bar { background: #607dee; }
.trend-list meter.negative::-webkit-meter-optimum-value { background: #ba596a; }
.trend-list meter.negative::-moz-meter-bar { background: #ba596a; }
.trend-amount { min-width: 5rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 680; }
.recent-list li + li { border-top: 1px solid var(--line); }
.recent-entry { display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content; align-items: center; gap: .44rem .7rem; padding: .52rem 0; color: var(--ink); text-decoration: none; }
.recent-entry:hover { color: var(--accent-dark); }
.recent-primary { display: grid; min-width: 0; overflow-wrap: anywhere; }
.recent-primary strong { font-size: .88rem; line-height: 1.4; }
.recent-primary small { font-size: .72rem; color: var(--muted); }
.recent-amount { font-size: .83rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.dashboard-empty { color: var(--muted); margin: .95rem 0 .35rem; font-size: .87rem; }
.summary-grid { gap: .7rem; margin-bottom: 1rem; }
.summary-grid > div { padding: .75rem .9rem; border-radius: 9px; background: #f1f4fc; }
.summary-grid .total { margin: .18rem 0 0; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.auth-shell { display: grid; grid-template-columns: minmax(300px, .86fr) minmax(0, 1.14fr); min-height: 100vh; }
.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 85% 80%, #2e4e9c 0, transparent 59%), #121d34;
  color: #fff;
  padding: clamp(1.4rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 12vh, 8rem);
}
.auth-brand::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #acc4ff17 1px, transparent 1px) 0 0 / 35px 35px,
    linear-gradient(#acc4ff17 1px, transparent 1px) 0 0 / 35px 35px;
  mask-image: linear-gradient(140deg, transparent 30%, #000 100%);
}
.auth-tagline { font-size: clamp(1.53rem, 3.2vw, 2.75rem); line-height: 1.45; letter-spacing: -.035em; font-weight: 740; }
.auth-main { margin: auto; width: min(100%, 570px); padding: 2rem clamp(1rem, 6vw, 3rem); }
.auth-main .page-title { margin-bottom: 1rem; }
.login, .account-settings { max-width: 500px; }
.login label, .account-settings label { margin-bottom: .9rem; }
.login { padding: clamp(1.05rem, 3vw, 1.7rem); }
.auth-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .84rem; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 196px minmax(0, 1fr); }
  .dashboard-lower { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .workspace { display: block; }
  .workspace-sidebar { position: static; height: auto; overflow: visible; }
  .sidebar-top { display: flex; justify-content: space-between; align-items: center; padding: .73rem 1rem; gap: .5rem; }
  .has-menu-js .sidebar-top .menu-toggle { display: inline-block; }
  .has-menu-js .workspace-sidebar:not([data-open]) .sidebar-body { display: none; }
  .sidebar-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: .45rem; }
  .nav-section { align-content: start; margin: 0; }
  .sidebar-account { display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
  .workspace-bar { min-height: 45px; padding-top: .55rem; padding-bottom: .55rem; }
  .workspace-main { padding-top: 1.2rem; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { padding: 1rem; gap: 1.1rem; }
  .auth-tagline { font-size: 1.32rem; }
  .auth-tagline br { display: none; }
  .auth-main { align-self: start; margin-top: 0; }
}
@media (max-width: 410px) {
  .dashboard-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); }
  .metric { padding: .72rem; }
  .recent-entry { grid-template-columns: minmax(0, 1fr) max-content; }
  .recent-entry .status { justify-self: start; }
}
@page { margin: 14mm; }
@media print {
  body { color: #111; background: #fff; }
  .workspace { display: block; min-height: 0; }
  .workspace-bar, .workspace-sidebar, .page-title, .actions, .subnav, .skip-link, .no-print { display: none !important; }
  .workspace-main, main.wrap { max-width: none; padding: 0; }
  .document, .card { max-width: none; border: 0; padding: 0; box-shadow: none; }
  .document > h2:first-child { font-size: 1.45rem; margin-bottom: 1rem; }
  .table-wrap { overflow: visible; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  th, td { border-color: #aaa; }
  a { color: inherit; text-decoration: none; }
}
.setup-shell{min-height:100vh;display:grid;place-items:center;padding:clamp(1rem,5vw,4rem);background:radial-gradient(ellipse at 85% 15%,#e4eafa 0,transparent 52%),#f5f7fb}
.setup-shell>.card{width:min(100%,760px);margin:0;padding:clamp(1.4rem,4vw,2.8rem)}
.setup-brand{color:#253e79;font-size:.92rem;font-weight:800;letter-spacing:.12em}
.setup-shell h1{margin:.35rem 0 .75rem;font-size:clamp(1.6rem,4vw,2.15rem)}
