/* dsgroup — layout from app.gongbok.com */

:root {
 --sidebar-width: 220px;
 --main-pad-x: 16px;
 --header-h: 48px;
 --action-bar-h: 44px;
 /* 좌측 부서(현장) 행 ↔ 우측 그리드 행 동일 */
 --list-row-h: 36px;
 --list-row-pad-y: 6px;
 --list-row-pad-x: 14px;
 --list-gap-y: 0;
 --font-menu: 14px;

 /* palette */
 --navy: #0f2a4a;
 --green: #2f6b3a;
 --blue: #2e75b5;
 --blue-soft: #5b9bd5;
 --orange: #ed7d31;
 --peach: #f8cbad;
 --cream: #fff2cc;
 --mint: #c6e0b4;
 --sky: #bdd7ee;
 --gray: #d0d0d0;
 --bg: #e8eef4;
 --panel: #ffffff;
 --line: #c5d0dc;
 --text: #000000;
 --muted: #5a6a7a;
 --shadow: 0 10px 28px rgba(15, 42, 74, 0.12);

 --nav-bg: var(--navy);
 --sidebar-bg: #f3f7fb;
 --card-border: var(--line);
 --text-primary: var(--text);
 --text-secondary: var(--muted);
 --menu-active-bg: var(--sky);
 --menu-active-fg: var(--navy);
 --msg-bg: #e0f2fe;
 --msg-border: #bae6fd;
 --input-bg: #f5f8fb;
 --head-bg: #edf3f8;
 --chrome: #f7fafc;
 --panel-bg: var(--panel);
 --footer-bg: var(--chrome);
 --body-bg: var(--bg);
 --card-bg: var(--panel);
 --table-head-bg: var(--head-bg);
 --accent-blue: #0ea5e9;
 --btn-red: #dc2626;
 --btn-green: #059669;
 --focus-border: #0284c7;
 --focus-glow: rgba(14, 165, 233, 0.22);
 --focus-fill: #e8f6fd;
 --grid-stripe: #f3f7fb;
 --font-sm: 12px;
 --font-sidebar: 13px;
 --font: "Noto Sans KR", sans-serif;
 --brand-h: 22px;
 --font-family-brand: "DaeguCatholicUniversity", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; font-family: var(--font); }

body,
button, input, select, textarea, summary, a, label {
 font-family: var(--font);
}

.fa, .fas, .far, .fa-solid, .fa-regular, .fa-brands {
 font-family: "Font Awesome 6 Free" !important;
}
.fa-solid, .fas { font-weight: 900; }

body.app {
 margin: 0;
 height: 100%;
 display: flex;
 flex-direction: column;
 overflow: hidden;
 font-size: 14px;
 color: var(--text-primary);
 background: var(--bg);
}

/* ===== gongbok header ===== */
.nav-header {
 background-color: var(--nav-bg);
 height: var(--header-h);
 padding: 0;
 display: grid;
 grid-template-columns: var(--sidebar-width) 1fr;
 align-items: center;
 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
 flex-shrink: 0;
 z-index: 1000;
 position: relative;
}

.nav-brand {
 width: var(--sidebar-width);
 max-width: var(--sidebar-width);
 height: var(--header-h);
 padding: 0 14px;
 display: flex;
 align-items: center;
 gap: 8px;
 flex-shrink: 0;
 min-width: 0;
 overflow: hidden;
 background: var(--nav-bg);
 border-right: 1px solid rgba(255, 255, 255, 0.12);
 box-sizing: border-box;
}

.brand-logo {
 display: flex;
 align-items: center;
 gap: 8px;
 text-decoration: none;
 color: #fff;
 font-weight: 700;
 font-size: var(--brand-h);
 white-space: nowrap;
 min-width: 0;
 flex: 1;
 overflow: hidden;
 height: var(--header-h);
}

.brand-logo img {
 height: 36px;
 width: auto;
 max-width: 88px;
 min-width: 0;
 object-fit: contain;
 border-radius: 6px;
 background: var(--nav-bg);
 overflow: hidden;
 flex-shrink: 1;
 display: block;
}

.brand-logo span {
 overflow: hidden;
 font-family: var(--font-family-brand);
 font-weight: normal;
 font-size: var(--brand-h);
 line-height: 1;
 height: var(--brand-h);
 display: flex;
 align-items: center;
 flex: 0 0 auto;
 min-width: 0;
 letter-spacing: -0.02em;
}

.nav-center {
 display: flex;
 align-items: center;
 min-width: 0;
 padding-left: var(--main-pad-x);
 overflow-x: auto;
 height: var(--header-h);
}

.nav-primary {
 display: inline-grid;
 grid-auto-flow: column;
 grid-auto-columns: 1fr;
 align-items: center;
 gap: 8px;
 min-width: 0;
}

.nav-menubtn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 6px;
 width: 100%;
 min-width: 0;
 height: 30px;
 padding: 0 10px;
 border-radius: 6px;
 text-decoration: none;
 color: #fff;
 font-size: 12px;
 font-weight: 700;
 white-space: nowrap;
 background: linear-gradient(180deg, #3d6ea8 0%, #1f4f86 100%);
 box-shadow: 0 2px 6px rgba(15, 42, 74, 0.18);
 border: none;
 cursor: pointer;
 box-sizing: border-box;
}
.nav-menubtn i {
 font-size: 11px;
}

.nav-menubtn:hover {
 filter: brightness(1.06);
}

.nav-menubtn.active{
 outline: 1px solid var(--orange);
 outline-offset: 0;
 box-shadow: 0 2px 6px rgba(15, 42, 74, 0.18);
}

/* ===== gongbok workspace ===== */
.app-workspace {
 display: flex;
 position: relative;
 flex: 1;
 width: 100%;
 min-height: 0;
 overflow: hidden;
}

.site-sidebar {
 width: var(--sidebar-width);
 background-color: var(--sidebar-bg);
 border-right: 1px solid var(--card-border);
 display: flex;
 flex-direction: column;
 flex-shrink: 0;
 overflow: hidden;
 z-index: 900;
 font-size: var(--font-menu);
 height: 100%;
 min-height: 0;
}

.site-sidebar-header {
 height: var(--action-bar-h);
 min-height: var(--action-bar-h);
 box-sizing: border-box;
 border-bottom: 1px solid var(--card-border);
 flex-shrink: 0;
 padding: 0 10px 0 14px;
 font-weight: 700;
 color: var(--text);
 font-size: 13px;
 display: flex;
 align-items: center;
 gap: 8px;
}
.site-sidebar-header i {
 width: 1.1em;
 text-align: center;
 font-size: 13px;
 color: #0ea5e9;
}
html[data-theme="dark"] .site-sidebar-header,
html[data-theme="dark"] .site-sidebar-header i {
 color: #7dd3fc;
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .site-sidebar-header,
 html[data-theme="system"] .site-sidebar-header i {
  color: #7dd3fc;
 }
}

.site-sidebar-sites {
 flex: 1 1 0;
 min-height: 0;
 overflow: hidden;
 display: flex;
 flex-direction: column;
}

.site-sidebar-list {
 list-style: none;
 margin: 0;
 padding: 0;
 overflow-y: auto;
 flex: 1;
 min-height: 0;
}

.site-sidebar-site {
 display: flex;
 align-items: center;
 gap: 8px;
 box-sizing: border-box;
 height: var(--list-row-h);
 min-height: var(--list-row-h);
 max-height: var(--list-row-h);
 padding: var(--list-row-pad-y) 10px var(--list-row-pad-y) 14px;
 margin: 0;
 border-radius: 0;
 color: var(--text);
 text-decoration: none;
 font-weight: 400;
 font-size: var(--font-sidebar);
 line-height: 1.2;
 overflow: visible;
 background: transparent;
}
.site-sidebar-site i {
 width: 1.1em;
 text-align: center;
 font-size: 12px;
 color: var(--text-secondary);
 flex-shrink: 0;
}
.site-sidebar-site.active i {
 color: var(--orange);
}
.site-sidebar-site span {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 min-width: 0;
 font-weight: 400;
}
.site-sidebar-site:hover {
 background: rgba(47, 107, 58, 0.1);
 color: var(--text);
}
.site-sidebar-site.active {
 background: var(--mint);
 color: #000;
 font-weight: 400;
}
.site-sidebar-site.active span {
 color: #000;
}

.site-sidebar-hint {
 padding: 10px 14px;
 color: var(--text-secondary);
 font-size: 12px;
}

.site-sidebar-account {
 flex-shrink: 0;
 display: flex;
 flex-direction: column;
 padding: 0;
 border-top: 1px solid var(--card-border);
}

.site-sidebar-account-row {
 display: flex;
 align-items: center;
 gap: 8px;
 box-sizing: border-box;
 height: var(--list-row-h);
 min-height: var(--list-row-h);
 max-height: var(--list-row-h);
 padding: 0 14px;
 color: var(--text);
 text-decoration: none;
 font-weight: 700;
 font-size: var(--font-sidebar);
}
button.site-sidebar-account-row {
 appearance: none;
 border: none;
 background: transparent;
 width: 100%;
 cursor: pointer;
 font-family: inherit;
 text-align: left;
}
.site-sidebar-account-row i {
 width: 1.1em;
 text-align: center;
 font-size: 12px;
 flex-shrink: 0;
}
.site-sidebar-account-row:hover {
 background: rgba(46, 117, 181, 0.1);
 color: var(--text);
}
.site-sidebar-account-row.active {
 background: var(--menu-active-bg);
 color: var(--menu-active-fg);
}
.site-sidebar-account-row.logout-row {
 color: #ef4444;
}
.site-sidebar-account-row.logout-row:hover {
 background: rgba(239, 68, 68, 0.1);
 color: #ef4444;
}
.site-sidebar-account .account-row-text {
 display: flex;
 flex-direction: column;
 gap: 1px;
 min-width: 0;
 flex: 1;
}
.site-sidebar-account .account-email {
 font-size: 11px;
 font-weight: 500;
 color: var(--text-secondary);
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 max-width: 160px;
}
.site-sidebar-account .profile-caret {
 margin-left: auto;
 font-size: 10px;
 color: var(--text-secondary);
 transition: transform 0.15s;
}
.site-sidebar-profile { border-top: 1px solid var(--card-border); }
.site-sidebar-profile > summary {
 list-style: none;
 cursor: pointer;
 border-top: none;
 height: auto;
 min-height: var(--list-row-h);
 max-height: none;
 padding-top: 8px;
 padding-bottom: 8px;
}
.site-sidebar-profile > summary::-webkit-details-marker { display: none; }
.site-sidebar-profile[open] .profile-caret { transform: rotate(180deg); }
.site-sidebar-profile-menu {
 padding: 8px 10px 10px;
 display: flex;
 flex-direction: column;
 gap: 8px;
 background: transparent;
 border-top: 1px solid var(--card-border);
}
.profile-menu-block { display: flex; flex-direction: column; gap: 6px; }
.profile-menu-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.profile-menu-edit {
 display: flex;
 align-items: center;
 gap: 8px;
 width: 100%;
 padding: 8px 10px;
 border: 1px solid var(--card-border);
 border-radius: 8px;
 background: var(--input-bg);
 color: var(--text-primary);
 font-size: var(--font-sidebar);
 font-weight: 600;
 cursor: pointer;
 font-family: inherit;
 text-align: left;
}
.profile-menu-edit:hover { background: rgba(46, 117, 181, 0.1); }
.profile-menu-edit i {
 width: 1.1em;
 text-align: center;
 font-size: 12px;
}
.theme-switch {
 display: grid;
 grid-auto-flow: column;
 grid-auto-columns: 1fr;
 gap: 2px;
 background: rgba(15, 42, 74, 0.08);
 border-radius: 8px;
 padding: 2px;
 width: 100%;
}
.theme-switch button {
 width: 100%;
 border: none;
 background: transparent;
 color: var(--text-secondary);
 font-size: 11px;
 font-weight: 700;
 padding: 6px 4px;
 border-radius: 6px;
 cursor: pointer;
 text-align: center;
 font-family: inherit;
}
.theme-switch button.active {
 background: #bdd7ee;
 color: #0f2a4a;
}
html[data-theme="dark"] .theme-switch {
 background: rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .theme-switch {
  background: rgba(255, 255, 255, 0.08);
 }
}

html[data-theme="dark"] {
 color-scheme: dark;
 --bg: #0f172a;
 --panel: #111827;
 --sidebar-bg: #0b1220;
 --text: #e5e7eb;
 --text-primary: #e5e7eb;
 --text-secondary: #94a3b8;
 --muted: #94a3b8;
 --line: #334155;
 --card-border: #334155;
 --menu-active-bg: #1e3a5f;
 --menu-active-fg: #e0f2fe;
 --sky: #1e3a5f;
 --input-bg: #1e293b;
 --head-bg: #1e293b;
 --chrome: #0b1220;
 --panel-bg: #1f232d;
 --footer-bg: #111318;
 --body-bg: #0f172a;
 --card-bg: #1f232d;
 --table-head-bg: #1e293b;
 --focus-border: #38bdf8;
 --focus-glow: rgba(56, 189, 248, 0.28);
 --focus-fill: #16324a;
 --grid-stripe: #1e293b;
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] {
 color-scheme: dark;
 --bg: #0f172a;
 --panel: #111827;
 --sidebar-bg: #0b1220;
 --text: #e5e7eb;
 --text-primary: #e5e7eb;
 --text-secondary: #94a3b8;
 --muted: #94a3b8;
 --line: #334155;
 --card-border: #334155;
 --menu-active-bg: #1e3a5f;
 --menu-active-fg: #e0f2fe;
 --sky: #1e3a5f;
 --input-bg: #1e293b;
 --head-bg: #1e293b;
 --chrome: #0b1220;
 --panel-bg: #1f232d;
 --footer-bg: #111318;
 --body-bg: #0f172a;
 --card-bg: #1f232d;
 --table-head-bg: #1e293b;
 --focus-border: #38bdf8;
 --focus-glow: rgba(56, 189, 248, 0.28);
 --focus-fill: #16324a;
 --grid-stripe: #1e293b;
 }
}

.main-content {
 flex: 1;
 padding: 0 var(--main-pad-x) 12px;
 min-width: 0;
 overflow-y: auto;
 display: flex;
 flex-direction: column;
 position: relative;
 background: var(--panel);
}

/* ===== ADMIN ===== */
.main-content--admin {
 padding: 0;
 overflow: hidden;
}

.admin-accounts {
 flex: 1;
 min-height: 0;
 display: flex;
 flex-direction: column;
 padding: 0;
}

/* ===== ESW / gongbok action · msg · search toolbar ===== */
.action-status-bar {
 height: var(--action-bar-h);
 min-height: var(--action-bar-h);
 max-height: var(--action-bar-h);
 box-sizing: border-box;
 background: var(--head-bg);
 border: none;
 border-bottom: 1px solid var(--line);
 border-radius: 0;
 padding: 0 10px;
 margin: 0;
 display: flex;
 align-items: center;
 justify-content: flex-start;
 gap: 8px;
 flex-wrap: nowrap;
 flex-shrink: 0;
 overflow: hidden;
 container-type: inline-size;
}

.action-status-right {
 display: flex;
 align-items: center;
 gap: 6px;
 flex: 0 0 auto;
 min-width: 0;
 justify-content: flex-end;
 margin-left: auto;
}

#msg-bar-text {
 flex: 1;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 word-break: keep-all;
}

.search-box:not(:has(input)) {
 display: none;
}
.search-box {
 position: relative;
 display: flex;
 align-items: center;
 flex: 0 0 14cqi;
 width: 14cqi;
 max-width: 180px;
 min-width: 112px;
 height: 32px;
}
.search-box i.fa-magnifying-glass {
 position: absolute;
 left: 10px;
 top: 50%;
 transform: translateY(-50%);
 color: var(--text-secondary);
 font-size: 12px;
 pointer-events: none;
}
.search-box input {
 height: 32px;
 padding: 0 12px 0 30px;
 background: var(--panel);
 border: 1px solid var(--line);
 border-radius: 8px;
 color: var(--text-primary);
 font-size: 13px;
 width: 100%;
 min-width: 0;
 line-height: 32px;
 box-sizing: border-box;
}
.search-box input::placeholder {
 color: var(--text-secondary);
 opacity: 1;
}
.search-box input:focus {
 outline: none;
 border-color: var(--focus-border);
 background: var(--focus-fill);
 box-shadow: 0 0 0 2px var(--focus-glow);
}

.btn-toolbar {
 height: 32px;
 border: 1px solid var(--line);
 background: var(--panel);
 color: var(--text-primary);
 padding: 0 12px;
 border-radius: 8px;
 font-size: 13px;
 font-weight: 700;
 cursor: pointer;
 display: inline-flex;
 align-items: center;
 gap: 4px;
 line-height: 1;
 appearance: none;
 white-space: nowrap;
}
.btn-toolbar:hover:not(:disabled) {
 filter: brightness(1.06);
}
.btn-toolbar.primary {
 background: var(--btn-green);
 border-color: var(--btn-green);
 color: #fff;
}
.btn-toolbar.print {
 background: #0369a1;
 border-color: #0284c7;
 color: #fff;
}

.btn-toolbar-group {
 display: inline-grid;
 grid-auto-flow: column;
 grid-auto-columns: 1fr;
 gap: 6px;
 align-items: center;
}
.btn-toolbar-group .btn-toolbar {
 width: 100%;
 justify-content: center;
}

.btn-sky, .btn-red, .btn-ghost {
 appearance: none;
 border: none;
 border-radius: 6px;
 cursor: pointer;
 font: inherit;
 font-weight: 700;
 display: inline-flex;
 align-items: center;
 gap: 6px;
 padding: 0 12px;
 height: 32px;
 white-space: nowrap;
}
html[data-theme="dark"] .btn-sky { color: #0f172a; }
html[data-theme="dark"] .side-panel .btn-ghost,
html[data-theme="dark"] .side-panel-title,
html[data-theme="dark"] .side-panel label {
 color: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .btn-sky { color: #0f172a; }
 html[data-theme="system"] .side-panel .btn-ghost,
 html[data-theme="system"] .side-panel-title,
 html[data-theme="system"] .side-panel label {
 color: #e5e7eb;
 }
}
.btn-sky { background: #0284c7; color: #fff; }
.btn-red { background: #dc2626; color: #fff; }
.btn-ghost {
 background: transparent;
 color: var(--text);
 border: 1px solid var(--line);
}

.grid-list {
 flex: 1;
 min-height: 0;
 overflow: auto;
 position: relative;
 z-index: 0;
 background: var(--panel);
 border: none;
 border-top: 1px solid var(--line);
 border-radius: 0;
 margin: 0;
 padding: var(--list-gap-y) 0;
 -webkit-overflow-scrolling: touch;
}
/* grid-list 스크롤 시 헤더 고정 (합계 없는 일반 그리드) */
.grid-list > .data-grid thead th,
.grid-list > table.data-grid thead th {
 position: sticky;
 top: 0;
 z-index: 5;
 background: var(--head-bg);
}
.data-grid {
 width: 100%;
 border-collapse: separate;
 border-spacing: 0;
 font-size: var(--font-sidebar);
 table-layout: fixed;
}
.data-grid th.col-check,
.data-grid td.col-check {
 width: 36px;
 text-align: center;
 padding-left: 0;
 padding-right: 0;
}
.data-grid th.col-check input,
.data-grid td.col-check input {
 margin: 0;
 vertical-align: middle;
}
.data-grid th,
.data-grid td {
 box-sizing: border-box;
 height: var(--list-row-h);
 min-height: var(--list-row-h);
 max-height: var(--list-row-h);
 padding: var(--list-row-pad-y) var(--list-row-pad-x);
 font-size: var(--font-sidebar);
 line-height: 1.2;
 vertical-align: middle;
 white-space: nowrap;
 overflow: hidden;
}
.data-grid td {
 text-overflow: ellipsis;
}

/* === 숫자·소수·% : 우측정렬 + 말줄임/잘림 금지 (그리드·합계·사이드) === */
.data-grid {
 table-layout: auto;
}

.data-grid td.cell-num,
.data-grid td.col-num,
.data-grid th.cell-num,
.data-grid th.col-num,
.data-grid tfoot td.cell-num,
.data-grid tfoot td.col-num {
 text-align: right !important;
 font-variant-numeric: tabular-nums;
 text-overflow: clip !important;
 overflow: visible !important;
 white-space: nowrap !important;
 max-width: none !important;
 width: auto !important;
 min-width: max-content;
}
.data-grid thead th.cell-num,
.data-grid thead th.col-num {
 overflow: visible !important;
 text-overflow: clip !important;
}
.side-panel-form input.input-num,
.side-panel-form input[inputmode="numeric"],
.side-panel-form input[inputmode="decimal"],
.side-panel-form input.num-right,
.side-panel-form .num-right {
 text-align: right !important;
 font-variant-numeric: tabular-nums;
 text-overflow: clip !important;
 overflow: visible !important;
 white-space: nowrap !important;
}

.data-grid td.cell-docno {
 text-overflow: clip;
}
.data-grid th {
 position: sticky;
 top: 0;
 background: var(--head-bg);
 color: var(--text);
 font-weight: 700;
 text-align: left;
 border-bottom: 1px solid var(--line);
 z-index: 5;
 text-overflow: clip;
}
/* 스크롤 시 헤더가 본문 위로 확실히 덮이도록 */
.data-grid thead th {
 position: sticky;
 top: 0;
 z-index: 5;
 background: var(--head-bg);
}
.data-grid td {
 border-bottom: 1px solid var(--line);
 color: var(--text);
}
.data-grid .col-num { text-align: right; font-variant-numeric: tabular-nums; }
/* 계획 대비 집행 현황. 잔액이 음수면 색으로 드러낸다. */
.data-grid tfoot .plan-status {
 margin-left: 8px;
 font-weight: 400;
 color: var(--muted);
}
.data-grid tfoot .plan-status.over {
 color: #c0392b;
 font-weight: 700;
}
/* 합계 줄. 목록을 스크롤해도 마지막 줄이 바닥에 붙어 있어야 읽을 수 있다. */
.data-grid tfoot td {
 position: sticky;
 bottom: 0;
 background: var(--head-bg);
 font-weight: 700;
 border-top: 1px solid var(--line);
 border-bottom: none;
 z-index: 1;
 cursor: default;
}
.data-grid tbody tr { cursor: pointer; }
.data-grid tbody tr:nth-child(even) { background: var(--grid-stripe); }
.data-grid tbody tr:hover { background: rgba(46, 117, 181, 0.12); }
.data-grid tbody tr.selected{
 background: var(--mint);
}
html[data-theme="dark"] .data-grid tbody tr:nth-child(even) {
 background: var(--grid-stripe);
}
html[data-theme="dark"] .data-grid tbody tr:hover {
 background: color-mix(in srgb, var(--blue-soft) 22%, var(--panel));
}
html[data-theme="dark"] .data-grid tbody tr.selected{
 background: color-mix(in srgb, var(--orange) 22%, var(--panel));
 box-shadow: inset 0 0 0 2px var(--orange);
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .data-grid tbody tr:nth-child(even) {
 background: var(--grid-stripe);
 }
 html[data-theme="system"] .data-grid tbody tr:hover {
 background: color-mix(in srgb, var(--blue-soft) 22%, var(--panel));
 }
 html[data-theme="system"] .data-grid tbody tr.selected{
 background: color-mix(in srgb, var(--orange) 22%, var(--panel));
 box-shadow: inset 0 0 0 2px var(--orange);
 }
}
/* taxlist: 매출 행 옅은 파랑 */
.data-grid tbody tr.taxlist-sales,
.data-grid tbody tr.taxlist-sales:nth-child(even) {
 background: #e0f2fe;
}
.data-grid tbody tr.taxlist-sales:hover {
 background: rgba(46, 117, 181, 0.16);
}
html[data-theme="dark"] .data-grid tbody tr.taxlist-sales,
html[data-theme="dark"] .data-grid tbody tr.taxlist-sales:nth-child(even) {
 background: color-mix(in srgb, #38bdf8 18%, var(--panel));
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .data-grid tbody tr.taxlist-sales,
 html[data-theme="system"] .data-grid tbody tr.taxlist-sales:nth-child(even) {
  background: color-mix(in srgb, #38bdf8 18%, var(--panel));
 }
}

.grid-row { cursor: pointer; }
.grid-row:hover { background: rgba(46, 117, 181, 0.12); }

.sheet-file-input {
 display: block;
 margin-top: 6px;
 font-size: 12px;
 width: 100%;
 max-width: 100%;
}
.form-row-files {
 align-items: stretch;
}
.form-row-files > .form-cell {
 display: flex;
 flex-direction: column;
 min-width: 0;
 overflow: hidden;
}
.form-row-files .file-panel-editable {
 margin-bottom: 6px;
 overflow: visible;
}
.form-row-files .file-field-picker {
 margin-top: auto;
}
.form-row-files .sheet-file-input {
 margin-top: 0;
}
.save-upload-progress {
 margin: 0 0 12px;
 padding: 8px 10px;
 border: 1px solid var(--line, #d8dee8);
 border-radius: 6px;
 background: #f7f9fc;
}
.save-upload-progress progress {
 display: block;
 width: 100%;
 height: 8px;
}
.save-upload-progress-text {
 font-size: 11px;
 color: var(--muted);
 margin-bottom: 4px;
}
.file-panel-editable {
 display: flex;
 flex-direction: column;
 gap: 4px;
 margin-bottom: 6px;
 min-width: 0;
 max-width: 100%;
 overflow: hidden;
}
.file-panel-editable-row {
 flex-wrap: nowrap;
 max-width: 100%;
}
.file-keep-row {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 4px 0;
 font-size: 12px;
 min-width: 0;
}
.file-keep-row .file-keep-name {
 flex: 1;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 color: var(--text);
 font-weight: 600;
}
.file-keep-input { display: none; }
.file-keep-removed { display: none !important; }
.file-panel-actions {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 flex-shrink: 0;
}
.file-panel-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 28px;
 height: 28px;
 padding: 0;
 border-radius: 6px;
 border: 1px solid var(--line);
 background: var(--head-bg);
 color: var(--blue);
 cursor: pointer;
 text-decoration: none;
 font-size: 12px;
}
.file-panel-btn:hover {
 background: rgba(46, 117, 181, 0.12);
}
.file-photo-panel-remove {
 width: 20px;
 height: 20px;
 padding: 0;
 margin: 0;
 border: none;
 border-radius: 4px;
 cursor: pointer;
 background: rgba(15, 23, 42, 0.72);
 color: #fff;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 font-size: 11px;
 line-height: 1;
}
.file-photo-panel-remove:hover { background: rgba(220, 38, 38, 0.92); }
.file-photo-panel-remove-inline {
 position: static;
 flex: 0 0 20px;
}
.file-grid-cell {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 4px;
 width: 100%;
 max-width: 100%;
 min-width: 0;
 vertical-align: middle;
 line-height: 1.3;
}
.data-grid td.col-file {
 overflow: hidden;
 text-overflow: clip;
}
.cell-ellipsis {
 max-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.side-panel {
 position: absolute;
 top: 0;
 right: 0;
 width: min(46%, 540px);
 height: 100%;
 background: var(--panel);
 color: var(--text);
 border-left: 1px solid var(--line);
 box-shadow: -8px 0 24px rgba(15, 42, 74, 0.12);
 transform: translateX(105%);
 transition: transform 0.2s ease;
 z-index: 50;
 display: flex;
 flex-direction: column;
 overflow: hidden;
 pointer-events: auto;
}
.side-panel.open { transform: translateX(0); }
.side-panel:has(.panel-width-26) {
 width: calc(48px + 26em);
 max-width: 100%;
}
/* height:100% 금지 — 본문이 헤더(저장·수정)를 덮어 클릭이 먹통이 됨 */
#side-panel > form.side-panel-form-root,
#side-panel form.side-panel-form-root,
.side-panel-form-root {
 display: flex;
 flex-direction: column;
 flex: 1 1 auto;
 min-height: 0;
 overflow: hidden;
 margin: 0;
 height: auto;
}
.side-panel-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 padding: 10px 22px;
 border-bottom: 1px solid var(--line);
 background: var(--chrome);
 flex-shrink: 0;
 position: relative;
 z-index: 20;
}
.side-panel-title { font-weight: 800; color: var(--text); }
.side-panel-actions {
 display: flex;
 gap: 6px;
 flex-wrap: wrap;
 justify-content: flex-end;
 position: relative;
 z-index: 6;
 pointer-events: auto;
}
.side-panel-actions button {
 position: relative;
 z-index: 6;
 pointer-events: auto;
}
.side-panel-body {
 flex: 1;
 overflow: auto;
 min-height: 0;
 padding: 14px 24px;
 position: relative;
 z-index: 0;
}
.side-panel-form .form-row {
 display: grid;
 grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
 gap: 12px;
 margin-bottom: 12px;
}
.form-cell {
 min-width: 0;
 overflow: hidden;
}
.form-cell:has(select),
.form-cell:has(input[list]) {
 overflow: visible;
}
.form-cell-full { grid-column: 1 / -1; }
#imp-account-wrap {
 display: block;
 min-width: 0;
}
#imp-account-wrap > select,
#imp-account-wrap > input {
 width: 100%;
}
.form-cell label {
 display: block;
 font-size: 12px;
 font-weight: 700;
 color: var(--text);
 margin-bottom: 4px;
}
.form-req { color: #dc2626; margin-left: 2px; }
.form-cell input:not([type="checkbox"]):not([type="radio"]),
.form-cell select,
.form-cell textarea {
 width: 100%;
 border: 1px solid var(--line);
 border-radius: 6px;
 /* 사이드판넬 입력 칸이 세로로 답답해 보여 위아래를 2px씩 줄였다 */
 padding: 4px 10px;
 font: inherit;
 background: var(--input-bg);
 color: var(--text);
 color-scheme: inherit;
}
.form-cell input.field-locked:not([type="checkbox"]):not([type="radio"]),
.form-cell select.field-locked,
.form-cell textarea.field-locked {
 pointer-events: none;
 background: var(--chrome);
 color: var(--muted);
 cursor: default;
}

.panel-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.field-locked):focus,
.form-cell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.field-locked):focus,
.form-cell select:not(.field-locked):focus,
.form-cell textarea:not(.field-locked):focus,
.search-box input:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(.field-locked):focus,
select:not(.field-locked):focus,
textarea:not(.field-locked):focus {
 outline: none;
 border-color: var(--focus-border);
 background: var(--focus-fill);
 box-shadow: 0 0 0 2px var(--focus-glow);
}
/* 체크박스: 앱 전역 (그리드·사이드패널·폼) — ESW와 동일 */
input[type="checkbox"] {
 appearance: none;
 -webkit-appearance: none;
 width: 15px;
 height: 15px;
 min-width: 15px;
 min-height: 15px;
 margin: 0;
 padding: 0;
 flex-shrink: 0;
 cursor: pointer;
 vertical-align: middle;
 box-sizing: border-box;
 border: 1px solid var(--card-border);
 border-radius: 3px;
 background-color: var(--input-bg);
 position: relative;
 display: inline-block;
}
input[type="checkbox"]:checked {
 background-color: var(--accent-blue);
 border-color: var(--accent-blue);
}
input[type="checkbox"]:checked::after {
 content: "";
 position: absolute;
 left: 4px;
 top: 1px;
 width: 5px;
 height: 9px;
 border: solid #fff;
 border-width: 0 2px 2px 0;
 transform: rotate(45deg);
}
input[type="checkbox"]:disabled {
 opacity: 0.5;
 cursor: not-allowed;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="file"]:focus-visible {
 outline: 2px solid var(--focus-border);
 outline-offset: 2px;
}

/* ===== work module tabs (경영지원 등) ===== */
.work-module {
 flex: 1;
 min-height: 0;
 display: flex;
 flex-direction: column;
 position: relative;
}

.tab-container {
 display: flex;
 justify-content: flex-start;
 align-items: stretch;
 gap: 2px;
 height: 100%;
 min-height: 0;
 max-height: none;
 box-sizing: border-box;
 flex: 1 1 0%;
 width: auto;
 max-width: none;
 min-width: 0;
 padding: 2px 0;
 border-bottom: none;
 background: transparent;
 overflow-x: auto;
 overflow-y: hidden;
 scrollbar-width: none;
 -ms-overflow-style: none;
}
.tab-container::-webkit-scrollbar {
 display: none;
 width: 0;
 height: 0;
}

.tab-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 4px;
 flex: 0 0 auto;
 width: auto;
 min-width: auto;
 max-width: none;
 padding: 0 12px;
 height: 100%;
 text-decoration: none;
 color: var(--text-secondary);
 font-size: 12px;
 font-weight: 700;
 text-align: center;
 border-bottom: 2px solid transparent;
 white-space: nowrap;
 box-sizing: border-box;
 border-radius: 8px;
 overflow: hidden;
 text-overflow: clip;
}
.tab-btn i {
 font-size: 12px;
 color: #0ea5e9;
}
html[data-theme="dark"] .tab-btn i {
 color: #7dd3fc;
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .tab-btn i {
  color: #7dd3fc;
 }
}
.tab-btn:hover {
 color: var(--text-primary);
 background: var(--panel);
}
.tab-btn.active {
 color: var(--text-primary);
 background: var(--panel);
 border-bottom-color: var(--orange);
}
html[data-theme="dark"] .tab-btn {
 color: #cbd5e1;
}
html[data-theme="dark"] .tab-btn:hover,
html[data-theme="dark"] .tab-btn.active {
 color: #f8fafc;
}
@media (prefers-color-scheme: dark) {
 html[data-theme="system"] .tab-btn {
  color: #cbd5e1;
 }
 html[data-theme="system"] .tab-btn:hover,
 html[data-theme="system"] .tab-btn.active {
  color: #f8fafc;
 }
}

.work-module .admin-accounts {
 flex: 1;
 min-height: 0;
}
.side-panel-form textarea.form-ta-1l {
 height: 34px;
 min-height: 34px;
 max-height: 34px;
 line-height: 1.3;
 resize: none;
 overflow-x: auto;
 overflow-y: hidden;
 white-space: nowrap;
}
#user-sites-box {
 min-height: 36px;
 padding: 8px 10px;
 border: 1px solid var(--card-border);
 border-radius: 6px;
 background: var(--input-bg);
 color: var(--text);
 word-break: keep-all;
}
.fk-select-wrap {
 display: flex !important;
 align-items: center;
 gap: 6px;
 width: 100%;
 min-width: 0;
 position: relative;
 z-index: 2;
}
.fk-select-wrap > select {
 flex: 1 1 0% !important;
 min-width: 0 !important;
 width: 0 !important;
 max-width: none !important;
}
.side-panel-form .form-cell .fk-select-wrap > select,
.side-panel-form .form-cell-full .fk-select-wrap > select {
 flex: 1 1 0% !important;
 min-width: 0 !important;
 width: 0 !important;
 max-width: none !important;
}
.btn-fk-quick-add {
 flex: 0 0 32px !important;
 width: 32px !important;
 height: 32px;
 min-width: 32px !important;
 padding: 0;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 border: 1px solid var(--card-border);
 border-radius: 8px;
 background: var(--table-head-bg);
 color: var(--accent-blue);
 cursor: pointer;
 font-size: 14px;
 line-height: 1;
 position: relative;
 z-index: 5;
 pointer-events: auto;
}
.btn-fk-quick-add i { pointer-events: none; }
.btn-fk-quick-add:hover {
 background: color-mix(in srgb, var(--accent-blue) 12%, var(--table-head-bg));
}
#fk-quick-modal-root .app-modal {
 width: 100%;
 background: var(--panel);
 border: 1px solid var(--card-border);
 box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
 overflow: hidden;
 color: var(--text);
}
#fk-quick-modal-root .app-modal-header {
 padding: 14px 16px;
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 10px;
 border-bottom: 1px solid var(--card-border);
 background: var(--table-head-bg);
 flex-shrink: 0;
}
#fk-quick-modal-root .app-modal-title {
 font-size: 15px;
 font-weight: 700;
 color: var(--text);
 display: flex;
 align-items: center;
 gap: 8px;
}
#fk-quick-modal-root .app-modal-body {
 flex: 1 1 auto;
 min-height: 0;
 overflow: auto;
 padding: 14px;
 color: var(--text);
 font-size: 13px;
 line-height: 1.55;
}
#fk-quick-modal-root .app-modal-footer {
 padding: 12px 16px;
 display: flex;
 justify-content: flex-end;
 gap: 8px;
 border-top: 1px solid var(--card-border);
 background: var(--table-head-bg);
 flex-shrink: 0;
}
#fk-quick-modal-root .fk-quick-form .form-row:last-child {
 margin-bottom: 0;
}
#fk-quick-modal-root .app-modal.fk-quick-modal {
 width: calc(48px + 26em);
 max-width: min(calc(48px + 26em), 96vw);
 border-radius: 14px;
 max-height: min(88vh, 900px);
 display: flex;
 flex-direction: column;
}
#fk-quick-modal-root .fk-quick-modal form {
 display: flex;
 flex-direction: column;
 min-height: 0;
 flex: 1 1 auto;
}
#fk-quick-modal-root:empty { display: none !important; }
#fk-quick-modal-root:not(:empty) {
 display: block;
 position: fixed;
 inset: 0;
 z-index: 7600;
 pointer-events: auto;
}
#fk-quick-modal-root .app-modal-overlay {
 position: fixed;
 inset: 0;
 display: flex;
 background: rgba(15, 23, 42, 0.55);
 z-index: 7600;
}
#fk-quick-modal-root .app-modal-overlay:has(.fk-quick-modal) {
 align-items: center;
 justify-content: center;
 padding: 16px;
}
#fk-quick-modal-root .app-modal-overlay:has(.tbm-workers-modal) {
 align-items: stretch;
 justify-content: flex-end;
 padding: 0;
}
#fk-quick-modal-root .app-modal.tbm-workers-modal {
 width: calc(48px + 26em);
 max-width: 100%;
 height: 100vh;
 max-height: 100vh;
 border-radius: 0;
 display: flex;
 flex-direction: column;
 background: var(--panel);
 color: var(--text);
 border-left: 1px solid var(--card-border);
 box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
 overflow: hidden;
}
#fk-quick-modal-root .tbm-workers-modal .app-modal-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 12px 16px;
 border-bottom: 1px solid var(--card-border);
 flex-shrink: 0;
}
#fk-quick-modal-root .tbm-workers-modal .app-modal-body {
 flex: 1 1 auto;
 min-height: 0;
 overflow: auto;
 padding: 0;
}
#fk-quick-modal-root .tbm-workers-modal .app-modal-footer {
 display: flex;
 justify-content: flex-end;
 gap: 8px;
 padding: 12px 16px;
 border-top: 1px solid var(--card-border);
 flex-shrink: 0;
}
#fk-quick-modal-root .tbm-worker-table {
 width: 100%;
 border-collapse: collapse;
 font-size: 13px;
}
#fk-quick-modal-root .tbm-worker-table th,
#fk-quick-modal-root .tbm-worker-table td {
 padding: 8px 10px;
 border-bottom: 1px solid var(--card-border);
 text-align: left;
 vertical-align: middle;
}
#fk-quick-modal-root .tbm-worker-table th {
 position: sticky;
 top: 0;
 background: var(--table-head-bg);
 font-size: 12px;
 color: var(--muted);
}
#fk-quick-modal-root .tbm-worker-table tr:hover {
 background: color-mix(in srgb, var(--blue-soft, #93c5fd) 22%, transparent);
}
#fk-quick-modal-root .tbm-worker-table input[type="checkbox"] {
 appearance: none;
 -webkit-appearance: none;
 width: 16px;
 height: 16px;
 min-width: 16px;
 padding: 0;
 margin: 0;
 border: 1px solid var(--text);
 border-radius: 0;
 background: var(--input-bg);
 vertical-align: middle;
 cursor: pointer;
}
#fk-quick-modal-root .tbm-worker-table input[type="checkbox"]:checked {
 background: var(--text);
 box-shadow: inset 0 0 0 2px var(--input-bg);
}

#file-preview-modal-root:empty { display: none; }
#file-preview-modal-root:not(:empty) {
 position: fixed;
 inset: 0;
 z-index: 7000;
}
#notice-modal-root:empty { display: none; }
#notice-modal-root:not(:empty) {
 position: fixed;
 inset: 0;
 z-index: 7200;
 pointer-events: none;
}
.file-preview-overlay.notice-modal {
 position: fixed;
 inset: auto;
 left: var(--sidebar-width);
 right: 0;
 top: calc(var(--header-h) + var(--action-bar-h) + 1px + var(--list-row-h));
 bottom: 0;
 z-index: 7200;
 display: flex;
 align-items: flex-start;
 justify-content: center;
 padding: 0;
 pointer-events: auto;
}
.file-preview-overlay.notice-modal .file-preview-dialog {
 width: 520px;
 max-width: calc(100% - 24px);
 min-width: 0;
 max-height: calc(100% - 12px);
}
.file-preview-overlay.notice-modal .file-preview-title {
 white-space: normal;
 overflow: visible;
 text-overflow: unset;
 overflow-wrap: anywhere;
 word-break: break-word;
}
.notice-modal-meta {
 padding: 8px 14px 0;
 font-size: 12px;
 color: var(--muted);
 flex-shrink: 0;
 overflow-wrap: anywhere;
 word-break: break-word;
}
.notice-modal-body {
 padding: 12px 14px 18px;
 overflow: auto;
 color: var(--text);
 line-height: 1.55;
 white-space: normal;
 overflow-wrap: anywhere;
 word-break: break-word;
 flex: 1;
 min-width: 0;
 min-height: 0;
}
.file-preview-overlay {
 position: fixed;
 inset: 0;
 z-index: 7000;
 display: flex;
 align-items: center;
 justify-content: center;
 background: rgba(0, 0, 0, 0.55);
 padding: 12px;
 backdrop-filter: blur(4px);
}
.file-preview-dialog {
 width: min(96vw, 920px);
 max-height: min(92vh, 900px);
 background: var(--panel);
 border: 1px solid var(--line);
 border-radius: 12px;
 overflow: hidden;
 display: flex;
 flex-direction: column;
 box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.file-preview-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 padding: 10px 14px;
 border-bottom: 1px solid var(--line);
 background: var(--head-bg);
 flex-shrink: 0;
}
.file-preview-title {
 flex: 1;
 min-width: 0;
 font-size: 13px;
 font-weight: 700;
 color: var(--text);
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}
.file-preview-actions {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 flex-shrink: 0;
}
.file-preview-action-group {
 display: inline-grid;
 grid-auto-flow: column;
 grid-auto-columns: 1fr;
 gap: 6px;
 align-items: center;
}
.file-preview-action-group .file-preview-action {
 width: 100%;
}
.file-preview-actions .file-preview-action,
.file-preview-actions .file-action-download {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 6px;
 height: 34px;
 min-width: 34px;
 padding: 0 10px;
 border-radius: 8px;
 border: 1px solid var(--line);
 background: var(--panel);
 color: var(--text);
 font-size: 12px;
 font-weight: 700;
 font-family: inherit;
 text-decoration: none;
 cursor: pointer;
 white-space: nowrap;
}
.file-preview-actions .file-preview-print {
 background: #0369a1;
 border-color: #0284c7;
 color: #fff;
}
.file-preview-actions .file-preview-close {
 width: 40px;
 min-width: 40px;
 height: 40px;
 padding: 0;
 font-size: 20px;
 color: #ef4444;
 border-color: #fecaca;
 background: var(--panel);
}
.file-preview-body {
 flex: 1;
 min-height: 0;
 overflow: hidden;
 display: flex;
 align-items: center;
 justify-content: center;
 background: var(--sidebar-bg);
 padding: 8px;
}
.file-preview-body img {
 max-width: 100%;
 max-height: min(78vh, 820px);
 object-fit: contain;
 display: block;
}
.file-preview-body iframe {
 width: 100%;
 height: min(78vh, 820px);
 border: none;
 background: var(--panel);
}
#register-modal-root:empty { display: none; }
#register-modal-root:not(:empty) { position: relative; z-index: 5100; }

/* 좁은 화면에서는 왼쪽 차림표를 줄여 본문에 자리를 내준다.
   이 조건줄이 사라진 탓에 190px 이 모든 화면에 걸려 있었다. */
@media (max-width: 1024px) {
 :root { --sidebar-width: 190px; }
}

@media (max-width: 768px) {
 .site-sidebar {
 position: fixed;
 left: 0;
 top: var(--header-h);
 bottom: 0;
 transform: translateX(-105%);
 transition: transform 0.2s ease;
 box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
 }
 .file-preview-overlay.notice-modal {
 left: 0;
 }
}

#app-dialog-root:empty { display: none; }
.app-dialog-overlay {
 position: fixed;
 inset: 0;
 z-index: 8000;
 display: flex;
 align-items: center;
 justify-content: center;
 background: rgba(15, 42, 74, 0.45);
 padding: 20px;
 font-family: "Noto Sans KR", sans-serif;
}
.app-dialog {
 width: min(92vw, 300px);
 background: var(--panel);
 color: var(--text);
 border: 1px solid var(--line);
 border-radius: 12px;
 padding: 22px 20px 16px;
 box-shadow: var(--shadow);
 font-family: "Noto Sans KR", sans-serif;
}
.app-dialog-body {
 margin: 0 0 18px;
 padding: 0;
 font-size: 15px;
 font-weight: 500;
 line-height: 1.65;
 text-align: center;
 word-break: keep-all;
 overflow-wrap: anywhere;
}
.app-dialog-actions {
 display: grid;
 grid-auto-flow: column;
 grid-auto-columns: 1fr;
 gap: 8px;
}
.app-dialog-actions .btn-toolbar {
 width: 100%;
 height: 36px;
 justify-content: center;
 font-family: "Noto Sans KR", sans-serif;
}

/* ===== login (app.gongbok.com /home) ===== */
.app-footer {
 height: 28px;
 padding: 0 16px;
 display: flex;
 align-items: center;
 justify-content: flex-end;
 background: var(--footer-bg);
 color: var(--text-secondary);
 font-size: 11px;
 border-top: 1px solid var(--card-border);
 flex-shrink: 0;
}
.home-blank-workspace { flex: 1; }
.login-modal-overlay {
 position: fixed;
 inset: 0;
 background: rgba(0,0,0,0.55);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: 2000;
}
body:has(.login-modal-overlay) .side-panel {
 position: fixed;
 top: var(--header-h);
 right: 0;
 bottom: 0;
 height: auto;
 z-index: 40;
 pointer-events: none;
}
body:has(.login-modal-overlay) .side-panel.open {
 z-index: 2500;
 pointer-events: auto;
}
.login-modal-card {
 width: 100%;
 max-width: 380px;
 background: var(--panel-bg, #1f232d);
 border: 1px solid var(--card-border, #2e3444);
 border-radius: 12px;
 padding: 24px;
 box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.login-modal-card input[readonly] {
 opacity: 0.92;
 cursor: default;
 background: color-mix(in srgb, var(--panel-bg,#1f232d) 88%, #0ea5e9);
}
.panel-field { display: flex; flex-direction: column; gap: 4px; font-family: inherit; }
.panel-field label {
 font-size: 12px;
 font-weight: normal;
 color: var(--text-secondary);
 font-family: var(--font-family-field-label, HANDotumB, sans-serif);
}
.panel-field input:not([type="checkbox"]):not([type="radio"]) {
 width: 100%;
 box-sizing: border-box;
 padding: 8px 10px;
 border-radius: 8px;
 border: 1px solid var(--card-border);
 background: var(--input-bg);
 color: var(--text-primary);
 font: inherit;
}
.ios-sheet-overlay {
 position: fixed; inset: 0; z-index: 4500;
 display: flex; align-items: flex-end; justify-content: center;
 background: color-mix(in srgb, #000 48%, transparent);
 backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px);
 padding: 0;
}
.ios-sheet {
 width: 100%; max-width: 430px; max-height: min(92vh, 780px);
 background: var(--body-bg); color: var(--text-primary);
 border: 1px solid var(--card-border);
 border-radius: 16px 16px 0 0;
 box-shadow: 0 -8px 40px rgba(0,0,0,0.35);
 overflow: hidden; display: flex; flex-direction: column;
}
@media (min-width: 520px) {
 .ios-sheet-overlay { align-items: center; padding: 24px; }
 .ios-sheet { border-radius: 18px; max-height: min(88vh, 720px); }
}
.ios-sheet-nav {
 display: grid; grid-template-columns: 72px 1fr 72px; align-items: center;
 padding: 12px 14px 10px; background: var(--table-head-bg);
 border-bottom: 1px solid var(--card-border);
}
.ios-sheet-title { text-align: center; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.ios-nav-btn {
 border: none; background: transparent; color: var(--accent-blue); font-size: 15px;
 font-weight: 500; cursor: pointer; padding: 6px 0; font-family: inherit;
}
.ios-nav-btn.ios-nav-primary { font-weight: 700; text-align: right; color: var(--btn-green); }
.ios-nav-btn:first-child { text-align: left; color: var(--text-secondary); }
.ios-sheet-scroll { overflow-y: auto; padding: 8px 16px 28px; background: var(--body-bg); }
.ios-section-hint {
 margin: 18px 4px 7px; font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.ios-group {
 background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden;
}
.ios-row {
 display: flex; align-items: center; gap: 10px;
 min-height: 44px; padding: 8px 14px;
 border-bottom: 1px solid var(--card-border); background: var(--card-bg);
}
.ios-row:last-child { border-bottom: none; }
.ios-row label { flex: 0 0 88px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.ios-row input[type="email"],
.ios-row input[type="password"],
.ios-row input[type="text"],
.ios-row input[type="tel"],
.ios-row input[type="date"] {
 flex: 1; min-width: 0; border: none; outline: none;
 background: transparent !important;
 font-size: 15px; color: var(--text-primary); font-family: inherit; padding: 6px 0;
}
.ios-req { color: var(--btn-red); font-weight: 700; }
.ios-agree {
 display: flex; align-items: flex-start; gap: 10px;
 margin-top: 16px; padding: 12px 14px;
 background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px;
}
.ios-agree input[type="checkbox"] {
 width: 18px; height: 18px; min-width: 18px; margin: 1px 0 0;
}
.ios-agree label {
 font-size: 13px; line-height: 1.45; color: var(--text-primary); cursor: pointer; font-weight: 500;
}
.ios-footer-note { margin: 14px 4px 0; font-size: 11px; line-height: 1.45; color: var(--text-secondary); }
.email-settings {
 padding: 16px 18px;
 overflow: auto;
}
.email-settings-title {
 margin: 0 0 8px;
 font-size: 16px;
 font-weight: 700;
}
.email-check {
 display: flex;
 align-items: center;
 gap: 8px;
 font-size: 13px;
 min-height: 32px;
}
.email-check input {
 width: auto;
}
.email-settings-actions {
 margin-top: 8px;
}

.form-section-title {
 margin: 14px 0 8px;
 padding: 6px 0;
 border-bottom: 2px solid var(--line);
 font-weight: 800;
 font-size: 13px;
 color: var(--text);
}
.checklist-group {
 display: flex;
 flex-wrap: wrap;
 gap: 8px 14px;
 align-items: flex-start;
}
.checklist-group label {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 font-size: 12px;
 font-weight: 600;
 color: var(--text);
 cursor: pointer;
 line-height: 1.45;
 max-width: 100%;
 white-space: nowrap;
 word-break: keep-all;
}
.checklist-group label span { flex: 0 1 auto; min-width: 0; }
.checklist-group.checklist-cols-3 {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 8px 10px;
 padding: 0;
}
.checklist-group.checklist-cols-3 label {
 min-width: 0;
 white-space: nowrap;
}
.checklist-group .checklist-span-2,
.checklist-group .cert-qm { grid-column: 1 / -1; }
.cert-qm {
 border: 1px solid var(--card-border);
 border-radius: 8px;
 padding: 8px;
}
.cert-qm-title { font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.cert-qm-subs {
 display: flex;
 flex-wrap: wrap;
 gap: 6px 12px;
}
.cert-qm-subs label {
 white-space: nowrap;
 align-items: center;
 font-size: 12px;
 font-weight: 600;
}
.checklist-empty { opacity: 0.7; }

.form-notice-warn {
 margin: 0 0 10px;
 padding: 8px 10px;
 border-radius: 8px;
 background: color-mix(in srgb, #fbbf24 14%, transparent);
 color: #b45309;
 font-size: 12px;
 font-weight: 700;
}
.mat-cert-grid {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 10px 12px;
}
.mat-cert-box {
 border: 1px solid var(--line);
 border-radius: 8px;
 padding: 8px;
 min-width: 0;
}
.mat-cert-check {
 display: flex;
 gap: 6px;
 align-items: center;
 font-weight: 700;
 font-size: 12px;
 margin-bottom: 6px;
}
.mat-cert-box input[type="text"] {
 width: 100%;
 font-size: 12px;
}
.mat-cert-readonly {
 font-size: 12px;
 font-weight: 600;
}
.mat-cert-empty { opacity: 0.7; grid-column: 1 / -1; }
.mat-cert-grid .cert-qm { grid-column: 1 / -1; }

/* 실행관리 등: 계정구분 그룹 소계 — 1px 대비 테두리 */
.data-grid tbody tr.grid-row-subtotal {
	cursor: default;
}
.data-grid tbody tr.grid-row-subtotal td {
	font-weight: 600;
	border-top: 1px solid var(--text, #111);
	border-bottom: 1px solid var(--text, #111);
}
.data-grid tbody tr.grid-row-subtotal td:first-child {
	border-left: 1px solid var(--text, #111);
}
.data-grid tbody tr.grid-row-subtotal td:last-child {
	border-right: 1px solid var(--text, #111);
}
.data-grid tbody tr.grid-row-subtotal td.cell-num {
	text-align: right;
	text-overflow: clip;
	overflow: visible;
}
html[data-theme="dark"] .data-grid tbody tr.grid-row-subtotal td,
html[data-theme="dark"] .data-grid tbody tr.grid-row-subtotal td:first-child,
html[data-theme="dark"] .data-grid tbody tr.grid-row-subtotal td:last-child {
	border-color: var(--text, #f3f4f6);
}
/* 전체 합계(tfoot)도 동일하게 테마 대비 1px */
.data-grid tfoot td {
	border-top: 1px solid var(--text, #111) !important;
	border-bottom: 1px solid var(--text, #111);
}
.data-grid tfoot td:first-child {
	border-left: 1px solid var(--text, #111);
}
.data-grid tfoot td:last-child {
	border-right: 1px solid var(--text, #111);
}
html[data-theme="dark"] .data-grid tfoot td,
html[data-theme="dark"] .data-grid tfoot td:first-child,
html[data-theme="dark"] .data-grid tfoot td:last-child {
	border-color: var(--text, #f3f4f6);
}

/* emslist: balanced columns like execpayment + sky totals */
.data-grid.emslist-grid {
	table-layout: fixed;
	width: 100%;
}
.data-grid.emslist-grid th:nth-child(1),
.data-grid.emslist-grid td:nth-child(1) { width: 14%; }
.data-grid.emslist-grid th:nth-child(2),
.data-grid.emslist-grid td:nth-child(2) { width: 16%; }
.data-grid.emslist-grid th:nth-child(3),
.data-grid.emslist-grid td:nth-child(3),
.data-grid.emslist-grid th:nth-child(4),
.data-grid.emslist-grid td:nth-child(4),
.data-grid.emslist-grid th:nth-child(5),
.data-grid.emslist-grid td:nth-child(5) {
	width: 12% !important;
	min-width: 0 !important;
	max-width: none !important;
}
.data-grid.emslist-grid th:nth-child(6),
.data-grid.emslist-grid td:nth-child(6) { width: 34%; }
.data-grid.emslist-grid td.emslist-no-ellipsis,
.data-grid.emslist-grid th:nth-child(1),
.data-grid.emslist-grid th:nth-child(2) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
/* qtr: 비고만 말줄임, 나머지 열 전체 표시 */
.data-grid.qtr-grid td:not(.col-remark),
.data-grid.qtr-grid th:not(.col-remark) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
/* wastelog: 숫자 열 전체 표시, 비고만 말줄임 */
.data-grid.wastelog-grid td:not(.col-remark),
.data-grid.wastelog-grid th:not(.col-remark) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
.data-grid.wastelog-grid td.col-remark {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	max-width: 0;
}
.data-grid.qtr-grid td.col-remark {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	max-width: 0;
}
.data-grid.emslist-grid td.emslist-remark {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}
.data-grid.emslist-grid tfoot td.cell-num-sky,
.data-grid.emslist-grid tbody tr.grid-row-subtotal td.cell-num-sky {
	color: #0ea5e9;
	font-weight: 700;
}
html[data-theme="dark"] .data-grid.emslist-grid tfoot td.cell-num-sky,
html[data-theme="dark"] .data-grid.emslist-grid tbody tr.grid-row-subtotal td.cell-num-sky,
html[data-theme="system"] .data-grid.emslist-grid tfoot td.cell-num-sky,
html[data-theme="system"] .data-grid.emslist-grid tbody tr.grid-row-subtotal td.cell-num-sky {
	color: #7dd3fc;
}

/* shmeexec: 비고만 말줄임, 나머지 열은 전부 표시 */
.data-grid.shmeexec-grid,
.data-grid.ishmeuexec-grid,
.data-grid.emfexec-grid,
.data-grid.qtcbexec-grid td,
.data-grid.ishmeuexec-grid td,
.data-grid.emfexec-grid td:not(.col-remark),
.data-grid.shmeexec-grid,
.data-grid.ishmeuexec-grid,
.data-grid.emfexec-grid,
.data-grid.qtcbexec-grid th,
.data-grid.ishmeuexec-grid th,
.data-grid.emfexec-grid th:not(.col-remark) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
.data-grid.shmeexec-grid,
.data-grid.ishmeuexec-grid,
.data-grid.emfexec-grid,
.data-grid.qtcbexec-grid td,
.data-grid.ishmeuexec-grid td,
.data-grid.emfexec-grid td.col-remark,
.data-grid.shmeexec-grid,
.data-grid.ishmeuexec-grid,
.data-grid.emfexec-grid,
.data-grid.qtcbexec-grid th,
.data-grid.ishmeuexec-grid th,
.data-grid.emfexec-grid th.col-remark {
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* execpayment: subtotal/total sky + no-ellipsis */
.data-grid.execpayment-grid {
	table-layout: fixed;
	width: 100%;
}
.data-grid.execpayment-grid td.exec-no-ellipsis,
.data-grid.execpayment-grid th:nth-child(1),
.data-grid.execpayment-grid th:nth-child(2) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
.data-grid.execpayment-grid tfoot td.cell-num-sky,
.data-grid.execpayment-grid tbody tr.grid-row-subtotal td.cell-num-sky {
	color: #0ea5e9;
	font-weight: 700;
}
html[data-theme="dark"] .data-grid.execpayment-grid tfoot td.cell-num-sky,
html[data-theme="dark"] .data-grid.execpayment-grid tbody tr.grid-row-subtotal td.cell-num-sky,
html[data-theme="system"] .data-grid.execpayment-grid tfoot td.cell-num-sky,
html[data-theme="system"] .data-grid.execpayment-grid tbody tr.grid-row-subtotal td.cell-num-sky {
	color: #7dd3fc;
}

.data-grid tbody tr.grid-row-readonly { cursor: default; }
.data-grid tbody tr.grid-row-readonly:hover { background: inherit; }
.data-grid tbody tr.grid-row-readonly:nth-child(even):hover { background: var(--grid-stripe); }

/* 첨부 필드 (시트 폼 기준)
   필드명은 왼쪽, [파일선택] 은 입력 칸 오른쪽 끝에 맞춘다.
   그 아래 파일 목록을 입력 칸처럼 테두리로 감싼다. 썸네일은 쓰지 않는다. */
.form-row-files > .form-cell {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-content: start;
	align-items: center;
	gap: 4px 8px;
	overflow: visible;
}
.form-row-files > .form-cell > label:not(.btn-file) {
	grid-column: 1;
	grid-row: 1;
	align-self: center;
	margin: 0;
}
.form-row-files .file-field-picker {
	grid-column: 3;
	grid-row: 1;
	margin: 0;
	justify-self: end;
	align-self: center;
}
/* 파일 목록 상자: 담긴 파일이 없어도 입력 칸처럼 자리를 지킨다.
   폭은 위 입력 칸과 같게(칸 전체) 잡힌다. */
.form-row-files .file-box {
	grid-column: 1 / -1;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 28px;
	margin: 0;
	padding: 2px 7px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--input-bg);
	overflow: visible;
}
.form-row-files .file-box .file-panel-editable,
.form-row-files .file-box .file-field-new {
	margin: 0;
	gap: 0;
	overflow: visible;
}
.form-row-files .file-box .file-keep-row { padding: 2px 0; }
.form-row-files .file-panel-editable,
.form-row-files .file-field-new {
	grid-column: 1 / -1;
	margin: 0;
}
/* 일반 필드명 label 규칙이 btn-file 에도 먹히지 않게 한다 */
.form-cell label.btn-file {
	display: inline-flex;
	font-weight: 600;
	margin-bottom: 0;
	color: var(--blue);
}
.btn-file {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 24px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--head-bg);
	color: var(--blue);
	font-size: 12px;
	line-height: 24px;
	white-space: nowrap;
	cursor: pointer;
	vertical-align: middle;
}
.btn-file:hover { background: rgba(46, 117, 181, 0.12); }
.btn-file input[type="file"] { display: none; }
.file-field-new {
 display: flex;
 flex-direction: column;
}
/* 아직 저장 전인 파일: 미리보기·다운로드가 없으므로 이름과 선택취소만 둔다 */
.file-keep-row-new .file-keep-name { color: var(--muted); }
/* 미리보기를 지원하지 않는 첨부: 자리는 지키되 눌리지 않는다 */
.file-panel-btn-off {
 cursor: default;
 opacity: 0.28;
 pointer-events: none;
}

/* 사이드판넬과 그리드 모두 좌우로 10px 씩 숨통을 틔운다.
   그리드는 칸이 아니라 양 끝 칸에만 여백을 더해, 줄 배경과 선은 끝까지 이어지게 둔다. */
.data-grid th:first-child,
.data-grid td:first-child {
	padding-left: calc(var(--list-row-pad-x) + 10px);
}
.data-grid th:last-child,
.data-grid td:last-child {
	padding-right: calc(var(--list-row-pad-x) + 10px);
}

/* 안내문구는 메일 설정 화면에만 남겨 두었다. */
html[data-theme="dark"] .side-panel .form-helper {
 color: #94a3b8;
}
html[data-theme="system"] .side-panel .form-helper {
 color: #94a3b8;
 }
.form-helper {
 font-size: 8px;
 font-weight: 500;
 color: var(--muted);
 margin-left: 4px;
}
.email-settings .form-helper {
 margin: 0 0 14px;
}

/* form-row-files 는 위 그리드 규칙을 쓴다. 예전 flex(파일선택을 아래로 미는) 규칙은 끈다. */
.form-row-files > .form-cell {
	display: grid;
	flex-direction: unset;
	overflow: visible;
}
.form-row-files .file-field-picker {
	margin-top: 0;
}
.form-row-files .sheet-file-input {
	display: none;
}

/* form-row-files: non-file cells keep normal label-above-input */
.form-row-files > .form-cell:not(:has(.file-box)) {
	display: flex;
	flex-direction: column;
	align-content: unset;
	align-items: stretch;
	gap: 0;
	grid-template-columns: unset;
}
.form-row-files > .form-cell:not(:has(.file-box)) > label:not(.btn-file) {
	display: flex;
	align-items: center;
	grid-column: unset;
	grid-row: unset;
	align-self: unset;
	min-height: 24px;
	margin: 0 0 4px;
}

/* 홈 · 현장현황 (statusall 시트 기준) */
.statusall {
	margin: 16px 0 8px;
	padding: 0 4px 12px;
}
.statusall-heading {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: var(--text);
}
.statusall-card {
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--panel);
	margin-bottom: 10px;
	overflow: hidden;
}
.statusall-title {
	padding: 8px 12px;
	font-weight: 700;
	font-size: 13px;
	border-bottom: 1px solid var(--line);
	background: var(--chrome);
}
.statusall-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 100px;
	row-gap: 12px;
	padding: 10px 12px 12px;
}
.statusall-schedule,
.statusall-money {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.statusall-row {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 64px;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.statusall-schedule .statusall-row:first-child,
.statusall-money .statusall-row:first-child {
	grid-template-columns: 64px minmax(0, 1fr);
}
.statusall-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--text);
	white-space: nowrap;
}
.statusall-track-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.statusall-date-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	min-height: 14px;
}
.statusall-date {
	font-size: 11px;
	line-height: 1.2;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.statusall-date-start { text-align: left; }
.statusall-date-end { text-align: right; margin-left: auto; }
.statusall-row-period {
	align-items: flex-start;
}
.statusall-row-period .statusall-label {
	padding-top: 16px;
}

.statusall-track {
	position: relative;
	height: 22px;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: #f3f5f8;
	overflow: hidden;
	min-width: 0;
}
.statusall-track-fill {
	position: absolute;
	left: 0; top: 0; bottom: 0;
	max-width: 100%;
}
.statusall-fill-period,
.statusall-fill-contract { background: #d9dde6; }
.statusall-fill-progress,
.statusall-fill-paid { background: #9dc3e6; }
.statusall-fill-budget { background: #ffe699; }
.statusall-fill-exec { background: #9fd3c7; }
.statusall-track-text {
	position: relative;
	z-index: 1;
	display: block;
	padding: 0 8px;
	font-size: 12px;
	line-height: 22px;
	white-space: nowrap;
}
.statusall-track-text-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.statusall-pct {
	font-size: 12px;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--text);
	white-space: nowrap;
}
@media (max-width: 900px) {
	.statusall-body { grid-template-columns: 1fr; }
}

.side-panel-form .form-rule {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0 14px;
}
.side-panel-form .form-cell:has(input.input-num) {
  overflow: visible;
}

.workday-monthbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 8px;
  height: 32px;
  background: var(--nav-bg);
  color: #fff;
  border-radius: 4px;
  flex-shrink: 0;
}
.workday-monthbar input[type="month"] {
  width: 132px;
  height: 26px;
  color: var(--navy);
  background: #fff;
}
.workday-month-label { font-weight: 700; color: #fff; white-space: nowrap; }
.workday-monthbar .btn-toolbar {
  color: #fff;
  background: transparent;
  border-color: rgba(255,255,255,.4);
}
.workday-grid th.col-num,
.workday-grid td.cell-num {
  text-align: right !important;
  text-overflow: clip !important;
  overflow: visible !important;
  white-space: nowrap;
}
.workday-grid input.workday-day {
  width: 2.5em;
  min-width: 2.5em;
  max-width: none;
  padding: 2px 4px;
  text-align: right !important;
  text-overflow: clip !important;
  overflow: visible !important;
}
.workday-grid input.workday-remark {
  width: 100%;
  min-width: 110px;
}
.workday-grid th.day-sun,
.workday-grid td.day-sun { color: #c45c5c; }
.workday-grid th.day-sat,
.workday-grid td.day-sat { color: #3b6ea8; }
.workday-grid tfoot td {
  font-weight: 700;
  background: var(--head-bg);
  pointer-events: none;
}
.workday-grid th.col-name,
.workday-grid td.col-name {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--head-bg);
}
.workday-grid tbody td.col-name { background: var(--bg, #fff); }

.workday-form-cal { margin-top: 2px; }
.workday-form-wdays,
.workday-form-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px 6px;
}
.workday-form-wdays { margin-bottom: 4px; }
.workday-form-wdays span {
	text-align: center;
	font-size: 11px;
	color: var(--muted);
}
.workday-form-wdays .day-sun,
.workday-form-day.day-sun label { color: #c0392b; }
.workday-form-wdays .day-sat,
.workday-form-day.day-sat label { color: #2980b9; }
.workday-form-day {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
}
.workday-form-day.is-pad { visibility: hidden; }
.workday-form-day label {
	text-align: center;
	font-size: 11px;
	line-height: 1.2;
	margin: 0;
}
.workday-form-day input.workday-day,
.workday-form-day input.input-num {
	width: 100%;
	min-width: 0;
	text-align: right;
	text-overflow: clip;
	overflow: visible;
	padding: 2px 4px;
}
.workday-grid th.col-num,
.workday-grid td.cell-num,
.workday-grid tfoot td.cell-num {
	text-align: right;
	text-overflow: clip;
	overflow: visible;
}
.workday-foot { font-weight: 600; pointer-events: none; }
.workday-form-day.is-off { opacity: 0.38; }
.workday-form-day.is-off input {
  pointer-events: none;
  background: #e8edf3;
}
.workday-monthbar .btn-toolbar:disabled {
  opacity: 0.35;
  cursor: default;
}

/* === wagelist-overrides start === */
/* wagelist: list+print only, pair stripe, fit width */
.wagelist-monthbar .workday-month-label {
  font-size: 13px;
  font-weight: 600;
}
.grid-list:has(.wagelist-grid) {
  overflow-x: hidden;
  border: none;
  box-shadow: none;
  outline: none;
}
.data-grid.wagelist-grid {
  --wage-dash: #2f6f9a;
  --wage-solid: #333;
  --wage-ink: #111;
  width: 100%;
  table-layout: fixed;
  font-size: 10px;
  color: var(--wage-ink);
  border-collapse: collapse;
  border: 1px solid var(--wage-solid);
  outline: none;
  box-shadow: none;
}
.data-grid.wagelist-grid th,
.data-grid.wagelist-grid td {
  font-size: 10px;
  color: var(--wage-ink);
  padding: 0 3px;
  height: calc(var(--list-row-h, 36px) - 12px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  border: none;
  border-left: 1px dotted var(--wage-dash);
  border-right: 1px dotted var(--wage-dash);
}
.data-grid.wagelist-grid .wagelist-col-check { width: 2.2%; }
.data-grid.wagelist-grid .wagelist-col-job { width: 5%; }
.data-grid.wagelist-grid .wagelist-col-name { width: 5%; }
.data-grid.wagelist-grid .wagelist-col-id { width: 9.2%; }
.data-grid.wagelist-grid .wagelist-col-day { width: 2.1%; }
.data-grid.wagelist-grid .wagelist-col-man { width: 3.2%; }
.data-grid.wagelist-grid .wagelist-col-n { width: 2.6%; }
.data-grid.wagelist-grid .wagelist-col-rate { width: 4.4%; }
.data-grid.wagelist-grid .wagelist-col-pay { width: 5.4%; }
.data-grid.wagelist-grid .wagelist-col-tax { width: 4%; }
.data-grid.wagelist-grid .wagelist-col-ins { width: 4%; }
.data-grid.wagelist-grid .wagelist-col-deduct { width: 5%; }
.data-grid.wagelist-grid .wagelist-col-net { width: 5.2%; }
.data-grid.wagelist-grid .wagelist-col-stamp { width: 2.6%; }

.data-grid.wagelist-grid thead th {
  font-size: 9px;
  font-weight: 700;
  color: #111;
  padding: 0 2px;
  text-align: center !important;
  background: #fff2cc;
  z-index: 5;
  border-left: 1px dotted var(--wage-dash) !important;
  border-right: 1px dotted var(--wage-dash) !important;
  border-top: none !important;
  border-bottom: none !important;
}
.data-grid.wagelist-grid thead tr:last-child th,
.data-grid.wagelist-grid thead tr:first-child th[rowspan] {
  border-bottom: 1px solid var(--wage-solid) !important;
}
.data-grid.wagelist-grid thead th.wagelist-split {
  border-bottom: 1px dotted var(--wage-dash) !important;
}
.data-grid.wagelist-grid th.wagelist-dayh,
.data-grid.wagelist-grid td.wagelist-day {
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-overflow: clip !important;
  overflow: visible !important;
  font-size: 9px;
}
.data-grid.wagelist-grid td.wagelist-day {
  text-align: right !important;
}
.data-grid.wagelist-grid thead th.wagelist-dayh {
  text-align: center !important;
}
.data-grid.wagelist-grid td.wagelist-day.is-off {
  color: transparent;
  background: transparent;
}
.data-grid.wagelist-grid tbody tr.wagelist-r1 > td.wagelist-split:not(.cell-num) {
  font-size: 9px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.data-grid.wagelist-grid td.wagelist-addr {
  font-size: 8px;
  line-height: 1.2;
  height: auto;
  min-height: calc(var(--list-row-h, 36px) - 12px);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.data-grid.wagelist-grid tbody tr { cursor: default; }
.data-grid.wagelist-grid tbody tr:nth-child(even) { background: transparent; }
.data-grid.wagelist-grid tbody tr:nth-child(4n+1),
.data-grid.wagelist-grid tbody tr:nth-child(4n+2) { background: #eef2f6; }
.data-grid.wagelist-grid tbody tr:nth-child(4n+3),
.data-grid.wagelist-grid tbody tr:nth-child(4n+4) { background: #fff; }
.data-grid.wagelist-grid tbody tr:nth-child(4n+1):hover,
.data-grid.wagelist-grid tbody tr:nth-child(4n+2):hover { background: #eef2f6; }
.data-grid.wagelist-grid tbody tr:nth-child(4n+3):hover,
.data-grid.wagelist-grid tbody tr:nth-child(4n+4):hover { background: #fff; }
.data-grid.wagelist-grid tbody tr.wagelist-r1 td {
  border-top: none;
}
.data-grid.wagelist-grid tbody tr.wagelist-r1 td[rowspan],
.data-grid.wagelist-grid tbody tr.wagelist-r2 td {
  border-bottom: 1px solid var(--wage-solid) !important;
}
.data-grid.wagelist-grid tbody td.wagelist-split {
  border-bottom: 1px dotted var(--wage-dash) !important;
}
.data-grid.wagelist-grid .wagelist-vmid {
  vertical-align: middle;
}
.data-grid.wagelist-grid thead > tr:first-child > th:first-child,
.data-grid.wagelist-grid tbody > tr.wagelist-r1 > td:first-child,
.data-grid.wagelist-grid tfoot > tr:first-child > td:first-child {
  border-left: none !important;
}
.data-grid.wagelist-grid thead > tr:first-child > th:last-child,
.data-grid.wagelist-grid tbody > tr.wagelist-r1 > td:last-child,
.data-grid.wagelist-grid tfoot > tr:first-child > td:last-child {
  border-right: none !important;
}

.data-grid.wagelist-grid tfoot {
  position: sticky;
  bottom: 0;
  z-index: 4;
}
.data-grid.wagelist-grid tfoot td {
  position: relative;
  background: #fff2cc;
  color: #111;
  pointer-events: none;
  font-weight: 700;
  overflow: visible;
  border-top: none !important;
  border-bottom: none !important;
  border-left: 1px dotted var(--wage-dash) !important;
  border-right: 1px dotted var(--wage-dash) !important;
  box-shadow: none !important;
}
.data-grid.wagelist-grid tfoot tr:first-child td {
  border-top: 1px solid var(--wage-solid) !important;
}
.data-grid.wagelist-grid tfoot tr:first-child td:not([rowspan]) {
  border-bottom: 1px dotted var(--wage-dash) !important;
}
.data-grid.wagelist-grid tfoot tr:first-child td.wagelist-day,
.data-grid.wagelist-grid tfoot tr:first-child td.wagelist-split {
  border-bottom: 1px dotted var(--wage-dash) !important;
}
.data-grid.wagelist-grid tfoot tr:last-child td.wagelist-day,
.data-grid.wagelist-grid tfoot tr:last-child td.cell-num:not([rowspan]) {
  border-top: 1px dotted var(--wage-dash) !important;
}
.data-grid.wagelist-grid tfoot tr:first-child td[rowspan],
.data-grid.wagelist-grid tfoot tr:last-child td {
  border-bottom: none !important;
}
.data-grid.wagelist-grid .wagelist-net {
  color: #153a8a;
  font-weight: 700;
}
.data-grid.wagelist-grid .wagelist-deduct {
  color: #c62828;
  font-weight: 700;
}

/* dark / system-dark: light ink on paper stripes made text disappear */
html[data-theme="dark"] .data-grid.wagelist-grid {
  --wage-dash: #7aa4c4;
  --wage-solid: #94a3b8;
  --wage-ink: #e8eef4;
  color: var(--wage-ink);
}
html[data-theme="dark"] .data-grid.wagelist-grid th,
html[data-theme="dark"] .data-grid.wagelist-grid td {
  color: var(--wage-ink);
}
html[data-theme="dark"] .data-grid.wagelist-grid thead th {
  background: #3f4a2a;
  color: #f4f1c8;
}
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(even) {
  background: transparent;
}
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+1),
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+2),
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+1):hover,
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+2):hover {
  background: #243044;
}
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+3),
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+4),
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+3):hover,
html[data-theme="dark"] .data-grid.wagelist-grid tbody tr:nth-child(4n+4):hover {
  background: #1a2333;
}
html[data-theme="dark"] .data-grid.wagelist-grid tfoot td {
  background: #3f4a2a;
  color: #f4f1c8;
}
html[data-theme="dark"] .data-grid.wagelist-grid .wagelist-net {
  color: #93c5fd;
}
html[data-theme="dark"] .data-grid.wagelist-grid .wagelist-deduct {
  color: #f87171;
}
html[data-theme="dark"] .data-grid.wagelist-grid td.wagelist-day.is-off {
  color: transparent;
  background: transparent;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .data-grid.wagelist-grid {
    --wage-dash: #7aa4c4;
    --wage-solid: #94a3b8;
    --wage-ink: #e8eef4;
    color: var(--wage-ink);
  }
  html[data-theme="system"] .data-grid.wagelist-grid th,
  html[data-theme="system"] .data-grid.wagelist-grid td {
    color: var(--wage-ink);
  }
  html[data-theme="system"] .data-grid.wagelist-grid thead th {
    background: #3f4a2a;
    color: #f4f1c8;
  }
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(even) {
    background: transparent;
  }
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+1),
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+2),
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+1):hover,
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+2):hover {
    background: #243044;
  }
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+3),
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+4),
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+3):hover,
  html[data-theme="system"] .data-grid.wagelist-grid tbody tr:nth-child(4n+4):hover {
    background: #1a2333;
  }
  html[data-theme="system"] .data-grid.wagelist-grid tfoot td {
    background: #3f4a2a;
    color: #f4f1c8;
  }
  html[data-theme="system"] .data-grid.wagelist-grid .wagelist-net {
    color: #93c5fd;
  }
  html[data-theme="system"] .data-grid.wagelist-grid .wagelist-deduct {
    color: #f87171;
  }
  html[data-theme="system"] .data-grid.wagelist-grid td.wagelist-day.is-off {
    color: transparent;
    background: transparent;
  }
}
/* === wagelist-overrides end === */
.form-row-files .file-box.tbm-attend-box {
 flex-direction: row;
 align-items: center;
 gap: 8px;
 overflow: visible;
}
.tbm-attend-box .file-panel-editable {
 flex: 1 1 auto;
 min-width: 0;
 margin: 0;
}
.form-cell .tbm-attend-box input.input-num:not([type="checkbox"]):not([type="radio"]) {
 flex: 0 0 4.5em;
 width: 4.5em;
 min-width: 4.5em;
 max-width: 4.5em;
 margin: 0;
 padding: 0 2px;
 border: 0;
 background: transparent;
}
.tbm-attend-modal {
 display: flex;
 flex-direction: column;
 background: var(--panel);
 color: var(--text);
 border-right: 1px solid var(--line);
 box-shadow: -8px 0 24px rgba(15, 42, 74, 0.12);
 overflow: hidden;
}
.tbm-attend-modal[hidden] { display: none !important; }
.tbm-attend-modal-head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 padding: 10px 14px;
 border-bottom: 1px solid var(--line);
 flex: 0 0 auto;
 font-size: 13px;
 font-weight: 700;
}
.tbm-attend-modal-body {
 flex: 1 1 auto;
 min-height: 0;
 overflow: auto;
}
.tbm-attend-modal .data-grid {
 margin: 0;
}
.tbm-attend-modal .data-grid td.col-check,
.tbm-attend-modal .data-grid th.col-check {
 overflow: visible;
 text-overflow: clip;
}

/* 공종현황 사이드: 입력칸 세로 중앙 */
.form-workstatus .form-row {
  align-items: center;
}
.form-workstatus .form-cell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-workstatus .form-cell select {
  height: 32px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 30px;
}
.form-workstatus .form-cell textarea.form-ta-1l {
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 30px;
}
.form-workstatus .fk-select-wrap {
  align-items: center;
}


/* pinned foot shell (세금계산서 / 도급·현장·외주기성) */
.grid-list:has(.grid-pin-shell) {
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: 0;
}
.grid-pin-shell {
	flex: 1;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.grid-pin-scroll {
	flex: 1;
	min-height: 0;
	overflow: auto;
	position: relative;
	-webkit-overflow-scrolling: touch;
}
.grid-pin-foot {
	flex: 0 0 auto;
	border-top: 1px solid var(--text, #111);
}
.grid-pin-scroll .data-grid thead th {
	position: sticky;
	top: 0;
	z-index: 6;
	background: var(--head-bg);
	box-shadow: 0 1px 0 var(--line);
}

/* taxlist: quarter in grid header + foot pinned to work-area bottom
   (sticky alone stays under data when rows are few — split scroll/foot like a pinned panel) */
.grid-list:has(.taxlist-shell) {
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: 0;
}
.taxlist-shell {
	flex: 1;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.taxlist-scroll {
	flex: 1;
	min-height: 0;
	overflow: auto;
	position: relative;
	-webkit-overflow-scrolling: touch;
}
.taxlist-foot {
	flex: 0 0 auto;
	border-top: 1px solid var(--text, #111);
}
.data-grid.taxlist-grid {
	--taxlist-row-h: 32px;
	table-layout: fixed;
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
}
.data-grid.taxlist-grid th,
.data-grid.taxlist-grid td {
	height: var(--taxlist-row-h);
	min-height: var(--taxlist-row-h);
	max-height: var(--taxlist-row-h);
	box-sizing: border-box;
}
/* 비고만 말줄임, 나머지 열은 말줄임/가리기 금지 */
.data-grid.taxlist-grid td:not(.taxlist-col-remark),
.data-grid.taxlist-grid th:not(.taxlist-col-remark) {
	text-overflow: clip !important;
	overflow: visible !important;
	white-space: nowrap !important;
	max-width: none !important;
}
.data-grid.taxlist-grid td.taxlist-col-remark,
.data-grid.taxlist-grid th.taxlist-col-remark {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}
.data-grid.taxlist-grid th.taxlist-qcol,
.data-grid.taxlist-grid td.taxlist-qcol { width: 96px; padding-left: 6px; padding-right: 6px; }
.data-grid.taxlist-grid .taxlist-col-io { width: 72px; }
.data-grid.taxlist-grid .taxlist-col-site { width: 120px; }
.data-grid.taxlist-grid .taxlist-col-acc { width: 120px; }
.data-grid.taxlist-grid .taxlist-col-partner { width: 120px; }
.data-grid.taxlist-grid .taxlist-col-payto { width: 100px; }
.data-grid.taxlist-grid .taxlist-col-paydate { width: 100px; }
.data-grid.taxlist-grid .taxlist-col-amt { width: 110px; }
.data-grid.taxlist-grid th.taxlist-qcol select {
	display: block;
	width: 100%;
	height: 24px;
	padding: 0 4px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--panel);
	color: var(--text);
	font-size: 12px;
	font-weight: 600;
}
.data-grid.taxlist-grid thead th {
	position: sticky;
	top: 0;
	z-index: 6;
	background: var(--head-bg);
	box-shadow: 0 1px 0 var(--line);
}
.taxlist-foot td {
	background: var(--head-bg) !important;
	font-weight: 700;
	cursor: default;
}
.taxlist-foot td.cell-num-sky {
	color: #0ea5e9 !important;
	font-weight: 700;
}
html[data-theme="dark"] .taxlist-foot td.cell-num-sky,
html[data-theme="system"] .taxlist-foot td.cell-num-sky {
	color: #7dd3fc !important;
}
