/* 덕성LNC MES — 레이아웃 레이어(셸 shell-* · 대시보드 ds-* 등)
   ─────────────────────────────────────────────────────────────
   app.css 뒤에 얹는 레이어. app.css 가 이미 토큰(--accent, --border …)으로
   짜여 있어서, 토큰을 덮는 것만으로 93개 화면이 한 번에 새 톤으로 바뀐다.
   그 위에 새 셸(좌측 레일)·새 컴포넌트 문법을 추가한다.

   원칙
   1. 따뜻한 중립색 위에 흙빛 강조 하나. 색으로 떠들지 않는다.
   2. 그림자 대신 1px 경계선. 그림자는 떠 있는 것(모달·드롭다운)에만.
   3. 숫자가 주인공 — 표·금액은 고정폭 숫자, 큰 글씨는 자간을 조인다.
   4. 360px 에서 가로 스크롤 0 (§11.1).
   ───────────────────────────────────────────────────────────── */

:root {
    /* ── 강조: 흙빛 클레이 ── */
    --accent: #0e9f6e;
    --accent-hover: #0b8459;
    --accent-active: #086a48;
    --accent-soft: #e7f7f0;
    --accent-ring: rgba(14, 159, 110, .20);

    /* ── 표면: 따뜻한 아이보리 ── */
    --body-bg: #f7faf8;
    --card-bg: #ffffff;
    --surface-2: #f3f7f5;
    --surface-3: #ebf1ee;

    /* ── 잉크 ── */
    --text-main: #12201a;
    /* v3 — 회색 글자는 모두 검은색으로 (2026-10-19 사용자 지시: 회색이라 잘 안 보인다) */
    --text: var(--text-main);
    --text-muted: var(--text-main);
    --text-faint: var(--text-main);
    --bs-secondary-color: var(--text-main);
    --bs-tertiary-color: var(--text-main);

    --border: #e2eae6;
    --border-strong: #cfdad5;

    /* ── 의미색 (채도를 낮춰 아이보리와 같은 온도로) ── */
    --green: #1f9d5c;  --green-soft: #e5f6ec;
    --red:   #d6403a;  --red-soft:   #fdeceb;
    --amber: #d07a00;  --amber-soft: #fff3dc;
    --blue:  #2f6fd6;  --blue-soft:  #e8f0fd;

    /* ── 레일(좌측 네비) ── */
    --rail-bg: #0f2a21;
    --rail-text: rgba(225, 245, 235, .62);
    --rail-text-strong: #f6f2ec;
    --rail-hover: rgba(255, 255, 255, .07);
    --rail-line: rgba(255, 255, 255, .08);
    --rail-w: 236px;

    /* ── 그림자: 떠 있는 것에만 ── */
    --shadow-sm: none;
    --shadow: none;
    --shadow-md: 0 4px 14px rgba(8, 28, 20, .08);
    --shadow-lg: 0 18px 44px rgba(8, 28, 20, .16);

    --radius: 12px;
    --radius-sm: 9px;
    --radius-xs: 7px;

    --nav-h: 56px;      /* 상단 바 — app.css 의 #topbar sticky 기준 */
    --topbar-h: 50px;
}

* { scrollbar-color: #cddad4 transparent; }
*::-webkit-scrollbar-thumb { background: #d6e2dc; }
*::-webkit-scrollbar-thumb:hover { background: #b3c4bb; }

body { letter-spacing: -.006em; }
::selection { background: var(--accent-soft); color: var(--accent-active); }

/* ══════════════════════ 셸 ══════════════════════ */

.shell-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    background: var(--rail-bg);
    display: flex;
    flex-direction: column;
    z-index: 1200;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.shell-rail::-webkit-scrollbar { width: 6px; }
.shell-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

.shell-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    height: var(--nav-h);
    flex-shrink: 0;
    padding: 0 18px;
    color: var(--rail-text-strong);
    text-decoration: none;
    border-bottom: 1px solid var(--rail-line);
}
.shell-brand:hover { color: var(--rail-text-strong); }
.shell-brand-mark {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: grid; place-items: center;
}
/* 마크(병 실루엣)는 세로가 긴 형태라 담는 사각의 66% 높이로 앉힌다 — 사각 어디에 써도 같은 여백. */
.ds-mark { height: 66%; width: auto; display: block; }
.shell-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
/* 버전은 숫자만 — 이름 뒤에 조용히 붙는다. */
.shell-brand-ver {
    font-size: 11px; font-weight: 500; line-height: 1;
    color: rgba(225, 245, 235, .42);
    font-variant-numeric: tabular-nums;
}

/* 공장 전환 — 레일 상단. "지금 어느 공장을 보고 있나"가 가장 중요한 맥락이다. */
.shell-factory { padding: 14px 12px; border-bottom: 1px solid var(--rail-line); }
.shell-factory-seg {
    display: flex;
    background: rgba(255,255,255,.06);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.shell-factory-seg a {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rail-text);
    text-decoration: none;
    white-space: nowrap;
    transition: background .14s, color .14s;
}
.shell-factory-seg a:hover { color: var(--rail-text-strong); background: var(--rail-hover); }
.shell-factory-seg a.active { background: var(--accent); color: #fff; }
.shell-factory-one {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.05);
    color: var(--rail-text-strong);
    font-size: 12.5px; font-weight: 600;
}

.shell-nav { padding: 12px 10px 18px; flex: 1; }
.shell-nav-group + .shell-nav-group { margin-top: 18px; }
.shell-nav-label {
    padding: 0 10px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: rgba(225, 245, 235, .34);
}
.shell-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    color: var(--rail-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    transition: background .14s, color .14s;
}
.shell-nav a i { font-size: 15px; width: 18px; text-align: center; opacity: .72; flex-shrink: 0; }
.shell-nav a:hover { background: var(--rail-hover); color: var(--rail-text-strong); }
.shell-nav a:hover i { opacity: 1; }
.shell-nav a.active {
    background: rgba(255,255,255,.10);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--accent);
}
.shell-nav a.active i { opacity: 1; color: var(--accent); }

.shell-rail-foot {
    border-top: 1px solid var(--rail-line);
    padding: 12px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--rail-bg);
}
.shell-user { display: flex; align-items: center; gap: 10px; }
.shell-avatar {
    width: 30px; height: 30px; flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    color: var(--rail-text-strong);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
}
.shell-user-meta { min-width: 0; flex: 1; }
.shell-user-name { font-size: 12.5px; font-weight: 600; color: var(--rail-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-user-role { font-size: 10.5px; color: rgba(225,245,235,.40); font-variant-numeric: tabular-nums; }
.shell-icon-btn {
    background: none; border: none; padding: 5px;
    color: rgba(225,245,235,.45);
    border-radius: 6px; cursor: pointer; font-size: 14px;
    text-decoration: none; line-height: 1;
    transition: background .14s, color .14s;
}
.shell-icon-btn:hover { background: var(--rail-hover); color: var(--rail-text-strong); }

/* ── 본문 기둥 ── */
.shell-main { margin-left: var(--rail-w); min-width: 0; }

.shell-top {
    position: sticky; top: 0; z-index: 900;
    height: var(--nav-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 22px;
    background: rgba(250, 249, 246, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.shell-burger { display: none; background: none; border: none; font-size: 21px; color: var(--text-main); padding: 4px 6px; cursor: pointer; }
.shell-crumb { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; min-width: 0; }
.shell-crumb b { color: var(--text-main); font-weight: 600; }
.shell-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 검색/이동 — Ctrl+K. 메뉴를 외우지 않아도 되게. */
.shell-search {
    display: flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 11px;
    min-width: 210px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--pill);
    color: var(--text-faint);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .14s, color .14s;
}
.shell-search:hover { border-color: var(--border-strong); color: var(--text-muted); }
.shell-kbd {
    margin-left: auto;
    font-size: 10.5px; font-weight: 600;
    padding: 2px 6px; border-radius: 5px;
    background: var(--surface-3); color: var(--text-faint);
    font-family: var(--font-sans);
}

.shell-scrim { display: none; }

/* ══════════════════════ 페이지 머리 ══════════════════════ */
#topbar {
    top: var(--nav-h);
    background: var(--body-bg);
    border-bottom: 1px solid var(--border);
    padding: 6px 22px;
    box-shadow: none;
    gap: 10px;
}
.topbar-title { font-size: 19px; font-weight: 700; letter-spacing: -.025em; color: var(--text-main); }
.topbar-help-btn {
    border-color: var(--border);
    background: var(--card-bg);
    border-radius: var(--pill);
    font-size: 12.5px;
}
.topbar-help-btn:hover { background: var(--accent-soft); }

#content { padding: 24px 22px 56px; }
#content:has(.ds-side-stack) { padding-top: 12px; } /* v3 오늘(평택·인천) — 카드를 제목줄 가까이 */
@media (min-width: 992px) { #content:has(.ds-side-stack) { padding-bottom: 12px; } } /* v3 오늘(평택·인천) — 출고 카드가 화면 아래 끝까지 */

/* ══════════════════════ 컴포넌트 ══════════════════════ */

.card {
    border-color: var(--border);
    border-radius: var(--radius);
}
.card-header {
    background: transparent;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--text-main);
}
.card-body { padding: 18px; }
.card-footer { background: var(--surface-2); }

.stat-card {
    padding: 18px;
    border-radius: var(--radius);
    transition: border-color .16s, background .16s;
}
.stat-card:hover { border-color: var(--border-strong); background: #fbfdfc; transform: none; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; font-size: 19px; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; }
.stat-label { font-size: 11.5px; color: var(--text-muted); letter-spacing: .01em; }

/* 표 — 줄무늬 없이 머리글은 얇게, 행 구분은 헤어라인으로. */
.table { font-size: 13px; }
.table thead th {
    background: transparent;
    border-bottom: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    padding: 9px 13px;
}
.table tbody td { padding: 11px 13px; border-color: var(--border); }
.table tbody tr:hover,
.table-hover > tbody > tr:hover > * { background: var(--surface-2); }

.badge-status {
    font-size: 11px; font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: .01em;
}

.btn { border-radius: var(--radius-xs); font-weight: 600; }
.btn-primary {
    background: var(--accent); border-color: var(--accent);
    box-shadow: none;
}
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline-primary { color: var(--accent); border-color: var(--border-strong); }
.btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary, .btn-outline-secondary {
    color: var(--text); background: var(--card-bg); border-color: var(--border-strong);
}
.btn-secondary:hover, .btn-outline-secondary:hover { background: var(--surface-2); color: var(--text-main); border-color: var(--text-faint); }

.form-control, .form-select, .filter-select {
    border-color: var(--border-strong);
    border-radius: var(--radius-xs);
    color: var(--text-main);
}
.form-control:focus, .form-select:focus, .filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .01em; }

.modal-content { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); background: var(--surface-2); }

.alert { border-radius: var(--radius-sm); border-width: 1px; font-size: 13px; }

/* KPI — 자금 화면. 금액은 크게, 라벨은 조용하게. */
.kpi-card { border-radius: var(--radius); border-color: var(--border); }
.kpi-value { letter-spacing: -.03em; }
.kpi-label { color: var(--text-muted); letter-spacing: .02em; }

/* ══════════════════════ 명령 팔레트 ══════════════════════ */
.shell-cmd-back {
    position: fixed; inset: 0; z-index: 2400;
    background: rgba(33, 31, 28, .34);
    backdrop-filter: blur(2px);
    display: flex; justify-content: center;
    padding: 12vh 16px 16px;
}
.shell-cmd {
    width: 100%; max-width: 520px;
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
    max-height: 68vh;
}
.shell-cmd input {
    border: 0; border-bottom: 1px solid var(--border);
    padding: 15px 18px;
    font-size: 15px; font-family: var(--font-sans);
    outline: none; width: 100%;
    color: var(--text-main);
}
.shell-cmd input::placeholder { color: var(--text-faint); }
.shell-cmd-list { overflow-y: auto; padding: 6px; }
.shell-cmd-list a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-xs);
    color: var(--text); text-decoration: none; font-size: 13.5px;
}
.shell-cmd-list a i { width: 17px; text-align: center; color: var(--text-faint); }
.shell-cmd-list a.on, .shell-cmd-list a:hover { background: var(--accent-soft); color: var(--accent-active); }
.shell-cmd-list a.on i, .shell-cmd-list a:hover i { color: var(--accent); }
.shell-cmd-list a span.g { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.shell-cmd-empty { padding: 22px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ══════════════════════ 모바일 ══════════════════════ */
@media (max-width: 768px) {
    /* app.css 는 옛 #topnav(position:fixed)용으로 body 에 상단 여백(--nav-h)을 준다.
       .shell-top 은 sticky 라 제 자리를 스스로 차지하므로 그 여백이 화면 맨 위에
       빈 띠로 남는다(폰에서 56px 공백). 여기서 걷어낸다 (2026-09-15). */
    body { padding-top: 0; }
}

@media (max-width: 991px) {
    .shell-rail {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    body.rail-open .shell-rail { transform: none; }
    body.rail-open { overflow: hidden; }
    .shell-scrim { display: block; position: fixed; inset: 0; z-index: 1100; background: rgba(33,31,28,.42); opacity: 0; pointer-events: none; transition: opacity .22s; }
    body.rail-open .shell-scrim { opacity: 1; pointer-events: auto; }

    .shell-main { margin-left: 0; }
    .shell-burger { display: block; }
    .shell-search { min-width: 0; width: 34px; padding: 0; justify-content: center; }
    .shell-search span, .shell-kbd { display: none; }
    .shell-top { padding: 0 12px; }
    #topbar { padding: 0 14px; }
    #content { padding: 16px 14px 72px; }
    .topbar-title { font-size: 17px; }
}
@media (max-width: 400px) {
    .shell-crumb { font-size: 11.5px; }
    #content { padding: 14px 12px 72px; }
}

/* ══════════════════════ 오늘(대시보드) ══════════════════════ */

@keyframes mnBlink { 0%,100%{opacity:1;} 50%{opacity:.15;} }
.mn-blink { animation: mnBlink 1s ease-in-out infinite; }

.ds-notice-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 11px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--pill);
    font-size: 12.5px; font-weight: 600; color: var(--text-muted);
    cursor: pointer; white-space: nowrap;
}
.ds-notice-btn:hover { border-color: var(--border-strong); color: var(--text-main); }
.ds-notice-btn.on { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }

/* ── 요약 줄 ── */
.ds-summary {
    display: flex; flex-wrap: wrap; align-items: stretch;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ds-sum-item {
    flex: 1 1 110px;
    min-width: 100px;
    padding: 14px 16px;
    border-right: 1px solid var(--border);
}
.ds-sum-item:last-child { border-right: 0; }
.ds-sum-item.wide { flex: 2 1 190px; }
.ds-sum-n {
    display: block;
    font-size: 24px; font-weight: 700; letter-spacing: -.035em;
    color: var(--text-main); line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.ds-sum-n em { font-style: normal; font-size: 13px; font-weight: 500; color: var(--text-faint); letter-spacing: 0; }
.ds-sum-l { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.ds-sum-item.warn .ds-sum-n { color: var(--amber); }
.ds-sum-item.bad .ds-sum-n { color: var(--red); }
.ds-sum-sep { display: none; }

/* ── 호출 줄 — 사람 손이 필요한 것만. 평소엔 이 줄 자체가 없다. ── */
.ds-calls {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 12px; padding: 11px 14px;
    background: var(--amber-soft);
    border: 1px solid rgba(162,103,15,.24);
    border-radius: var(--radius-sm);
}
.ds-calls-label { font-size: 11.5px; font-weight: 700; color: var(--amber); white-space: nowrap; }
.ds-call {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px; border-radius: var(--pill);
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    font-size: 12.5px; color: var(--text); text-decoration: none;
}
.ds-call b { font-weight: 700; color: var(--text-main); }
.ds-call.warn:hover { border-color: var(--amber); color: var(--amber); }
.ds-call.bad { border-color: rgba(176,58,46,.3); color: var(--red); }
.ds-call.bad b { color: var(--red); }
.ds-call.bad:hover { background: var(--red-soft); }

/* ── 기계 카드 ── */
.ds-machines {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
    /* 카드 높이를 줄에서 맞춘다 — 1·2·3호기가 들쭉날쭉하면 비교가 안 된다.
       (꺼진 기계는 내용이 적어 빈 아래가 생기지만, 나란한 편이 더 읽힌다.) */
    align-items: stretch;
    gap: 12px;
    margin-top: 0; /* v3 — 제목줄과 카드 사이 공간 제거 (2026-10-19 사용자 지시) */
}
.ds-mc {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column;
    min-width: 0;
}
.ds-mc.is-active { border-left-color: var(--green); }
.ds-mc.is-stopped { border-left-color: var(--amber); }
.ds-mc.is-unregistered { border-left-color: var(--red); }
.ds-mc.is-maintenance { border-left-color: #6f5f8c; }
/* 꺼져 있는 기계는 물러나 있어야 한다 — 볼 게 없다. */
.ds-mc.is-off, .ds-mc.is-idle { background: var(--surface-2); border-left-color: var(--border); }

.ds-mc-head {
    display: flex; align-items: center; gap: 6px;
    padding: 11px 13px 9px;
    border-bottom: 1px solid var(--border);
}
.ds-mc-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: var(--text-main); }
.ds-mc-tools { display: inline-flex; align-items: center; gap: 1px; }
.ds-tool {
    background: none; border: 0; padding: 3px 4px; line-height: 1;
    color: var(--text-faint); cursor: pointer; font-size: 14px; border-radius: 5px;
}
.ds-tool:hover { background: var(--surface-3); color: var(--text-main); }
.ds-tool.on { color: #6f5f8c; }
.ds-tool.is-alert { color: var(--amber); } /* .alert 는 부트스트랩 경고 상자와 겹쳐 여백이 커졌다 (v3) */

.ds-state {
    margin-left: auto; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 6px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--surface-3); color: var(--text-muted);
}
.ds-state i { font-size: 8px; }
.is-active .ds-state { background: var(--green-soft); color: var(--green); }
.is-stopped .ds-state { background: var(--amber-soft); color: var(--amber); }
.is-unregistered .ds-state { background: var(--red-soft); color: var(--red); }
.is-maintenance .ds-state { background: #efecf4; color: #6f5f8c; }

.ds-mc-qty { padding: 12px 13px 2px; display: flex; align-items: baseline; gap: 4px; }
.ds-mc-qty b {
    font-size: 30px; font-weight: 700; letter-spacing: -.04em; line-height: 1;
    color: var(--text-main); font-variant-numeric: tabular-nums;
}
.ds-mc-qty span { font-size: 12px; color: var(--text-muted); }

.ds-plan {
    margin: 10px 13px 0; padding: 8px 10px;
    background: var(--amber-soft); border-radius: var(--radius-xs);
    font-size: 12.5px; color: var(--text); line-height: 1.5;
}
.ds-plan-tag {
    display: inline-block; margin-right: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    color: var(--amber);
}
.ds-plan-memo { display: block; margin-top: 3px; font-size: 12px; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
/* 제품명 아래에 붙을 때는 카드 본문의 여백을 따른다(바깥 여백 중복 금지). */
.ds-mc-body .ds-plan { margin: 0; }
.ds-plan-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ds-plan-name { font-weight: 700; color: var(--text-main); }
.ds-plan-prev { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ds-plan-prev b { color: var(--text-main); font-weight: 700; }
.ds-plan-when { margin-left: auto; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* 계획 진행 막대 — 박스 진행과 같은 문법(숫자 왼쪽, % 오른쪽, 막대 아래). */
.ds-plan-prog { margin-top: 6px; }
.ds-plan-prog .ds-bar span { background: var(--amber); }

.ds-mc-body { padding: 10px 13px 12px; display: flex; flex-direction: column; gap: 11px; }

.ds-prod { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ds-prod-code { font-size: 19px; font-weight: 700; color: var(--text-main); letter-spacing: -.01em; }
.ds-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--pill);
    background: var(--card-bg); border: 1px solid var(--border-strong);
    font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.ds-chip:hover { border-color: var(--accent); color: var(--accent); }
.ds-chip.icon { padding: 3px 6px; }
.ds-cav { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.ds-cav b { font-size: 15px; color: var(--text-main); font-weight: 700; }

/* 박스 진행 — 현장의 시계 */
.ds-box { background: var(--surface-2); border-radius: var(--radius-xs); padding: 9px 11px; }
.ds-box-top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-muted); }
.ds-box-left { color: var(--text); }
.ds-box-left b { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ds-box-pct { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.ds-bar { height: 5px; margin: 7px 0 6px; background: var(--surface-3); border-radius: var(--pill); overflow: hidden; }
.ds-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--pill); transition: width .4s ease; }
.ds-box-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-main); font-weight: 500; } /* 검은색 — 회색이라 안 보였다 (v3, 2026-10-19) */
.ds-box-foot em { font-style: normal; color: var(--amber); font-weight: 600; }

.ds-facts { display: flex; gap: 16px; margin: 0; flex-wrap: wrap; }
.ds-facts dt { font-size: 10.5px; color: var(--text-faint); font-weight: 500; }
.ds-facts dd { margin: 1px 0 0; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-facts dd.bad { color: var(--red); }
/* "계획" 꼬리표 — 실측 속도로 잰 예상이 아니라 계획에 적힌 종료 시각이라는 표시. */
.ds-fact-note { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--text-faint); }

.ds-mc-alarm {
    margin: 12px 13px; padding: 14px;
    background: var(--red-soft); border-radius: var(--radius-xs);
    display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.ds-mc-alarm strong { font-size: 13px; color: var(--red); }
.ds-mc-alarm span { font-size: 11.5px; color: var(--text-muted); }
.ds-mc-alarm .btn { margin-top: 6px; }

/* ── 인천: 기계 카드 + 작업 목록 ──
   카드는 기계 수만큼(2대)뿐이라 오른쪽이 비었다. 그 자리를 "아직 안 끝난 작업" 목록으로
   채우고, 목록을 누르면 그 기계 카드가 고른 계획으로 바뀐다(카드는 계속 기계 한 장). */
.ds-mc > .ds-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ds-ic-grid .ds-worklist { grid-column: 3 / -1; }
/* 인천 PC — 기계 카드 2장이 화면 반, 작업 목록(아래 출고)이 나머지 반 (2026-10-20 사용자 지시).
   자동 칸 수(304px)로 두면 넓은 화면에서 카드 2장이 1/3 남짓만 쓰고 목록이 늘어났다. */
@media (min-width: 992px) {
    .ds-machines.ds-ic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    /* 목록은 늘 오른쪽 위 반 — 기계가 셋 이상이면 남는 카드는 왼쪽 반 아래 줄로 */
    .ds-ic-grid .ds-worklist { grid-row: 1 / span 2; }
}
/* 평택도 같은 목록을 쓴다(읽기 전용). 기계가 3대라 자리는 4번째 칸 — 칸이 그만큼
   안 나오는 화면에서는 억지로 옆에 붙이지 않고 카드 아래 한 줄로 내려 앉힌다. */
.ds-worklist.ds-wl-side { grid-column: 1 / -1; }
/* 검사기 카드가 같이 있을 땐 작업 계획을 칸 하나짜리 작은 카드로 — 목록은 짧게 접는다. */
.ds-worklist.ds-wl-compact { grid-column: auto; }
.ds-wl-compact .ds-wl { max-height: 190px; padding: 4px; }
.ds-wl-compact .ds-wl-row { padding: 5px 7px; font-size: 11.5px; }
.ds-vl-note { font-size: 11.5px; color: var(--text-muted); }
@media (min-width: 1560px) { .ds-worklist.ds-wl-side { grid-column: var(--wl-col) / -1; } }
.ds-wl { list-style: none; margin: 0; padding: 6px; overflow-y: auto; max-height: 320px; }
.ds-wl-row {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 8px 9px; border: 1px solid transparent; border-radius: var(--radius-xs);
    background: none; text-align: left; cursor: pointer; font-size: 12.5px; color: var(--text);
}
.ds-wl-row { text-decoration: none; }
.ds-wl-row:hover { background: var(--surface-2); }
.ds-wl-row.on { background: var(--surface-2); border-color: var(--accent); }
.ds-wl-mc { flex-shrink: 0; font-weight: 700; font-size: 11.5px; color: var(--text-muted); }
.ds-wl-name { font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-wl-when { margin-left: auto; flex-shrink: 0; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ds-wl-when.bad { color: var(--red); }
.ds-wl-tag {
    flex-shrink: 0; padding: 2px 7px; border-radius: var(--pill);
    font-size: 10.5px; font-weight: 700;
    background: var(--green-soft); color: var(--green);
}
.ds-wl-tag.plan { background: var(--amber-soft); color: var(--amber); }
.ds-wl-tag.late { background: var(--red-soft); color: var(--red); }
.ds-wl-tag.done { background: var(--surface-3); color: var(--text-faint); }
/* 오늘 끝낸 줄 — 지우지 않고 그어서 남긴다. 누른 게 먹혔다는 확인이다. */
.ds-wl-row.done { cursor: default; color: var(--text-faint); }
.ds-wl-row.done .ds-wl-mc,
.ds-wl-row.done .ds-wl-name { color: var(--text-faint); text-decoration: line-through; }
.ds-wl-row.done:hover { background: none; }
@media (max-width: 960px) {
    .ds-worklist { grid-column: 1 / -1; }
}

.ds-mc-empty { padding: 26px 13px; text-align: center; font-size: 12.5px; color: var(--text-faint); }

.ds-mc-foot {
    margin-top: auto;
    padding: 9px 11px;
    border-top: 1px solid var(--border);
    /* 6칸 격자 — 윗줄 3개(2칸씩) · 아랫줄 2개(3칸씩)로 두 줄 폭이 정확히 맞는다. */
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.ds-mc-foot > * { grid-column: span 2; }
.ds-mc-foot > .ds-act-wide { grid-column: span 3; }
.ds-mc-foot > .ds-act-full { grid-column: span 6; } /* v3 — 쉬는 카드의 [프린트] 한 개 */
.ds-mc-foot .btn { display: flex; align-items: center; justify-content: center; width: 100%; white-space: nowrap; }
.ds-btn-defect { border-color: var(--red, #d64545); color: var(--red, #d64545); }
.ds-btn-defect:hover { background: var(--red-soft, #fdecec); border-color: var(--red, #d64545); color: var(--red, #d64545); }
.ds-btn-end { background: var(--card-bg); border: 1px solid var(--border-strong); color: var(--text-muted); }
.ds-btn-end:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.ds-mc-none { grid-column: 1/-1; padding: 30px; text-align: center; color: var(--text-faint); }

/* ── 출고 ── */
.ds-ship { margin-top: 28px; }
/* v3 — 출고는 작업 계획 아래 같은 폭의 카드 */
/* 작업 계획은 옆 기계 카드와 같은 높이(첫 줄), 출고는 그 바로 아래 남는 칸(둘째 줄) — 두 줄을 묶되
   줄 높이는 바깥 그리드(subgrid)가 정한다. 그래서 작업 계획 높이가 출고 때문에 변하지 않는다. */
.ds-side-stack { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 2; min-width: 0; }
.ds-side-stack > .ds-mc { min-width: 0; }
.ds-mc.ds-ship { margin-top: 0; padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ds-mc.ds-ship .ds-ship-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ds-mc.ds-ship .ds-ship-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.ds-mc.ds-ship .ds-ship-head { gap: 8px; }
.ds-mc.ds-ship .ds-ship-head h2 { font-size: 14px; }
.ds-ship-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border-strong); }
.ds-ship-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: var(--text-main); }
.ds-ship-sum { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ds-ship-more { font-size: 12.5px; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.ds-ship-more:hover { color: var(--accent); }

.ds-ship-list { list-style: none; margin: 0; padding: 0; }
.ds-ship-list a {
    display: flex; align-items: baseline; gap: 12px;
    padding: 11px 4px;
    border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
}
.ds-ship-list a:hover { background: var(--surface-2); }
.ds-ship-cust { font-weight: 600; color: var(--text-main); font-size: 13.5px; }
.ds-ship-meta { font-size: 12px; color: var(--text-faint); }
.ds-ship-amt { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ds-ship-amt em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--text-faint); margin-left: 2px; }
.ds-ship-empty { padding: 26px; text-align: center; color: var(--text-faint); font-size: 13px; }

@media (max-width: 991px) {
    .ds-machines { grid-template-columns: 1fr; }
    /* 한 칸짜리 그리드에서 `grid-column: 3 / -1` 은 없는 칸을 가리켜 **암시적 칸을 만든다**.
       그러면 기계 카드가 옆으로 눌려 폰에서 글자가 한 자씩 세로로 쪼개진다(인천, 2026-09-19).
       가로 스크롤은 안 생겨서 넘침 검사로는 안 잡힌다. */
    .ds-ic-grid .ds-worklist { grid-column: 1 / -1; }
    .ds-sum-item { flex: 1 1 33%; min-width: 0; border-bottom: 1px solid var(--border); }
    .ds-sum-item.wide { flex: 1 1 100%; border-right: 0; }
    .ds-sum-n { font-size: 21px; }
}

/* ══════════════════════ 위쪽 메뉴 모드 (2026-10-08 시험) ══════════════════════
   html.nav-top 일 때만 데스크톱(≥992px)에서 왼쪽 레일을 위쪽 가로 바로 바꾼다.
   모바일은 그대로 서랍. 되돌리기: 상단 버튼(localStorage) 또는 git tag pre-topnav. */
.shell-navmode, .shell-search-rail { display: none; }
@media (min-width: 992px) {
    .shell-navmode {
        display: inline-flex; align-items: center; justify-content: center;
        height: 34px; width: 34px; padding: 0;
        background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--pill);
        color: var(--text-faint); cursor: pointer;
    }
    .shell-navmode:hover { border-color: var(--border-strong); color: var(--text-muted); }

    .nav-top .shell-rail {
        inset: 0 0 auto 0; width: auto; height: var(--nav-h);
        flex-direction: row; align-items: stretch;
        overflow: visible;
    }
    .nav-top .shell-brand { border-bottom: 0; padding: 0 14px; }
    /* 공장 단추는 메뉴와 다른 덩어리 — 오른쪽에 굵은 구분선과 여백 */
    .nav-top .shell-factory { padding: 0 16px 0 8px; margin-right: 10px; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.28); display: flex; align-items: center; }
    .nav-top .shell-factory-seg { background: rgba(255,255,255,.12); }
    .nav-top .shell-factory-seg a { padding: 5px 9px; }
    .nav-top .shell-nav { display: flex; align-items: stretch; padding: 0 4px; flex: 1; min-width: 0; }
    .nav-top .shell-nav-group, .nav-top .shell-nav-group + .shell-nav-group { position: relative; display: flex; align-items: center; }
    /* 그룹 사이: 얇은 세로 구분선 + 여유 간격 */
    .nav-top .shell-nav-group + .shell-nav-group::before {
        content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px;
        background: rgba(255,255,255,.30);
    }
    .nav-top .shell-nav-group { margin: 0 5px; }
    .nav-top .shell-nav-label {
        padding: 0 18px; height: 100%; display: flex; align-items: center;
        font-size: 13px; letter-spacing: -.01em; text-transform: none; font-weight: 600;
        color: var(--rail-text); cursor: pointer; white-space: nowrap;
    }
    .nav-top .shell-nav-group:hover .shell-nav-label,
    .nav-top .shell-nav-group.open .shell-nav-label { color: var(--rail-text-strong); background: var(--rail-hover); }
    .nav-top .shell-nav-group:has(a.active) .shell-nav-label { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
    .nav-top .shell-nav-group > a { white-space: nowrap; padding: 8px 18px; font-size: 13px; font-weight: 600; }
    .nav-top .shell-nav-items {
        display: none; position: absolute; top: 100%; left: 0; min-width: 190px;
        background: var(--rail-bg); padding: 6px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        box-shadow: var(--shadow-lg);
    }
    .nav-top .shell-nav-group:hover .shell-nav-items,
    .nav-top .shell-nav-group:focus-within .shell-nav-items,
    .nav-top .shell-nav-group.open .shell-nav-items { display: block; }
    /* 다른 그룹에 마우스가 올라가 있으면, 클릭·포커스로 남은 이전 메뉴는 닫는다 (두 메뉴가 겹쳐 보이던 문제) */
    .nav-top .shell-nav:has(.shell-nav-group:hover) .shell-nav-group:not(:hover) .shell-nav-items { display: none; }
    .nav-top .shell-nav:has(.shell-nav-group:hover) .shell-nav-group.open:not(:hover) .shell-nav-label { background: none; }
    .nav-top .shell-nav-items a { white-space: nowrap; }

    .nav-top .shell-rail-foot { position: static; border-top: 0; padding: 0 12px; display: flex; align-items: center; flex-shrink: 0; background: transparent; }
    .nav-top .shell-user-meta { display: none; }
    .nav-top .shell-search-rail, .nav-top .shell-rail-foot .shell-navmode {
        display: inline-flex; align-items: center; justify-content: center;
        width: 30px; height: 30px; min-width: 0; padding: 0; border: 0; border-radius: 6px;
        background: none; color: rgba(225,245,235,.55);
    }
    .nav-top .shell-search-rail:hover, .nav-top .shell-rail-foot .shell-navmode:hover { background: var(--rail-hover); color: var(--rail-text-strong); }

    /* 본문: 왼쪽 여백 대신 위쪽 바만큼 내린다. 위쪽 메뉴일 땐 본문 머리줄(.shell-top)을 접는다 — 검색·전환은 바 안에 있다. */
    .nav-top .shell-main { margin-left: 0; padding-top: var(--nav-h); }
    .nav-top .shell-top { display: none; }
    /* 왼쪽 모드에서만 보이던 상단 버튼은 위쪽 모드에선 바 안 것을 쓴다 */
    html:not(.nav-top) .shell-rail-foot .shell-navmode { display: none; }
}
@media (min-width: 992px) and (max-width: 1399px) {
    .nav-top .shell-brand-name, .nav-top .shell-brand-ver { display: none; }
}
@media (min-width: 992px) and (max-width: 1399px) {
    .nav-top .shell-nav-label, .nav-top .shell-nav-group > a { padding-left: 12px; padding-right: 12px; }
    .nav-top .shell-nav-group { margin: 0 2px; }
}

/* 채운 단추는 없앤다 — 등록·검색·추가 등 모든 주요 단추를 같은 색 테두리·글자의 빈 사각으로 (사용자 지시 2026-10-08).
   저장(.btn-save)·수정(.btn-edit)은 아래에서 색만 덮어쓴다. */
.btn-primary, .btn-outline-primary { background: transparent; border: 1px solid var(--accent); color: var(--accent); box-shadow: none; }
.btn-primary:hover, .btn-primary:focus, .btn-outline-primary:hover, .btn-outline-primary:focus { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active, .btn-outline-primary:active { background: var(--accent-active) !important; border-color: var(--accent-active) !important; color: #fff !important; }
.btn-primary:disabled, .btn-primary.disabled { background: transparent; color: var(--accent); border-color: var(--accent); opacity: .5; }
.btn-success { background: transparent; border: 1px solid #198754; color: #198754; box-shadow: none; }
.btn-success:hover, .btn-success:focus { background: #198754; border-color: #198754; color: #fff; }
.btn-warning { background: transparent; border: 1px solid #b7791f; color: #b7791f; box-shadow: none; }
.btn-warning:hover, .btn-warning:focus { background: #b7791f; border-color: #b7791f; color: #fff; }
.btn-danger { background: transparent; border: 1px solid #dc3545; color: #dc3545; box-shadow: none; }
.btn-danger:hover, .btn-danger:focus { background: #dc3545; border-color: #dc3545; color: #fff; }

/* 저장 단추는 파란색 + 문서·체크 아이콘, 삭제는 빨강 + 지우개 아이콘 (사용자 지시 2026-10-08) */
.btn-save { background: transparent; border: 1px solid #1f6feb; color: #1f6feb; box-shadow: none; }
.btn-save:hover, .btn-save:focus { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn-save:active { background: #1858c0 !important; border-color: #1858c0 !important; color: #fff !important; }
.btn-save:disabled, .btn-save.disabled { background: transparent; color: #1f6feb; opacity: .5; }

/* 수정 단추: 진회색 테두리 + 같은 색 글자·연필 아이콘 (사용자 지시 2026-10-08) */
.btn-edit { background: transparent; border: 1px solid #4b5563; color: #4b5563; }
.btn-edit:hover, .btn-edit:focus { background: #4b5563; border-color: #4b5563; color: #fff; }
.btn-edit:active { background: #374151 !important; border-color: #374151 !important; color: #fff !important; }

/* ── 팝업(모달)은 어디서나 화면 한가운데, 위쪽 메뉴 바보다 위에 (사용자 지시 2026-10-08) ──
   위쪽 메뉴(.shell-rail, z-index 1200)가 부트스트랩 모달(1055) 위로 올라와 팝업 머리가 가려졌다. */
.modal { z-index: 1300; }
.modal-backdrop { z-index: 1290; }
.tooltip, .popover { z-index: 1400; }
.modal-dialog:not(.modal-fullscreen) { display: flex; align-items: center; min-height: calc(100% - var(--bs-modal-margin, 1rem) * 2); }
.modal-dialog:not(.modal-fullscreen) > .modal-content { width: 100%; }
@media (min-width: 576px) {
    .modal-dialog:not(.modal-fullscreen) { min-height: calc(100% - var(--bs-modal-margin, 1.75rem) * 2); }
}

/* ══════════════ 위쪽 메뉴 — 고급스럽게 다듬기 (2026-10-08) ══════════════
   원칙: 선·칸막이를 걷고 여백과 글자 간격으로 구분한다. 포인트는 놋쇠빛(#7fe0b5) 가는 선 하나.
   위쪽 메뉴 규칙(위)을 덮어쓴다 — 되돌리려면 이 블록만 지우면 된다. */
@media (min-width: 992px) {
    .nav-top .shell-rail {
        background: linear-gradient(180deg, #17382d 0%, #0f2a21 100%);
        border-bottom: 1px solid rgba(127, 224, 181, .28);
        box-shadow: 0 6px 24px rgba(4, 16, 12, .18);
    }
    .nav-top .shell-brand-name { font-weight: 600; letter-spacing: .14em; font-size: 14.5px; }
    .nav-top .shell-brand-ver { letter-spacing: .06em; opacity: .55; }

    /* 공장 선택 — 테두리만 가는 알약, 선택된 쪽은 상아색 */
    .nav-top .shell-factory { border-right: 0; margin-right: 6px; padding: 0 10px 0 4px; }
    .nav-top .shell-factory-seg { background: transparent; border: 1px solid rgba(225, 245, 235, .22); border-radius: 999px; padding: 2px; gap: 0; }
    .nav-top .shell-factory-seg a { border-radius: 999px; padding: 5px 14px; font-weight: 500; letter-spacing: .08em; color: rgba(225, 245, 235, .62); }
    .nav-top .shell-factory-seg a:hover { background: rgba(225, 245, 235, .08); color: #f0faf5; }
    .nav-top .shell-factory-seg a.active { background: #e6f7ef; color: #0f2a21; font-weight: 700; }

    /* 메뉴 그룹 — 구분선 없음, 넓은 여백과 자간 */
    .nav-top .shell-nav { gap: 2px; }
    .nav-top .shell-nav-group + .shell-nav-group::before { display: none; }
    .nav-top .shell-nav-group { margin: 0 2px; }
    .nav-top .shell-nav-label,
    .nav-top .shell-nav-group > a {
        padding: 0 17px; height: 100%; font-size: 13px; font-weight: 500; letter-spacing: .06em;
        color: rgba(225, 245, 235, .60); position: relative; background: transparent !important; border-radius: 0; box-shadow: none;
        transition: color .18s;
    }
    .nav-top .shell-nav-group > a { display: flex; align-items: center; gap: 0; }
    .nav-top .shell-nav-group > a i { display: none; }
    .nav-top .shell-nav-group:hover .shell-nav-label,
    .nav-top .shell-nav-group.open .shell-nav-label,
    .nav-top .shell-nav-group > a:hover { color: #f0faf5; }
    /* 지금 있는 곳 — 글자는 상아색, 아래에 짧은 놋쇠 선 */
    .nav-top .shell-nav-group:has(a.active) .shell-nav-label,
    .nav-top .shell-nav-group > a.active { color: #f0faf5; font-weight: 600; box-shadow: none; }
    .nav-top .shell-nav-group:has(a.active) .shell-nav-label::after,
    .nav-top .shell-nav-group > a.active::after {
        content: ""; position: absolute; left: 50%; bottom: 0; width: 24px; height: 2px; margin-left: -12px;
        background: #7fe0b5; border-radius: 2px 2px 0 0;
    }

    /* 펼침 목록 */
    .nav-top .shell-nav-items {
        top: calc(100% + 1px); left: 17px; transform: none; min-width: 188px; padding: 8px;
        background: #17382d; border: 1px solid rgba(127, 224, 181, .22); border-radius: 12px;
        box-shadow: 0 18px 40px rgba(4, 16, 12, .42);
    }
    /* 첫 글자 아래에서 펼친다 — 모든 메뉴 왼쪽 정렬(left = 글자 안쪽 여백 17px). */
    .nav-top .shell-nav-items a {
        padding: 9px 14px; border-radius: 8px; font-size: 13px; letter-spacing: .03em; color: rgba(225, 245, 235, .72);
    }
    .nav-top .shell-nav-items a i { display: none; }
    .nav-top .shell-nav-items a:hover { background: rgba(225, 245, 235, .07); color: #f0faf5; }
    .nav-top .shell-nav-items a.active { background: rgba(127, 224, 181, .12); color: #f0faf5; box-shadow: none; }

    .nav-top .shell-avatar { background: rgba(225, 245, 235, .10); }
}

/* ══════════════ 전체 톤 통일 — 고급스럽게 (2026-10-08) ══════════════
   원칙: 위쪽 메뉴와 같은 결 — 선은 가늘게, 색은 한 온도로, 글자 간격은 넉넉하게.
   버튼 색은 상태별 의미(저장·삭제·경고)를 유지하되 아이보리 위에서 한 팔레트로 모은다.
   되돌리려면 이 블록만 지우면 된다. */
.btn-success { border-color: var(--green); color: var(--green); }
.btn-success:hover, .btn-success:focus { background: var(--green); border-color: var(--green); color: #fff; }
.btn-warning { border-color: var(--amber); color: var(--amber); }
.btn-warning:hover, .btn-warning:focus { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover, .btn-danger:focus { background: var(--red); border-color: var(--red); color: #fff; }
.btn-save { border-color: var(--blue); color: var(--blue); }
.btn-save:hover, .btn-save:focus { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-save:active { background: var(--blue) !important; border-color: var(--blue) !important; filter: brightness(.9); }
.btn-save:disabled, .btn-save.disabled { color: var(--blue); }
.btn-edit { border-color: var(--border-strong); color: var(--text); }
.btn-edit:hover, .btn-edit:focus { background: var(--text-main); border-color: var(--text-main); color: #fff; }
.btn-edit:active { background: var(--text-main) !important; border-color: var(--text-main) !important; }
.btn { letter-spacing: .01em; transition: background .16s, color .16s, border-color .16s; }
.btn:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; }

/* 카드 — 머리 아래 구분선은 옅게, 카드 자체는 헤어라인 */
.card { border-color: var(--border); }
.card-header { border-bottom-color: var(--border); letter-spacing: .02em; }

/* 표 — 머리글은 작고 넓은 자간, 행은 숨 쉴 여백 */
.table thead th { letter-spacing: .09em; border-bottom-color: var(--border-strong); }
.table tbody td { padding-top: 12px; padding-bottom: 12px; }
.table tbody tr:last-child td { border-bottom-color: transparent; }

/* 입력 — 높이·모서리·포커스를 하나로 */
.form-control, .form-select { background-color: #fff; transition: border-color .16s, box-shadow .16s; }
.form-control:hover:not(:focus), .form-select:hover:not(:focus) { border-color: var(--text-faint); }
.form-control::placeholder { color: var(--text-faint); }

/* 배지·알림 — 채우지 않고 옅은 바탕 + 같은 계열 글자 */
.badge-status { letter-spacing: .03em; }
.alert { border-width: 1px; padding: 11px 16px; }

/* 모달 — 머리 글자, 닫기, 그림자를 아이보리 톤으로 */
.modal-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text-main); }
.modal-header { padding: 15px 20px; }
.modal-body { padding: 18px 20px; }
.modal-footer { padding: 12px 20px; }
.modal-backdrop.show { opacity: .42; }

/* 제목 — 큰 글씨는 자간을 조인다 */
.page-header h1 { font-weight: 700; letter-spacing: -.025em; }
.topbar-title { letter-spacing: -.025em; }

/* 링크·탭 */
a { text-underline-offset: 3px; }
.nav-tabs .nav-link.active { color: var(--text-main); border-bottom-color: var(--accent); }

/* 브랜드 마크는 회사색(점토) 유지 — 테마 강조색이 인디고로 바뀌어도 로고는 그대로 */
.shell-brand-mark { background: #c2603d; }

/* ══════════════ 생산통계 (평택·인천 공용) — 촘촘하게, 위계 있게 (2026-10-08) ══════════════
   막대 줄줄이 → 기계당 누적 막대 한 줄 + 점 목록. 숫자는 생산·출고만 크게, 나머지는 보조.
   되돌리려면 이 블록과 statistics*.html 의 stat-page 마크업을 되돌린다. */
.stat-page .kpi-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: stretch; }
.stat-page .kpi-hero { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.stat-page .kpi-hero .kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.stat-page .kpi-hero .kpi-label { font-size: 12px; letter-spacing: .04em; }
.stat-page .kpi-mini { background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.stat-page .kpi-mini .kpi-value { font-size: 17px; }
.stat-page .kpi-mini .kpi-label { font-size: 11.5px; }

/* 탭 — 알약 대신 밑줄 (위쪽 메뉴와 같은 결) */
.stat-page .stat-tabs { gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.stat-page .stat-tab { border: 0; border-radius: 0; background: transparent; padding: 8px 2px 10px; font-size: 13.5px;
                       color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stat-page .stat-tab:hover { color: var(--text-main); }
.stat-page .stat-tab.on { background: transparent; color: var(--text-main); border-bottom-color: var(--accent); }

/* 카드 머리 아이콘은 한 색으로 */
.stat-page .card-header > i.bi { color: var(--text-faint) !important; }

/* 기계 카드 */
.mc-gauge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 11.5px; color: var(--text-muted); }
.mc-gauge { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 0; }
.mc-gauge i { display: block; height: 100%; border-radius: 3px; animation: mcgrow .7s cubic-bezier(.4,0,.2,1); }
@keyframes mcgrow { from { width: 0; } }
.mc-gauge .g-red { background: var(--red); } .mc-gauge .g-green { background: var(--green); }
.mc-gauge .g-blue { background: var(--blue); } .mc-gauge .g-amber { background: var(--amber); }
.mc-gauge-pct { font-weight: 700; font-size: 12px; white-space: nowrap; }
.mc-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.mc-stack i { display: block; min-width: 3px; height: 100%; }
.mc-list { list-style: none; margin: 0; padding: 0; }
.mc-item { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 12.5px; min-width: 0; }
.mc-item.clickable { cursor: pointer; }
.mc-item.clickable:hover .mc-name { color: var(--accent); }
.mc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; align-self: center; }
.mc-name { flex: 1; min-width: 0; color: var(--text-main); overflow-wrap: anywhere; line-height: 1.3; }
.mc-qty { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-pct { width: 46px; text-align: right; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-more > summary { font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 5px 0 2px; list-style: none; }
.mc-more > summary::-webkit-details-marker { display: none; }
.mc-more > summary:hover { color: var(--accent); }
.mc-more[open] > summary { display: none; }
.c0 { background: #e0653a; } .c1 { background: #2f6fd6; } .c2 { background: #20a464; } .c3 { background: #f0a020; }
.c4 { background: #e0508a; } .c5 { background: #14a3b8; } .c6 { background: #8b5cd6; } .c7 { background: #a3a8a6; }

/* 거래처별 출고 — 얇은 막대 한 줄 */
.rk-row { padding: 6px 0; }
.rk-row.clickable { cursor: pointer; }
.rk-row.clickable:hover .mc-name { color: var(--accent); }
.rk-top { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.rk-bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 2px; background: var(--amber); animation: mcgrow .7s cubic-bezier(.4,0,.2,1); }

/* 재고 소진 — 급한 것만 먼저 */
.sd-cell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sd-bar { width: 56px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sd-bar i { display: block; height: 100%; border-radius: 3px; }
.sd-bar .s-critical, .sd-bar .s-negative { background: var(--red); }
.sd-bar .s-warn { background: var(--amber); }
.sd-bar .s-ok { background: var(--green); }
.sd-more { font-size: 12.5px; }
.stat-note { color: var(--text-faint); cursor: help; margin-left: 4px; font-size: 13px; }
@media (max-width: 768px) {
    .stat-page .kpi-hero .kpi-value { font-size: 24px; }
    .stat-page .stat-tabs { gap: 16px; }
    .mc-pct { width: 40px; }
}

/* ══════════════ 생산통계 압축 배치 (기계·거래처·멈춤·로스 공용) ══════════════
   한 카드 안에 한 줄씩. 막대는 이름 옆에 가늘게, 숫자는 오른쪽 정렬. */
.stat-sec { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); }
.mt-row { padding: 9px 16px; border-top: 1px solid var(--border); }
.mt-row:first-child { border-top: 0; }
.mt-head { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.mt-name { font-weight: 700; color: var(--text-main); }
.mt-gl { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.mt-gl .mc-gauge { flex: 0 0 72px; width: 72px; }
.mt-gl b { color: var(--text-main); font-size: 12px; }
.mt-stack { height: 6px; margin: 6px 0 5px; }
.mt-prods { display: flex; flex-wrap: wrap; gap: 1px 14px; font-size: 12px; color: var(--text); }
.mt-prods a { color: var(--text); text-decoration: none; }
.mt-prods a:hover { color: var(--accent); }
.mt-prods b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-prods .mc-dot { display: inline-block; margin-right: 4px; vertical-align: middle; }
.mt-more > summary { font-size: 12px; color: var(--text-muted); cursor: pointer; list-style: none; display: inline; }
.mt-more > summary::-webkit-details-marker { display: none; }
.mt-more > summary:hover { color: var(--accent); }
.mt-more[open] > summary { display: block; margin-bottom: 2px; }
.mt-prods .mt-more[open] { display: contents; }
.rk-list { padding: 4px 16px 8px; }
.rk-line { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto 44px; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; color: var(--text); text-decoration: none; }
a.rk-line:hover .mc-name { color: var(--accent); }
.rk-line .rk-bar { margin: 0; height: 5px; }
.rk-red .rk-bar i { background: var(--red); }
.rk-amber .rk-bar i { background: var(--amber); }
.sd-table td, .sd-table th { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
@media (max-width: 768px) {
    .mt-row { padding: 9px 12px; }
    .rk-list { padding: 4px 12px 8px; }
    .rk-line { grid-template-columns: minmax(0, 1fr) 44px auto 40px; gap: 6px; }
}

/* 생산통계 — 기계별 가동율 카드(KPI 줄 안), 거래처 도넛 */
.stat-page .kpi-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-page .kpi-util { grid-column: span 2; align-items: stretch; }
.ku-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.ku-table th { font-size: 10.5px; font-weight: 500; color: var(--text-muted); padding: 0 0 2px 8px; white-space: nowrap; }
.ku-table td { font-size: 12px; padding: 2px 0 2px 8px; color: var(--text); }
.ku-table td:first-child { padding-left: 0; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.ku-c { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ku-c .mc-gauge { flex: 0 0 44px; width: 44px; height: 5px; }
.ku-c b { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.pie-wrap { position: relative; height: 170px; padding: 10px 16px 0; }
.pie-legend { padding: 6px 16px 10px; }
.pie-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--text); text-decoration: none; }
.pie-row[hidden] { display: none; }
a.pie-row:hover .mc-name { color: var(--accent); }
.pie-row .mc-dot { align-self: center; }
.pie-more { border: 0; background: none; padding: 3px 0 0; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.pie-more:hover { color: var(--accent); }
@media (max-width: 768px) { .stat-page .kpi-util { grid-column: 1 / -1; } .pie-wrap, .pie-legend { padding-left: 12px; padding-right: 12px; } }

/* 생산통계 KPI 카드 통일 — 배경·여백·라벨/숫자 크기를 모두 같게, 위에서부터 정렬 */
.stat-page .kpi-row { align-items: stretch; }
.stat-page .kpi-row > .kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.stat-page .kpi-row > .kpi .kpi-label { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); margin: 0 0 4px; line-height: 1.3; }
.stat-page .kpi-row > .kpi .kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.stat-page .kpi-row > .kpi .kpi-value small { font-size: 12px; font-weight: 500; margin-left: 2px; color: var(--text-muted); }
.stat-page .kpi-row > .kpi .kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.stat-page .kpi-row > .kpi .kpi-label small { font-weight: 400; }
.ku-table { margin-top: 0; }
@media (max-width: 768px) { .stat-page .kpi-row > .kpi .kpi-value { font-size: 20px; } }

/* 기계별 생산·가동율 카드 — 기계 한 줄에 생산량·두 가동율, 제품은 이름 아래 작은 글씨 */
.stat-page .kpi-util { grid-column: span 3; }
.ku-table th { text-align: left; padding: 0 12px 4px 0; font-size: 11.5px; }
.ku-table td { padding: 5px 12px 5px 0; vertical-align: top; font-size: 12.5px; }
.ku-table tbody tr + tr td { border-top: 1px solid var(--border); }
.ku-name { display: block; font-weight: 700; color: var(--text-main); }
.ku-prods { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-muted); line-height: 1.4; }
.ku-prods a { color: var(--text-muted); text-decoration: none; }
.ku-prods a:hover { color: var(--accent); }
.ku-qty { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ku-c { justify-content: flex-start; }
.ku-c b { text-align: left; min-width: 0; }
.pie-wrap { height: 190px; }
@media (max-width: 768px) { .stat-page .kpi-util { grid-column: 1 / -1; } .ku-table th { font-size: 10.5px; padding-right: 6px; } .ku-table td { padding-right: 6px; } .ku-c .mc-gauge { flex-basis: 30px; width: 30px; } }

/* 기계 카드 — 기계마다 한 장: 생산량 · 가동율 두 기준 · 제품 · 멈춤/로스 */
.mcards { margin-bottom: 0; }
.mcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 16px 8px; border-bottom: 1px solid var(--border); }
.mcard-qty { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mcard-qty small { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.mcard-sec { padding: 10px 16px; border-top: 1px solid var(--border); }
.mcard-head + .mcard-sec { border-top: 0; }
.mcard-k { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.mcard-k span { font-weight: 500; color: var(--text); }
.mcard-gauge { display: grid; grid-template-columns: 84px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; color: var(--text); }
.mcard-gauge .mc-gauge { height: 6px; }
.mcard-gauge b { text-align: right; font-variant-numeric: tabular-nums; }
.mcard-line { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 2px 0; color: var(--text); text-decoration: none; }
.mcard-line .mcard-n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mcard-line .mcard-n a { color: var(--text); text-decoration: none; }
.mcard-line .mcard-n a:hover, a.mcard-line:hover .mcard-n { color: var(--accent); }
.mcard-line b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mcard-line em { font-style: normal; width: 44px; text-align: right; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mcard-line .mc-dot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.mcard-loss { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border); }
.mcard .mt-stack { margin: 0 0 6px; }
@media (max-width: 768px) { .mcard-head, .mcard-sec { padding-left: 12px; padding-right: 12px; } .mcard-gauge { grid-template-columns: 76px minmax(0, 1fr) 44px; } }

/* 거래처별 납품(제품 기준) — 제품 한 줄에 업체 비중 막대 */
.cp-list { padding: 4px 16px 10px; }
.cp-row { padding: 8px 0; border-top: 1px solid var(--border); }
.cp-row:first-child { border-top: 0; }
.cp-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.cp-top a { color: var(--text-main); text-decoration: none; }
.cp-top a:hover { color: var(--accent); }
.cp-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-stack { margin: 5px 0 4px; height: 7px; }
.cp-legend { display: flex; flex-wrap: wrap; gap: 1px 14px; font-size: 12px; color: var(--text); }
.cp-legend span { white-space: nowrap; }
.cp-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-legend em { font-style: normal; color: var(--text-muted); }
.cp-legend .mc-dot { display: inline-block; margin-right: 4px; vertical-align: middle; }
@media (max-width: 768px) { .cp-list { padding: 4px 12px 10px; } }

/* 그래프 제거 — 숫자만 한 줄씩 */
.rk-line { grid-template-columns: minmax(0, 1fr) auto 48px; }
.mcard-gauge { grid-template-columns: minmax(0, 1fr) auto; }
.mcard-gauge b { min-width: 48px; }
.cp-legend a { color: var(--text); text-decoration: none; }
.cp-legend a:hover { color: var(--accent); }
@media (max-width: 768px) { .rk-line { grid-template-columns: minmax(0, 1fr) auto 44px; } .mcard-gauge { grid-template-columns: minmax(0, 1fr) auto; } }

/* ── 공통 부품(templates/web/partials/ui/) — 견본: /parts/ ── */
.ui-period { display: inline-flex; align-items: center; gap: 4px; }
.ui-period input[type="date"] { width: 132px; }
.ui-search { width: 170px; }
.ui-factory { width: 110px; }
td.ui-empty { text-align: center; color: var(--text-muted); padding: 24px 8px !important; }
@media (max-width: 576px) {
    .ui-period { display: flex; width: 100%; }
    .ui-period input[type="date"] { flex: 1 1 0; width: auto; min-width: 0; }
    .ui-search { flex: 1 1 120px; width: auto; min-width: 0; }
}

/* v3 — 부트스트랩 회색 글자 클래스도 검은색 */
.text-muted, .text-secondary, .text-body-secondary, .form-text { color: var(--text-main) !important; }

/* 도움말 창 — 긴 글은 창 안에서 스크롤된다. 내용이 한 겹(div) 더 싸고 있어 본문(.modal-body)이 스크롤 칸이 못 되던 것을 고친다 (v3) */
#helpModalBody > [x-data] { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
#helpModalBody .modal-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

/* 검사기 [부적합] 창의 라벨 미리보기 — 실제 라벨(100×80mm)과 같은 비율·구성 (v3) */
.vl-label { width: 100%; max-width: 300px; aspect-ratio: 100 / 80; background: #fff; color: #111; border: 1.5px solid #111; border-radius: 4px; display: flex; flex-direction: column; overflow: hidden; margin: 0 auto 10px; }
.vl-hd { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 700; padding: 4px 8px; border-bottom: 1px solid #111; }
.vl-big { text-align: center; font-weight: 900; font-size: 44px; line-height: 1.1; letter-spacing: .12em; padding: 0 0 0 .12em; flex: 1.35; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: -1.5px -1.5px 0 #111, 1.5px -1.5px 0 #111, -1.5px 1.5px 0 #111, 1.5px 1.5px 0 #111, 0px -1.5px 0 #111, 0px 1.5px 0 #111, -1.5px 0px 0 #111, 1.5px 0px 0 #111; border-bottom: 1px solid #111; } /* 속 빈 글자 — 바깥 윤곽만(글자 획이 겹치는 안쪽 선이 안 보이게) */
.vl-ln { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 8px; border-bottom: 1px solid #111; font-size: 12px; overflow-wrap: anywhere; }
.vl-ln:last-child { border-bottom: 0; flex: .6; }
.vl-ln b { font-size: 16px; }
.vl-q b { font-size: 24px; font-variant-numeric: tabular-nums; }
