:root {
  --primary: #1f6f5b;
  --primary-dark: #185646;
  --primary-light: #eaf6f1;
  --accent: #f0a33a;
  --danger: #c94848;
  --warning: #f8e7b1;
  --success: #dff3e9;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --line: #dbe4e1;
  --text: #21312d;
  --muted: #687b75;
  --shadow: 0 8px 24px rgba(21, 67, 55, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: linear-gradient(135deg, #eaf6f1 0%, #f7faf8 55%, #edf3f1 100%);
}
.login-hero {
  padding: 68px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-hero .badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow);
  font-weight: 700;
  margin-bottom: 24px;
}
.login-hero h1 {
  font-size: 42px;
  margin: 0 0 18px;
  letter-spacing: .04em;
}
.login-hero p { font-size: 17px; color: var(--muted); max-width: 700px; }
.login-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 40px;
}
.flow-chip {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30,60,50,.05);
}
.login-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}
.login-card {
  width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 8px; font-size: 24px; }
.login-card .caption { color: var(--muted); margin-bottom: 26px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: #e7efec; color: var(--primary-dark); }
.btn.warn { background: var(--accent); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn.full { width: 100%; height: 46px; margin-top: 8px; }
.detail-link {
  border: 1px solid #b9d7cc;
  border-radius: 999px;
  background: #f3faf7;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  margin-left: 5px;
  cursor: pointer;
  vertical-align: middle;
}
.detail-link:hover { background: var(--primary-light); border-color: #8fc7b3; }
.login-note {
  margin-top: 18px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 12px;
  color: var(--primary-dark);
  font-size: 13px;
}
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; transition: grid-template-columns .18s ease; }
.sidebar {
  background: #183f35;
  color: #ecf5f2;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 250px;
  transition: width .18s ease;
  z-index: 20;
}
.app-shell.sidebar-collapsed { grid-template-columns: 78px 1fr; }
.app-shell.sidebar-collapsed .sidebar { width: 78px; }
.sidebar-toggle {
  position: absolute;
  top: 22px;
  right: -14px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(20,60,50,.18);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}
.sidebar-toggle span::before {
  content: "‹";
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}
.app-shell.sidebar-collapsed .sidebar-toggle span::before { content: "›"; }
.brand {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.logo-mark { display: none; }
.brand-title { font-size: 16px; font-weight: 800; }
.brand-sub { font-size: 12px; color: #b9cbc6; }
.nav { padding: 16px 12px; overflow: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #d8e8e3;
  margin-bottom: 4px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav .section-label {
  color: #a8beb8;
  font-size: 12px;
  margin: 18px 12px 8px;
}
.nav-icon { width: 22px; text-align: center; }
.app-shell.sidebar-collapsed .brand { display: none; }
.app-shell.sidebar-collapsed .nav .section-label {
  display: none;
}
.app-shell.sidebar-collapsed .nav { padding: 54px 10px 16px; }
.app-shell.sidebar-collapsed .nav a {
  justify-content: center;
  gap: 0;
  padding: 11px 0;
  font-size: 0;
}
.app-shell.sidebar-collapsed .nav-icon {
  width: auto;
  font-size: 18px;
}
.main {
  grid-column: 2;
  min-width: 0;
  padding: 0 0 40px;
}
.topbar {
  height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.breadcrumb { color: var(--muted); font-size: 13px; }
.user-mini { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.content { padding: 26px 28px; }
.page-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.page-title h1 { margin: 0 0 6px; font-size: 26px; }
.page-title p { margin: 0; color: var(--muted); }
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.select, .input {
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 0 10px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(21, 67, 55, .04);
  padding: 18px;
}
.card h2, .card h3 { margin: 0 0 12px; }
.metric { display: flex; justify-content: space-between; align-items: flex-start; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 27px; font-weight: 900; margin-top: 4px; }
.metric .tag { border-radius: 999px; padding: 4px 9px; font-size: 12px; background: var(--primary-light); color: var(--primary); font-weight: 700; }
.metric.warn .tag { background: var(--warning); color: #8a5b00; }
.metric.danger .tag { background: #fde8e8; color: var(--danger); }
.process-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.process-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  background: #fff;
  min-height: 86px;
}
.process-step .num { width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-weight: 900; display: grid; place-items: center; }
.process-step.active { border-color: #91c9b5; background: var(--success); }
.process-link {
  position: relative;
  border-color: #7db8a4;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(31,111,91,.12);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.process-link::after {
  content: "›";
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}
.process-link:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.process-link .open-cue {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.menu-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 18px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: .15s;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #a4cfbf; }
.menu-card .title { font-weight: 900; font-size: 16px; }
.menu-card .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.menu-card .arrow { color: var(--primary); font-weight: 900; margin-top: 10px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #eef5f2; color: #28463d; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
.budget-monthly-table { min-width: 1280px; }
.budget-monthly-table th,
.budget-monthly-table td {
  padding: 8px 9px;
}
.budget-monthly-table th.number,
.budget-monthly-table td.number {
  min-width: 72px;
}
.budget-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}
.budget-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.budget-input-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.number-input { text-align: right; font-variant-numeric: tabular-nums; }
.monthly-editor-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef5f2;
}
.monthly-editor-table {
  min-width: 1160px;
  table-layout: fixed;
}
.monthly-editor-table th,
.monthly-editor-table td {
  padding: 7px;
  text-align: right;
}
.monthly-editor-table input {
  width: 100%;
  height: 34px;
  border: 1px solid #c9d8d3;
  border-radius: 7px;
  padding: 0 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.monthly-editor-table input:focus {
  outline: 2px solid #9dc8ba;
  border-color: var(--primary);
}
.monthly-editor-table .total-cell {
  background: #e6efe9;
  font-weight: 900;
}
.budget-entry-side {
  display: grid;
  gap: 10px;
}
.entry-check {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.entry-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.entry-check strong { font-size: 14px; }
.entry-check.ok { background: #eefaf5; border-color: #a8d8c6; }
.entry-check.warn { background: #fff8e5; border-color: #e9c46a; }
.department-table-wrap { max-width: 100%; }
.department-summary-table {
  min-width: 2800px;
  table-layout: fixed;
}
.department-summary-table th,
.department-summary-table td {
  min-width: 96px;
}
.department-summary-table thead tr:first-child th:not(.sticky-col) {
  border-left: 3px solid #536b63;
}
.department-summary-table thead tr:nth-child(2) th:nth-child(5n+1),
.department-summary-table tbody td:nth-child(5n+2) {
  border-left: 3px solid #536b63;
}
.department-summary-table thead tr:first-child th:last-child,
.department-summary-table thead tr:nth-child(2) th:nth-child(5n),
.department-summary-table tbody td:nth-child(5n+1) {
  border-right: 2px solid #8ca09a;
}
.department-summary-table .dept-account {
  min-width: 190px;
  width: 190px;
}
.department-summary-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.department-summary-table th.sticky-col {
  background: #dfe9e5;
  z-index: 4;
}
.department-summary-table .sheet-section .sticky-col {
  background: #c8dcd4;
}
.department-summary-table .sheet-total .sticky-col {
  background: #e6efe9;
}
.department-summary-table .cell-good { background: #eefaf5; }
.department-summary-table .cell-warn { background: #fff8e5; }
.department-summary-table .cell-danger { background: #fff0f0; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.status.ok { background: var(--success); color: #1f6f5b; }
.status.err { background: #fde8e8; color: var(--danger); }
.status.wait { background: #eef1f0; color: #5c6c67; }
.status.warn { background: var(--warning); color: #8a5b00; }
.drop-zone {
  border: 2px dashed #9dc8ba;
  background: #f8fcfa;
  border-radius: 16px;
  min-height: 170px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.drop-zone strong { color: var(--primary); font-size: 16px; }
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.alert.info { background: var(--primary-light); border-color: #c5e4d8; color: var(--primary-dark); }
.alert.warn { background: #fff8e5; border-color: #f2d99a; color: #8a5b00; }
.alert.danger { background: #fff0f0; border-color: #f4caca; color: var(--danger); }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-btn {
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.master-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.form-box { background: #f8fbfa; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.report-card { padding: 16px; }
.report-scroll {
  overflow: auto;
  border: 1px solid #d5dfdc;
  border-radius: 10px;
  background: #eef3f1;
  padding: 14px;
}
.report-paper {
  border: 1px solid #cad8d4;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}
.report-paper.excel-like {
  min-width: 980px;
  max-width: 1180px;
  margin: 0 auto;
  border-radius: 6px;
  border-color: #aebfba;
  padding: 22px 24px 28px;
  box-shadow: 0 2px 8px rgba(35, 64, 56, .08);
}
.report-paper.excel-like.wide-report {
  width: 1440px;
  max-width: none;
}
.report-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #40534d;
  font-size: 12px;
  margin-bottom: 8px;
}
.report-title {
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  margin: 4px 0 16px;
  letter-spacing: 0;
}
.report-note { color: var(--muted); font-size: 12px; }
.sheet-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #536b63;
  background: #fff;
  font-size: 13px;
}
.sheet-table.bs-table,
.sheet-table.pl-table {
  min-width: 1080px;
  font-size: 12px;
}
.sheet-table.compact { min-width: 760px; }
.sheet-table.comparison-table {
  min-width: 1380px;
  font-size: 12px;
}
.sheet-table.comparison-table th:nth-child(10),
.sheet-table.comparison-table td:nth-child(10) {
  min-width: 190px;
  max-width: 190px;
}
.sheet-table.comparison-table th,
.sheet-table.comparison-table td {
  padding: 5px 7px;
  height: 28px;
}
.sheet-table .w-code { width: 108px; }
.sheet-table .w-name { width: 210px; }
.sheet-table .w-month { width: 132px; }
.sheet-table .w-note { width: 170px; }
.sheet-table th,
.sheet-table td {
  border: 1px solid #71857e;
  padding: 7px 9px;
  height: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-table.bs-table th,
.sheet-table.bs-table td,
.sheet-table.pl-table th,
.sheet-table.pl-table td {
  padding: 4px 6px;
  height: 24px;
}
.sheet-table .bs-gap {
  width: 22px;
  min-width: 22px;
  padding: 0;
  border-top: 0;
  border-bottom: 0;
  background: #fff;
}
.sheet-table th.bs-gap,
.sheet-table td.bs-gap {
  border-left: 2px solid #111;
  border-right: 2px solid #111;
}
.sheet-table th {
  background: #dfe9e5;
  color: #20342e;
  text-align: center;
  font-weight: 800;
}
.sheet-table tr:last-child td { border-bottom: 1px solid #71857e; }
.sheet-table td.number,
.sheet-table th.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}
.sheet-section td {
  background: #c8dcd4;
  color: #17392f;
  font-weight: 900;
  text-align: left;
}
.sheet-subtotal td {
  background: #f4f8f6;
  font-weight: 800;
}
.sheet-total td {
  background: #e6efe9;
  border-top: 2px solid #536b63;
  font-weight: 900;
}
.summary-side { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(220px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}
.filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.filter-grid .select,
.filter-grid .input { width: 100%; }
.filter-wide { min-width: 220px; }
.filter-actions { display: flex; align-items: end; }
.condition-summary { min-width: 0; }
.condition-list { display: grid; gap: 10px; }
.condition-list div {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
}
.condition-list span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.condition-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}
.kv-list { display: grid; gap: 8px; }
.kv { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv .k { color: var(--muted); }
.amount-plus { color: #12623d; font-weight: 900; }
.amount-minus { color: #b33232; font-weight: 900; }
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-plan { background: #d5e3df; border: 1px solid #9bbdb2; }
.legend-exec { background: #f4c56e; }
.legend-actual { background: #1f6f5b; }
.legend-danger { background: #bf4f47; }
.compare-chart { display: grid; gap: 12px; }
.chart-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
}
.chart-label { font-weight: 800; color: #40534d; }
.chart-bars { display: grid; gap: 6px; }
.bar-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
}
.bar-line > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.bar {
  min-width: 84px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  background: var(--primary);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12);
}
.bar.plan { background: #d5e3df; color: #17392f; border: 1px solid #9bbdb2; box-shadow: none; }
.bar.exec { background: #f4c56e; color: #553b00; }
.bar.actual { background: #1f6f5b; }
.bar.net { background: #1f6f5b; }
.bar.net.plan { background: #d5e3df; color: #17392f; border-color: #9bbdb2; }
.bar.warn-bar { background: #f4c56e; color: #553b00; }
.variance-list { display: grid; gap: 12px; }
.variance-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, .8fr) 78px;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.variance-item:last-child { border-bottom: 0; padding-bottom: 0; }
.variance-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.variance-meter {
  height: 9px;
  border-radius: 999px;
  background: #f4dddd;
  overflow: hidden;
}
.variance-meter span {
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
}
.variance-meter.plus { background: #dff3e9; }
.variance-meter.plus span { background: var(--primary); }
.section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.monthly-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}
.monthly-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.monthly-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.monthly-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 190px;
  padding: 14px 8px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(to top, #eef5f2 1px, transparent 1px) 0 0 / 100% 25%;
}
.month-bar {
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.month-bar span {
  width: 100%;
  max-width: 34px;
  min-height: 18px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #4b8f78, var(--primary-dark));
}
.month-bar.forecast span {
  background: linear-gradient(180deg, #f0bd6f, var(--accent));
}
.monthly-chart.variance {
  gap: 8px;
  min-height: 240px;
  padding-top: 18px;
}
.monthly-chart.variance .month-bar {
  height: 206px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  position: relative;
}
.monthly-chart.variance .month-bar em {
  min-height: 22px;
  margin-bottom: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  background: #eef6f2;
  color: #1b6b4f;
}
.monthly-chart.variance .month-bar strong {
  margin-top: 7px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.monthly-chart.variance .month-bar b {
  margin-top: 4px;
}
.monthly-chart.variance .month-bar.watch,
.monthly-chart.variance .month-bar.warn,
.monthly-chart.variance .month-bar.alert {
  background: #fffaf2;
  border-color: #efd8ad;
}
.monthly-chart.variance .month-bar.watch em,
.monthly-chart.variance .month-bar.warn em {
  background: #fff0ce;
  color: #8b5c00;
}
.monthly-chart.variance .month-bar.alert {
  background: #fff6f5;
  border-color: #e7b7b2;
}
.monthly-chart.variance .month-bar.alert em {
  background: #f7d9d6;
  color: #a23730;
  font-weight: 900;
}
.monthly-chart.variance .month-bar.alert span {
  background: linear-gradient(180deg, #d56d64, #a93c35);
}
.monthly-legend {
  margin: 14px 0 0;
}
.month-lock-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(66px, 1fr));
  gap: 8px;
}
.month-lock {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.month-lock strong { font-size: 15px; }
.month-lock span { color: var(--muted); font-size: 12px; font-weight: 800; }
.month-lock.done { background: #eefaf5; border-color: #a8d8c6; }
.month-lock.done span { color: #1f6f5b; }
.month-lock.current { background: #fff8e5; border-color: #e9c46a; }
.month-lock.current span { color: #8a5b00; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.38);
  display: none; place-items: center; z-index: 50;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: 560px; max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal.wide-modal { width: 760px; }
.modal h2 { margin: 0 0 8px; }
.modal-title-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.modal-caption { margin: 0 0 14px; color: var(--muted); }
.notice-list { display: grid; gap: 8px; }
.notice-item { display: flex; gap: 10px; align-items: center; padding: 10px; background: #f8fbfa; border-radius: 10px; }
.notice-date { color: var(--muted); width: 90px; font-size: 13px; }
.badge-small { padding: 3px 7px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-weight: 800; font-size: 12px; }
.action-list { display: grid; gap: 10px; }
.action-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, auto) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.action-row span { color: var(--muted); font-size: 12px; display: block; margin-top: 3px; }
.drill-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfa;
}
.drill-card strong { font-size: 16px; }
.timeline { display: grid; gap: 10px; }
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline-item:last-child { border-bottom: 0; }
.fixed-table th { position: sticky; top: 0; z-index: 3; }
.column-toggle { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.column-toggle label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}
.risk-panel {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf2;
}
.risk-panel.danger { background: #fff6f5; border-color: #e7b7b2; }
footer.sample-footer { color: var(--muted); font-size: 12px; padding: 10px 28px 0; }
.carry-flow { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid.cols-4, .menu-grid, .process-flow, .carry-flow { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-side, .details-layout, .master-layout, .login-page { grid-template-columns: 1fr; }
  .budget-entry-layout { grid-template-columns: 1fr; }
  .budget-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-wide { min-width: 0; }
  .filter-actions { align-items: stretch; }
  .filter-actions .btn { width: 100%; }
  .sidebar { position: static; width: auto; }
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed .sidebar { width: auto; }
  .app-shell.sidebar-collapsed .brand { display: flex; }
  .app-shell.sidebar-collapsed .nav .section-label { display: block; }
  .app-shell.sidebar-collapsed .nav { padding: 16px 12px; }
  .app-shell.sidebar-collapsed .nav a {
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
    font-size: 14px;
  }
  .sidebar-toggle { display: none; }
  .main { grid-column: 1; }
}
@media (max-width: 760px) {
  .grid.cols-3,
  .grid.cols-4,
  .menu-grid,
  .process-flow,
  .carry-flow,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .content { padding: 20px 16px; }
  .page-title-row { flex-direction: column; }
  .filter-grid { grid-template-columns: 1fr; }
  .budget-input-grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; gap: 6px; }
  .variance-item { grid-template-columns: 1fr; gap: 6px; }
  .action-row, .timeline-item, .risk-panel { grid-template-columns: 1fr; }
  .monthly-summary { grid-template-columns: 1fr; }
  .month-lock-grid { grid-template-columns: repeat(4, minmax(66px, 1fr)); }
  .monthly-chart { grid-template-columns: repeat(6, minmax(36px, 1fr)); overflow: auto; }
}
