:root {
  --brand: #018cb5;
  --brand-dark: #006d8d;
  --brand-soft: #e7f7fb;
  --accent: #fff100;
  --coral: #ff5a60;
  --success: #138a63;
  --warning: #b87600;
  --danger: #c6404a;
  --ink: #132238;
  --ink-2: #415269;
  --muted: #728096;
  --line: #dce4ec;
  --line-soft: #edf1f5;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --sidebar: #10263b;
  --sidebar-2: #0b1d2e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 45px rgba(22, 45, 70, .08);
  --shadow-sm: 0 6px 22px rgba(22, 45, 70, .07);
  --sidebar-width: 264px;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-dark); text-decoration: none; }
img { max-width: 100%; }
.icon { width: 1.2em; height: 1.2em; display: inline-block; flex: 0 0 auto; vertical-align: -0.18em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 22px 16px 18px; color: #fff; background: linear-gradient(160deg, var(--sidebar) 0%, var(--sidebar-2) 100%); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 3px 8px 24px; color: #fff; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #10a8d2, #00769a); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 10px 25px rgba(0,0,0,.2); font-size: 20px; font-weight: 900; letter-spacing: -.04em; }
.brand-text { min-width: 0; }
.brand-name { display: block; font-size: 15px; font-weight: 800; letter-spacing: .08em; line-height: 1.25; }
.brand-company { display: block; margin-top: 4px; color: #9fb3c5; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.nav-section { margin: 8px 0 18px; }
.nav-heading { margin: 0 12px 7px; color: #6f879b; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; margin: 3px 0; border-radius: 12px; color: #c5d1dc; font-weight: 650; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link .icon { width: 19px; height: 19px; color: #8ca5b8; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-link.is-active { background: rgba(1,140,181,.25); color: #fff; box-shadow: inset 3px 0 0 #18b6df; }
.nav-link.is-active .icon { color: #54d5f6; }
.sidebar-footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-weight: 800; }
.sidebar-user-meta { min-width: 0; flex: 1; }
.sidebar-user-name { display: block; color: #fff; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { display: block; color: #7992a5; font-size: 10px; }
.logout-button { width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #91a8ba; cursor: pointer; }
.logout-button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid rgba(220,228,236,.8); background: rgba(244,247,250,.92); backdrop-filter: blur(16px); }
.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mobile-menu { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.quick-add { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; color: #fff; background: var(--brand); font-weight: 800; box-shadow: 0 7px 18px rgba(1,140,181,.22); }
.quick-add:hover { background: var(--brand-dark); color: #fff; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 30px 34px 60px; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid; border-radius: 13px; background: #fff; font-weight: 650; box-shadow: var(--shadow-sm); }
.flash-success { border-color: #bfe9d8; color: #0d7554; background: #f1fbf7; }
.flash-error { border-color: #f2c6ca; color: #a62e3a; background: #fff5f6; }
.flash-warning { border-color: #f2d8a5; color: #8b5d00; background: #fffaf0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h2 { margin: 0; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.25; letter-spacing: -.035em; }
.page-head p { max-width: 720px; margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--brand-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 0; }
.card-header h3 { margin: 0; font-size: 16px; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 20px 22px 22px; }
.card-divider { height: 1px; background: var(--line-soft); margin: 20px -22px; }

.hero-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 30px; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #0c314a 0%, #006f92 62%, #019fc8 100%); box-shadow: 0 24px 60px rgba(13,49,74,.2); }
.hero-panel::before, .hero-panel::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero-panel::before { width: 300px; height: 300px; right: -100px; top: -140px; }
.hero-panel::after { width: 180px; height: 180px; right: 180px; bottom: -120px; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy .eyebrow { color: #89e6fb; }
.hero-copy h2 { max-width: 620px; margin: 0; font-size: clamp(28px, 3vw, 43px); line-height: 1.2; letter-spacing: -.045em; }
.hero-copy p { max-width: 650px; margin: 13px 0 0; color: #c9e1ec; }
.hero-status { position: relative; z-index: 1; align-self: stretch; padding: 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.09); backdrop-filter: blur(10px); }
.hero-status-label { color: #a8d4e2; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.hero-status-value { display: block; margin: 7px 0 12px; font-size: 23px; font-weight: 900; }
.hero-status-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); color: #dbeef4; font-size: 12px; }

.quick-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.quick-card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; padding: 17px; border: 1px solid var(--line-soft); border-radius: 17px; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.quick-card:hover { transform: translateY(-3px); border-color: #b9dfe9; box-shadow: 0 14px 32px rgba(22,45,70,.11); }
.quick-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--brand-dark); background: var(--brand-soft); }
.quick-icon .icon { width: 22px; height: 22px; }
.quick-card:nth-child(2) .quick-icon { color: #bd3d47; background: #fff0f1; }
.quick-card:nth-child(3) .quick-icon { color: #177a55; background: #edf9f4; }
.quick-card:nth-child(4) .quick-icon { color: #8c6100; background: #fff8e6; }
.quick-card:nth-child(5) .quick-icon { color: #5c55a5; background: #f3f1ff; }
.quick-card:nth-child(6) .quick-icon { color: #5b6674; background: #f0f3f6; }
.quick-card strong { margin-top: 15px; font-size: 15px; }
.quick-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 21px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.kpi-value { margin-top: 13px; font-size: clamp(24px, 2.3vw, 32px); font-weight: 900; letter-spacing: -.035em; line-height: 1.1; }
.kpi-note { margin-top: 8px; color: var(--muted); font-size: 11px; }
.kpi.is-positive .kpi-value { color: var(--success); }
.kpi.is-alert .kpi-value { color: var(--danger); }

.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: 20px; }
.chart-wrap { height: 245px; display: flex; align-items: stretch; gap: 14px; padding-top: 10px; }
.chart-column { flex: 1; min-width: 40px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.chart-bars { width: 100%; max-width: 46px; height: 188px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.chart-bar { width: 15px; min-height: 4px; border-radius: 7px 7px 3px 3px; background: var(--brand); height: calc(var(--h) * 1%); transition: height .4s ease; }
.chart-bar.expense { background: #cbd5df; }
.chart-label { color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; align-items: center; gap: 18px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.legend-dot { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--brand); }
.legend-dot.gray { background: #cbd5df; }

.status-list { display: grid; gap: 11px; }
.status-item { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fbfcfd; }
.status-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--success); background: #eaf8f2; }
.status-item.warning .status-icon { color: var(--warning); background: #fff6df; }
.status-copy { min-width: 0; }
.status-copy strong { display: block; font-size: 13px; }
.status-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbfd; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: #fbfdfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-link { color: var(--ink); font-weight: 750; }
.table-link:hover { color: var(--brand-dark); }
.row-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 17px; color: var(--brand); background: var(--brand-soft); }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: #eef3f7; color: #516276; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-blue { color: #006f92; background: #e6f7fb; }
.badge-green { color: #0b7653; background: #eaf8f2; }
.badge-red { color: #ab3440; background: #fff0f1; }
.badge-yellow { color: #896000; background: #fff7df; }
.badge-purple { color: #6252a7; background: #f2efff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 800; cursor: pointer; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 7px 18px rgba(1,140,181,.18); }
.btn-primary:hover { color: #fff; background: var(--brand-dark); }
.btn-secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.btn-secondary:hover { border-color: #a9bac9; background: #f9fbfc; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { background: #a92f39; }
.btn-ghost { color: var(--brand-dark); border-color: transparent; background: var(--brand-soft); }
.btn-sm { min-height: 34px; padding: 0 11px; border-radius: 9px; font-size: 11px; }
.btn-block { width: 100%; }

.form-card { padding: 24px; }
.form-section + .form-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.section-number { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 900; }
.form-section-head h3 { margin: 0; font-size: 16px; }
.form-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 17px; }
.field { grid-column: span 6; min-width: 0; }
.field.span-3 { grid-column: span 3; }
.field.span-4 { grid-column: span 4; }
.field.span-8 { grid-column: span 8; }
.field.span-12 { grid-column: 1 / -1; }
.field label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: #29394d; font-size: 12px; font-weight: 800; }
.required { color: var(--coral); font-size: 10px; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd9e3; border-radius: 11px; outline: none; color: var(--ink); background: #fff; transition: border-color .16s, box-shadow .16s, background .16s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(1,140,181,.11); }
.input::placeholder, .textarea::placeholder { color: #9aa7b5; }
.amount-input-wrap { position: relative; }
.amount-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; font-weight: 800; }
.amount-input { padding-left: 36px; font-size: 23px; font-weight: 900; letter-spacing: .02em; text-align: right; }
.input-group { display: flex; }
.input-group .input, .input-group .select { border-radius: 0; }
.input-group > :first-child { border-radius: 11px 0 0 11px; }
.input-group > :last-child { border-radius: 0 11px 11px 0; }
.check-row { display: flex; align-items: flex-start; gap: 9px; }
.check-row input { margin-top: 5px; }
.check-row label { margin: 0; font-weight: 650; }

.entry-type-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.entry-type-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 86px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink-2); background: #fff; font-size: 12px; font-weight: 850; box-shadow: 0 4px 14px rgba(22,45,70,.04); }
.entry-type-tab .icon { width: 23px; height: 23px; color: var(--muted); }
.entry-type-tab:hover { border-color: #9fcfdd; color: var(--brand-dark); }
.entry-type-tab.is-active { color: #fff; border-color: var(--brand); background: linear-gradient(135deg, var(--brand-dark), var(--brand)); box-shadow: 0 10px 25px rgba(1,140,181,.2); }
.entry-type-tab.is-active .icon { color: #fff; }

.upload-zone { position: relative; padding: 24px; border: 1.5px dashed #a8c7d2; border-radius: 15px; background: #f7fcfd; text-align: center; transition: border-color .18s, background .18s; }
.upload-zone.is-dragging { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-zone-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 14px; color: var(--brand); background: #fff; box-shadow: var(--shadow-sm); }
.upload-zone strong { display: block; }
.upload-zone span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.file-list { display: grid; gap: 7px; margin-top: 10px; text-align: left; }
.file-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); background: #fff; font-size: 10px; }

.info-box { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid #bce3ed; border-radius: 13px; color: #23556a; background: #f0fbfd; font-size: 12px; }
.info-box.warning { border-color: #efd6a0; color: #795100; background: #fffaf0; }
.info-box.danger { border-color: #efc4c8; color: #8f2a35; background: #fff5f6; }
.info-box .icon { margin-top: 2px; flex: 0 0 auto; }

.filter-card { padding: 17px; margin-bottom: 17px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 11px; align-items: end; }
.filter-grid .field { grid-column: auto; }
.filter-grid .field label { font-size: 10px; }
.filter-grid .input, .filter-grid .select { min-height: 40px; padding: 8px 10px; font-size: 12px; }
.filter-actions { display: flex; gap: 7px; }

.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; padding: 24px; }
.detail-no { color: var(--brand-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.detail-title { margin: 6px 0 5px; font-size: clamp(23px, 2.5vw, 34px); letter-spacing: -.035em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 11px; }
.detail-amount { min-width: 190px; padding: 16px 20px; border-radius: 15px; text-align: right; background: #f4fafc; }
.detail-amount span { display: block; color: var(--muted); font-size: 10px; }
.detail-amount strong { display: block; margin-top: 4px; font-size: 28px; letter-spacing: -.03em; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 20px; }
.definition-list { display: grid; grid-template-columns: 130px 1fr; gap: 0; margin: 0; }
.definition-list dt, .definition-list dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.definition-list dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.definition-list dd { font-weight: 650; overflow-wrap: anywhere; }
.hash { display: block; max-width: 100%; padding: 9px; border-radius: 9px; color: #58697c; background: #f3f6f8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }

.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 17px; }
.report-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.report-stat { padding: 18px; border: 1px solid var(--line-soft); border-radius: 15px; background: #fbfcfd; }
.report-stat span { color: var(--muted); font-size: 10px; font-weight: 700; }
.report-stat strong { display: block; margin-top: 5px; font-size: 24px; }
.report-stat.profit strong { color: var(--success); }
.report-section + .report-section { margin-top: 22px; }
.report-section h3 { margin: 0 0 12px; font-size: 17px; }
.report-total td { border-top: 2px solid var(--ink); font-weight: 900; }

.audit-timeline { display: grid; gap: 12px; }
.audit-item { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 13px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; }
.audit-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.audit-main strong { display: block; font-size: 13px; }
.audit-main p { margin: 3px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.audit-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.integrity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.integrity-card { padding: 17px; border: 1px solid var(--line-soft); border-radius: 14px; }
.integrity-card.ok { border-color: #bde6d5; background: #f3fbf8; }
.integrity-card.ng { border-color: #efc3c8; background: #fff5f6; }
.integrity-card strong { display: block; margin-bottom: 4px; }

.settings-nav { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.setting-section + .setting-section { margin-top: 20px; }

.auth-body { min-height: 100vh; background: #f2f6f8; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .85fr) minmax(500px, 1.15fr); }
.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 46px; color: #fff; background: linear-gradient(145deg, #0b2134, #006c8d 65%, #00a0ca); }
.auth-visual::before { content: ""; position: absolute; width: 560px; height: 560px; right: -280px; top: -210px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 54px; height: 54px; }
.auth-brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.auth-brand span { display: block; color: #b9d5e1; font-size: 11px; }
.auth-message { position: relative; z-index: 1; max-width: 550px; }
.auth-message h1 { margin: 0; font-size: clamp(34px, 4.2vw, 60px); line-height: 1.1; letter-spacing: -.055em; }
.auth-message p { margin: 19px 0 0; color: #c8e2ec; font-size: 14px; }
.auth-features { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.auth-feature { padding: 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.07); font-size: 10px; }
.auth-feature .icon { display: block; width: 20px; height: 20px; margin-bottom: 7px; color: #66def8; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: min(520px, 100%); padding: 34px; border: 1px solid var(--line-soft); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.auth-card > p { margin: 8px 0 24px; color: var(--muted); }
.health-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0 22px; }
.health-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: #3c5368; background: #f4f7f9; font-size: 10px; font-weight: 700; }
.health-item.ok .icon { color: var(--success); }
.health-item.ng .icon { color: var(--danger); }

.manual-table input, .manual-table select { width: 100%; min-height: 38px; padding: 7px 8px; border: 1px solid #d5dee6; border-radius: 8px; }
.manual-table .amount-cell { min-width: 135px; }
.manual-table .account-cell { min-width: 210px; }
.manual-total { display: flex; justify-content: flex-end; gap: 25px; padding: 14px; border-top: 1px solid var(--line); font-weight: 850; }

.mobile-bottom-nav { display: none; }
.sidebar-overlay { display: none; }
.print-only { display: none; }

@media (max-width: 1180px) {
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  body { padding-bottom: 72px; }
  .sidebar { width: 280px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 25px 0 70px rgba(0,0,0,.25); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 45; inset: 0; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(5,18,29,.52); transition: opacity .22s, visibility .22s; }
  body.sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .main { margin-left: 0; }
  .topbar { height: 66px; padding: 0 18px; }
  .mobile-menu { display: grid; place-items: center; }
  .topbar-title { flex: 1; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .quick-add { width: 42px; padding: 0; }
  .quick-add span { display: none; }
  .content { padding: 21px 18px 36px; }
  .hero-panel { grid-template-columns: 1fr; padding: 24px; }
  .hero-status { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .hero-status-label, .hero-status-value { grid-column: 1 / -1; }
  .dashboard-lower, .detail-grid { grid-template-columns: 1fr; }
  .mobile-bottom-nav { position: fixed; z-index: 40; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding: 5px 6px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(16px); box-shadow: 0 -8px 26px rgba(22,45,70,.08); }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #7b8999; font-size: 9px; font-weight: 800; }
  .mobile-nav-link .icon { width: 20px; height: 20px; }
  .mobile-nav-link.is-active { color: var(--brand-dark); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-main { padding: 24px; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .content { padding: 17px 12px 32px; }
  .topbar { padding: 0 12px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
  .page-head h2 { font-size: 25px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .hero-panel { padding: 21px 18px; border-radius: 19px; }
  .hero-copy h2 { font-size: 29px; }
  .hero-status { grid-template-columns: 1fr; }
  .hero-status-label, .hero-status-value { grid-column: auto; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .quick-card { min-height: 112px; padding: 14px; }
  .quick-icon { width: 36px; height: 36px; }
  .kpi-grid, .grid-2, .grid-3, .grid-4, .integrity-grid, .report-summary { grid-template-columns: 1fr; }
  .kpi { padding: 18px; }
  .dashboard-lower { gap: 14px; }
  .card-header { padding: 17px 17px 0; }
  .card-body { padding: 16px 17px 18px; }
  .card-pad, .form-card { padding: 17px; }
  .card-divider { margin-left: -17px; margin-right: -17px; }
  .entry-type-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .entry-type-tab { min-height: 70px; padding: 8px 5px; font-size: 10px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .field, .field.span-3, .field.span-4, .field.span-8, .field.span-12 { grid-column: 1; }
  .amount-input { font-size: 21px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid .field.wide-mobile { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .btn { flex: 1; }
  .detail-hero { grid-template-columns: 1fr; padding: 18px; }
  .detail-amount { min-width: 0; text-align: left; }
  .definition-list { grid-template-columns: 105px 1fr; }
  .audit-item { grid-template-columns: 36px 1fr; }
  .audit-time { grid-column: 2; }
  .chart-wrap { gap: 7px; }
  .chart-bars { max-width: 36px; }
  .chart-bar { width: 11px; }
  .auth-main { padding: 14px; }
  .auth-card { padding: 23px 18px; border-radius: 19px; }
  .health-list { grid-template-columns: 1fr; }
  .sticky-submit { position: sticky; z-index: 15; bottom: 76px; display: flex; gap: 8px; margin: 22px -5px 0; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); box-shadow: 0 10px 28px rgba(22,45,70,.14); }
  .sticky-submit .btn { flex: 1; }
}

@media print {
  body { padding: 0; background: #fff; font-size: 10pt; }
  .sidebar, .topbar, .mobile-bottom-nav, .page-actions, .filter-card, .flash-stack, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { width: 100%; padding: 0; }
  .card { border: 0; box-shadow: none; }
  .print-only { display: block; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
}
