@import url("/offering/static/css/layout.css");

/* =========================================
   Header 회계기수
========================================= */

.header-fiscal{
  color:rgba(255,255,255,.92);
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}

/* HOME PAGE ONLY: common.css main 폭 영향 제거 */
.main:has(.home-wrap) {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  padding: 18px 0 70px !important;
  overflow-x:auto
}

.home-wrap {
  width: 100%;
  max-width: 100%;
  margin: 24px auto 100px;
  padding: 0;
  position: relative;
}
/* --------------------------------------------------------------------- */

:root {
  --shell-width: 1440px;
  --content-width: 1440px;

  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;

  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-card: 0 14px 36px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =========================================================
   HEADER / NAV : fixed 제거, 정상 flow
   header shell = 1440px
   ========================================================= */

.header {
  position: static !important;
  width: 100%;
  min-height: 64px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
  z-index: auto !important;
}

.header-inner {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  min-height: 64px;
  margin: 0 auto !important;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -.03em;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.live-clock,
.logout {
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 700;
}

.logout {
  text-decoration: none;
}

.logout:hover {
  color: #fff;
}

/* NAV */

.nav {
  position: static !important;
  width: 100%;
  min-height: 54px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  z-index: auto !important;
}

.nav-inner {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  min-height: 54px;
  margin: 0 auto !important;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a,
.nav-link,
.nav-title {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
}

.nav a:hover,
.nav-title:hover {
  background: #eef2ff;
  color: var(--blue);
}

.nav a.active,
.nav-dropdown a.active {
  background: #2563eb;
  color: #fff;
}

.nav-group {
  position: relative;
  flex: 0 0 auto;
  min-height: 54px;
  display: flex;
  align-items: center;
}

.nav-title {
  cursor: pointer;
}

.nav-group::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 230px;
  height: 18px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, .12);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 30;
}

.nav-group:hover .nav-dropdown,
.nav-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown a {
  display: block;
  height: auto;
  padding: 10px 14px;
  border-radius: 0;
}

/* =========================================================
   MAIN / CONTENT : 본문 1440px
   ========================================================= */

.main {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 18px 0 70px !important;
}

.breadcrumb,
.breadcrumb-wrap,
.page-breadcrumb {
  display: block !important;
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin: 0 auto 12px !important;
  padding: 12px 0 10px !important;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid #cbd5e1 !important;
  background: transparent !important;
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/* =========================================================
   BREADCRUMB : 공통화
   ========================================================= */

.breadcrumb,
.breadcrumb-wrap,
.page-breadcrumb {
  display: block !important;
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin: 0 auto 12px !important;
  padding: 12px 0 10px !important;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid #cbd5e1 !important;
  background: transparent !important;
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

.breadcrumb-inner {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

.breadcrumb a,
.breadcrumb span,
.page-breadcrumb a,
.page-breadcrumb span {
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.breadcrumb a,
.page-breadcrumb a {
  color: #2563eb;
}

.breadcrumb .current {
  color: #111827;
  font-weight: 800;
}

/* breadcrumb 바로 다음 main이면 중복 여백 제거 */
.breadcrumb + .main,
.page-breadcrumb + .main,
.breadcrumb-wrap + .main {
  padding-top: 0 !important;
}

/* =========================================================
   HERO : 모든 페이지 공통 상단 정렬
   ========================================================= */

.home-hero,
.today-hero,
.offering-hero,
.expense-hero,
.report-hero,
.page-hero {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
  position: relative !important;
  top: auto !important;
  transform: none !important;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* 첫 hero가 위로 끼는 것 방지 */
.main-inner > .home-wrap:first-child,
.main-inner > .page-wrap:first-child,
.main-inner > .today-wrap:first-child,
.main-inner > .offering-wrap:first-child,
.main-inner > .expense-page-wrap:first-child,
.main-inner > .report-wrap:first-child {
  padding-top: 0 !important;
}

/* =========================================================
   COMMON UI
   ========================================================= */

.card,
.dashboard-card,
.input-card,
.expense-entry-card,
.expense-summary-card,
.report-card,
.table-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-sub {
  background: #f9fafb;
  color: var(--ink);
  border: 1px solid #d1d5db;
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  color: #111827;
}

.input,
.select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #cfd6e1;
  border-radius: 12px;
  background: #fff;
  font-size: 17px;
}

.input:focus,
.select:focus {
  outline: 4px solid #dbeafe;
  border-color: #2563eb;
}

.help {
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
}

.ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  padding: 13px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.expense-local-head {
  max-width: var(--content-width);
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.expense-local-head .crumb {
  font-size: 13px;
  color: #64748b;
}

.expense-local-head .crumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.expense-card-grid a.expense-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.expense-main-grid,
.dashboard-grid,
.quick-grid,
.report-grid,
.stats-grid {
  gap: 24px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {
  .header-inner,
  .nav-inner {
    width: calc(100% - 20px) !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand {
    font-size: 17px;
  }

  .header-right {
    gap: 10px;
    font-size: 12px;
  }

  .nav-inner {
    gap: 10px;
    overflow-x: auto;
  }

  .main {
    width: calc(100% - 20px) !important;
    padding-top: 14px !important;
    padding-bottom: 50px !important;
  }

  .breadcrumb,
  .breadcrumb-wrap,
  .page-breadcrumb {
    width: calc(100% - 20px) !important;
    padding-top: 10px !important;
    margin-bottom: 10px !important;
  }

  .home-hero,
  .today-hero,
  .offering-hero,
  .expense-hero,
  .report-hero,
  .page-hero {
    margin-bottom: 18px !important;
  }
}

/* =========================================================
   GLOBAL STICKY HEADER / NAV / BREADCRUMB
========================================================= */

.header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}

.nav {
  position: sticky !important;
  top: 72px !important;
  z-index: 999 !important;
}

.breadcrumb {
  position: sticky !important;
  top: 126px !important;
  z-index: 998 !important;
  background: #f3f6fb !important;
}

/* breadcrumb 1440px 좌측 기준 정렬 */
.breadcrumb,
.breadcrumb-wrap,
.page-breadcrumb {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.breadcrumb-inner {
  width: 100% !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* =====================================================
   HERO 우측 액션 버튼
   ===================================================== */

.offering-hero,
.expense-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
}

.hero-left{
  display:flex;
  align-items:center;
  gap:20px;
}

/* 우측 버튼영역 */
.hero-actions{
  display:flex;
  gap:12px;
  flex-shrink:0;
}

/* 버튼 */
.hero-action-btn{
  height:42px;

  padding:0 18px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:12px;

  background:rgba(255,255,255,.18);

  border:1px solid rgba(255,255,255,.28);

  color:#fff;

  font-size:14px;
  font-weight:700;

  text-decoration:none;

  transition:.18s ease;
}

/* hover */
.hero-action-btn:hover{
  background:rgba(255,255,255,.28);
}

/* 보조버튼 */
.hero-action-btn.secondary{
  background:rgba(15,23,42,.28);
}



/* 항목별 명세서 toolbar 클릭 방해 방지 */
body.page-item-statement .nav,
body.page-item-statement .nav-inner{
  z-index:50 !important;
}

body.page-item-statement .dropdown,
body.page-item-statement .dropdown-menu,
body.page-item-statement .submenu{
  z-index:60 !important;
}

body.page-item-statement .is-toolbar{
  position:relative !important;
  z-index:500 !important;
}

body.page-item-statement .is-toolbar a,
body.page-item-statement .is-toolbar button,
body.page-item-statement .is-toolbar input,
body.page-item-statement .is-toolbar select{
  pointer-events:auto !important;
}

@media print {
  .erp-work-tabs,
  .erp-sub-tabs {
    display: none !important;
  }
}

/* ERP 탭 화면에서는 breadcrumb 숨김 */
.erp-work-tabs ~ .breadcrumb,
.breadcrumb:has(+ .erp-work-tabs) {
  display: none !important;
}

/* base.html 또는 render_page에서 나오는 breadcrumb 강제 숨김 */
body:has(.erp-work-tabs) .breadcrumb,
body:has(.erp-work-tabs) .breadcrumb-wrap,
body:has(.erp-work-tabs) .page-breadcrumb {
  display: none !important;
}

/* ERP 탭 하단 밑줄 제거 */
.erp-work-tabs {
  border-bottom: none !important;
}

.erp-sub-tabs {
  border-bottom: none !important;
}

/* =========================================================
   FINAL LAYOUT OVERRIDE
   - breadcrumb 완전 제거
   - header/nav/main/toolbar/tabs 1440px 통일
   - 중복 CSS보다 항상 마지막에서 우선 적용
========================================================= */

/* breadcrumb 완전 제거 */
.breadcrumb,
.breadcrumb-wrap,
.breadcrumb-bar,
.erp-breadcrumb,
.report-breadcrumb,
nav.breadcrumb,
.breadcrumb-container {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* 전체 기준 폭 */
:root {
  --app-width: 1440px;
  --content-width: 1440px;
}

/* header/nav/main 공통 폭 */
.header-inner,
.nav-inner,
.main,
.main-inner,
.content,
.content-inner,
.page-wrap,
.report-wrap,
.settlement-wrap,
.is-report-wrap,
.is-report-shell,
.erp-page,
.erp-toolbar,
.erp-work-tabs,
.erp-sub-tabs {
  width: min(var(--app-width), calc(100% - 40px)) !important;
  max-width: var(--app-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* main 상단 여백 최소화 */
.main {
  padding-top: 22px !important;
}

/* ERP 공통툴바 */
.erp-toolbar {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 10px 18px 6px !important;
  border: 1px solid #d5deea !important;
  border-top: 0 !important;
  border-radius: 0 0 18px 18px !important;
  background: #fff !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08) !important;
}

/* ERP 하위탭 */
.erp-sub-tabs {
  display: flex !important;
  gap: 4px !important;
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

.erp-sub-tabs a,
.erp-sub-tabs button,
.erp-sub-tabs .sub-tab {
  min-width: 72px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #b8c4d6 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.erp-sub-tabs a.active,
.erp-sub-tabs button.active,
.erp-sub-tabs .sub-tab.active {
  background: #fff !important;
  color: #0f4be8 !important;
  border-top: 3px solid #2563eb !important;
}

/* 본회계결산서 출력 카드도 1440px 기준 */
.is-report-paper,
.settlement-paper,
.report-paper {
  width: 100% !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* =========================================================
   FINAL SETTLEMENT WIDTH FIX
   - 수입/지출/종합 결산서 본문 폭 통일
========================================================= */

.settlement-page,
.settlement-shell,
.settlement-wrap,
.income-settlement-page,
.expense-settlement-page,
.total-settlement-page,
.income-report-page,
.expense-report-page,
.is-report-shell,
.is-report-wrap {
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.settlement-page .is-report-paper,
.settlement-shell .is-report-paper,
.settlement-wrap .is-report-paper,
.income-settlement-page .is-report-paper,
.expense-settlement-page .is-report-paper,
.total-settlement-page .is-report-paper,
.income-report-page .is-report-paper,
.expense-report-page .is-report-paper,
.is-report-paper,
.settlement-paper,
.report-paper,
.income-paper,
.expense-paper {
  width: 100% !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* =========================================================
   FINAL ERP TOOLBAR 1440px
========================================================= */

.erp-toolbar,
.report-toolbar,
.common-report-toolbar,
.toolbar-shell,
.toolbar-wrap {
  width: 1440px !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 툴바 카드 */
.erp-toolbar > div,
.report-toolbar > div,
.common-report-toolbar > div {
  width: 100% !important;
  max-width: 1440px !important;
  box-sizing: border-box !important;
}

/* =========================================================
   FINAL WORK TABS 1440 + MENU ATTACH
========================================================= */

/* 메뉴 아래 여백 제거 */
.nav {
  margin-bottom: 0 !important;
  border-bottom: 0 !important;
}

/* 본문 상단 여백 제거 */
.main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 개별 작업탭 */
.erp-work-tab {
  width: 120px !important;       /* 탭 폭 */
  min-width: 120px !important;
  max-width: 120px !important;
}

/* =========================================================
   FINAL ERP WORK TABS
   - 항목별 명세서 공통툴바와 좌우폭 일치
   - 탭 폭은 120px
   - 밑줄 제거
========================================================= */

.erp-work-tabs{
  width:min(1440px, calc(100% - 40px)) !important;
  max-width:1440px !important;
  margin:0 auto !important;
  padding:6px !important;

  display:flex !important;
  align-items:flex-end !important;
  justify-content:flex-start !important;
  gap:2px !important;
  border-bottom:1px solid #b8c4d6 !important;
  border-bottom:0 !important;
  overflow:visible !important;
}

.erp-work-tab{
  width:160px !important;
  min-width:160px !important;
  max-width:160px !important;

  height:34px !important;
  padding:0 12px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  position:relative !important;
  flex:0 0 auto !important;

  background:#f8fafc !important;
  border:1px solid #b8c4d6 !important;
  border-bottom:0 !important;
  border-radius:6px 6px 0 0 !important;
  box-sizing:border-box !important;
}

.erp-work-tab.active{
  background:#fff !important;
  border-top:3px solid #2563eb !important;
}

.erp-work-tab > a{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;

  font-size:14px !important;
  font-weight:800 !important;
  color:#111827 !important;
  text-decoration:none !important;
}

.erp-work-tab:hover{
  width:auto !important;
  max-width:none !important;
  min-width:160px !important;
  padding-right:28px !important;
  z-index:20 !important;
}

.erp-work-tab:hover > a{
  overflow:visible !important;
  text-overflow:clip !important;
}

.erp-tab-close{
  position:absolute !important;
  right:8px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  opacity:0 !important;
  visibility:hidden !important;
  border:0 !important;
  background:transparent !important;
  color:#dc2626 !important;
  font-size:13px !important;
  font-weight:900 !important;
}

.erp-work-tab:hover .erp-tab-close{
  opacity:1 !important;
  visibility:visible !important;
}

.erp-work-tab:first-child .erp-tab-close{
  display:none !important;
}

/* =========================================================
   FINAL WORKTAB LINE + TOOLBAR GAP
   - 작업탭 아래선 보이게
   - 작업탭과 공통툴바 간격 4px
========================================================= */

.erp-work-tabs {
  border-bottom: 1px solid #b8c4d6 !important;  /* 작업탭 아래선 */
  margin-bottom: 4px !important;                /* 공통툴바와 간격 */
  padding-bottom: 0 !important;
}

.erp-work-tab {
  border-bottom: 0 !important;
}

/* 작업탭 바로 다음 공통툴바 */
.erp-work-tabs + .rt-toolbar-card {
  margin-top: 0 !important;
}

/* =========================================================
   breadcrumb 완전 제거
========================================================= */

.breadcrumb,
.breadcrumb-inner,
.page-breadcrumb,
.page-breadcrumb-inner{
  display:none !important;
}

/* =========================================
   Header 우측 날짜 / 회계기수 / 로그아웃
========================================= */
.header-right{
  display:flex;
  align-items:center;
  gap:12px;
  color:rgba(255,255,255,.92);
  font-size:14.5px;
  font-weight:800;
  white-space:nowrap;
}

.header-date,
.header-fiscal,
.header-sep{
  color:rgba(255,255,255,.92);
}

.header-right .logout{
  color:rgba(255,255,255,.92);
  text-decoration:none;
}

.header-right .logout:hover{
  text-decoration:underline;
}


/* =========================================================
   HEADER FINAL FIX
   - 로고/제목 좌측 복구
   - 날짜/회계기수/로그아웃 우측 1줄 유지
========================================================= */

.header{
  width:100%;
  height:72px;
  background:#111827;
  color:#fff;
}

.header-inner{
  width:min(1440px, calc(100% - 40px));
  max-width:1440px;
  height:72px;
  margin:0 auto;

  display:flex;
  align-items:center;
  justify-content:space-between;
}

.header-brand{
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:#fff;
  min-width:0;
}

.header-logo{
  width:42px !important;
  height:42px !important;
  max-width:42px !important;
  max-height:42px !important;
  object-fit:contain !important;
  flex:0 0 42px;
}

.header-title{
  font-size:24px;
  font-weight:900;
  letter-spacing:-1px;
  white-space:nowrap;
  color:#fff;
}

.header-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;

  color:rgba(255,255,255,.92);
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
}

.header-date,
.header-fiscal,
.header-sep{
  color:rgba(255,255,255,.92);
}

.header-right .logout{
  color:rgba(255,255,255,.92);
  text-decoration:none;
}

.header-right .logout:hover{
  text-decoration:underline;
}

/* =========================================================
   HEADER RESTORE FINAL
   - 로고 / 제목 / 날짜 / 회기 / 로그인상태 모두 표시
========================================================= */

.header{
  width:100%;
  height:72px !important;
  background:#111827 !important;
  color:#fff !important;
}

.header-inner{
  width:min(1440px, calc(100% - 40px)) !important;
  max-width:1440px !important;
  height:72px !important;
  margin:0 auto !important;

  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
}

.header-brand{
  display:flex !important;
  align-items:center !important;
  gap:14px !important;
  text-decoration:none !important;
  color:#fff !important;
}

.header-logo{
  width:42px !important;
  height:42px !important;
  max-width:42px !important;
  max-height:42px !important;
  object-fit:contain !important;
  flex:0 0 42px !important;
}

.header-title{
  color:#fff !important;
  font-size:24px !important;
  font-weight:900 !important;
  letter-spacing:-1px !important;
  white-space:nowrap !important;
}

.header-right{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:12px !important;

  color:rgba(255,255,255,.92) !important;
  font-size:14px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}

.header-date,
.header-fiscal,
.header-sep{
  display:inline-block !important;
  color:rgba(255,255,255,.92) !important;
}

.header-right .logout{
  color:rgba(255,255,255,.92) !important;
  text-decoration:none !important;
}

.header-right .logout:hover{
  text-decoration:underline !important;
}

/* =========================================================
   GLOBAL 화면 좌우 흔들림 방지 FINAL
   - 스크롤바 생성/제거 시 본문 폭 재계산 방지
   - 1440px 레이아웃 유지
   ========================================================= */

html{
  overflow-y: scroll !important;
  scrollbar-gutter: stable !important;
}

body{
  overflow-x: hidden !important;
}

.main,
.main-inner{
  width: min(1440px, calc(100% - 40px)) !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 내부 툴바/카드가 body 폭을 밀지 못하게 */
.today-wrap,
.today-card,
.rt-toolbar-row,
.erp-work-tabs,
.erp-sub-tabs{
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* flex 버튼 클릭 시 폭 재계산 방지 */
button,
a,
input,
select{
  box-sizing: border-box !important;
}

/* =========================================================
   HEADER / NAV sticky FINAL
   - fixed 사용 안 함
   - 본문 밀림 방지
   ========================================================= */

.header{
  position: sticky !important;
  top: 0 !important;
  z-index: 5000 !important;
}

.nav{
  position: sticky !important;
  top: 72px !important;
  z-index: 4990 !important;
}

/* fixed용 여백 제거 */
.main{
  padding-top: 4px !important;
  margin-top: 0 !important;
}


/* =========================================================
   ERP 페이지 상단 간격 최종 압축
   ========================================================= */

body:has(.period-toolbar) .main{
  padding-top: 0 !important;
}

body:has(.period-toolbar) .main-inner{
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body:has(.period-toolbar) .expense-list-wrap,
body:has(.period-toolbar) .today-wrap{
  margin-top: -8px !important;
}

/* =====================================================
   공통 본문 폭 1400px 통일
   - 본회계결산서/항목별명세서/예산보고서 폭 이탈 방지
===================================================== */

.main,
.page,
.content,
.settlement-summary-page,
.settlement-page,
.finance-report-page,
.item-statement-page{
  width:min(1400px, calc(100% - 40px)) !important;
  max-width:1400px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}


/* 자금관리 2단 드롭다운 */
.nav-dropdown-nested {
  min-width: 190px;
}

.nav-subgroup {
  position: relative;
}

.nav-subtitle {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  cursor: default;
}

.nav-subgroup:hover > .nav-subtitle {
  background: #f1f5ff;
  color: #1d4ed8;
}

.nav-subdropdown {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 210px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15,23,42,.14);
  padding: 8px;
  z-index: 9999;
}

.nav-subgroup:hover > .nav-subdropdown {
  display: block;
}

.nav-subdropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.nav-subdropdown a:hover {
  background: #f1f5ff;
  color: #1d4ed8;
}

/* 20260620 헌금입력 ERP 강제 폭 보정 */
body:has(.offering-input-page) .main-inner {
  width:1440px !important;
  max-width:1440px !important;
  margin:0 auto !important;
}

body:has(.offering-input-page) input[name="start_date"],
body:has(.offering-input-page) input[name="end_date"] {
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
}

body:has(.offering-input-page) input[name="offering_date"] {
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
}

body:has(.offering-input-page) .erp-card,
body:has(.offering-input-page) .offering-input-page {
  width:1440px !important;
  max-width:1440px !important;
  margin:0 auto !important;
  box-sizing:border-box !important;
}
