/* ==========================================================================
 * GlobalEcho ERP Design System
 * ==========================================================================
 * 발주사 디자인 시스템 문서를 그대로 이식한 것이다. 값·클래스명·마크업 문법을
 * 임의로 바꾸지 않는다 — 다른 모듈과 같은 화면으로 보여야 하기 때문이다.
 *
 * 단일 파일 원칙: 이 파일 하나가 셸과 모든 페이지를 지배한다.
 * ========================================================================== */

/* ══════════════════════════════════════════════════════════════════════════
   1. 토큰
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    /* Raw ramps: DESIGN_SYSTEM.md §§3.1-3.3. */
    --neutral-1:#FDFDFE; --neutral-2:#F8F9FB; --neutral-3:#F0F1F4;
    --neutral-4:#E6E8EC; --neutral-5:#DBDEE2; --neutral-6:#CDD1D7;
    --neutral-7:#BCBFC7; --neutral-8:#A3A8B2; --neutral-9:#8D9095;
    --neutral-10:#72757C; --neutral-11:#565961; --neutral-12:#222429;
    --accent-1:#FCFDFF; --accent-2:#F6F9FF; --accent-3:#EBF1FE;
    --accent-4:#DEE9FE; --accent-5:#CEDEFD; --accent-6:#BCD1FB;
    --accent-7:#A5BFF5; --accent-8:#84A7EF; --accent-9:#336BF5;
    --accent-10:#1D57EC; --accent-11:#164AD6; --accent-12:#18316A;
    --collab-1:#FCFDFE; --collab-2:#F5FAFD; --collab-3:#E9F3F9;
    --collab-4:#DAEBF6; --collab-5:#C9E2F2; --collab-6:#B5D6EB;
    --collab-7:#9CC6E1; --collab-8:#76B0D4; --collab-9:#1C7DAC;
    --collab-10:#1F6C94; --collab-11:#265E7E; --collab-12:#233643;
    --support-1:#FCFDFC; --support-2:#F6FAF8; --support-3:#EAF4EF;
    --support-4:#DBEDE4; --support-5:#CAE5D8; --support-6:#B7DAC9;
    --support-7:#9ECCB6; --support-8:#78B89B; --support-9:#1C8561;
    --support-10:#1F7355; --support-11:#26644C; --support-12:#23382F;
    --exec-1:#FEFCFB; --exec-2:#FDF8F5; --exec-3:#FAEFE8;
    --exec-4:#F7E4D8; --exec-5:#F3D8C6; --exec-6:#ECC9B1;
    --exec-7:#E2B596; --exec-8:#D5996F; --exec-9:#B16019;
    --exec-10:#98541C; --exec-11:#824C23; --exec-12:#442F21;
    --danger-1:#FFFCFC; --danger-2:#FFF7F6; --danger-3:#FEECE9;
    --danger-4:#FEE1DB; --danger-5:#FDD2CA; --danger-6:#FDC0B5;
    --danger-7:#FBA698; --danger-8:#F58271; --danger-9:#E2281A;
    --danger-10:#C12A1D; --danger-11:#A33024; --danger-12:#522821;
    --rnd-1:#FDFDFF; --rnd-2:#F9F8FF; --rnd-3:#F1EFFE;
    --rnd-4:#E9E5FE; --rnd-5:#DED8FD; --rnd-6:#D2C9FB;
    --rnd-7:#C1B5F5; --rnd-8:#AB98EF; --rnd-9:#8852F5;
    --rnd-10:#7B37ED; --rnd-11:#6A37C9; --rnd-12:#382B5E;

    /* Semantic layer: application components use these names. */
    --surface-page:var(--neutral-2); --surface-1:#FFFFFF;
    --surface-2:var(--neutral-3); --surface-3:var(--neutral-4);
    --surface-hover:var(--neutral-4); --surface-active:var(--neutral-5);
    --surface-inverse:var(--neutral-12);
    --border-subtle:var(--neutral-6); --border-default:var(--neutral-7);
    --border-strong:var(--neutral-9); --border-focus:var(--accent-9);
    --text-primary:var(--neutral-12); --text-secondary:var(--neutral-11);
    --text-muted:var(--neutral-10); --text-on-solid:#FFFFFF;
    --text-link:var(--accent-11); --text-link-hover:var(--accent-12);
    --st-neutral:var(--text-secondary); --st-neutral-solid:var(--neutral-11);
    --st-progress:var(--collab-11); --st-progress-solid:var(--collab-9);
    --st-done:var(--support-11); --st-done-solid:var(--support-9);
    --st-action:var(--exec-11); --st-action-solid:var(--exec-9);
    --st-back:var(--danger-11); --st-back-solid:var(--danger-9);

    /* Compatibility aliases retained for the existing Thymeleaf screens. */
    --primary:var(--accent-9); --primary-dark:var(--accent-10);
    --primary-darker:var(--accent-12); --primary-light:var(--accent-8);
    --primary-50:var(--accent-2); --primary-100:var(--accent-3);
    --primary-200:var(--accent-6);
    --secondary:var(--neutral-10); --secondary-dark:var(--neutral-11);
    --secondary-light:var(--neutral-8);
    --success:var(--support-9); --success-light:var(--support-3);
    --success-dark:var(--support-11);
    --warning:var(--exec-9); --warning-light:var(--exec-3);
    --warning-dark:var(--exec-11);
    --danger:var(--danger-9); --danger-light:var(--danger-3);
    --danger-dark:var(--danger-11);
    --info:var(--collab-9); --info-light:var(--collab-3);
    --info-dark:var(--collab-11);
    --gray-50:var(--neutral-2); --gray-100:var(--neutral-3);
    --gray-200:var(--neutral-4); --gray-300:var(--neutral-6);
    --gray-400:var(--neutral-8); --gray-500:var(--neutral-10);
    --gray-600:var(--neutral-11); --gray-700:#41444B;
    --gray-800:#303238; --gray-900:var(--neutral-12);
    --bg-main:var(--surface-page); --bg-primary:var(--surface-page);
    --bg-card:var(--surface-1); --bg-sidebar:var(--surface-1);
    --bg-sidebar-hover:var(--surface-hover); --bg-sidebar-active:var(--accent-3);
    --bg-input:var(--surface-1); --sidebar-text:var(--text-secondary);
    --sidebar-text-muted:var(--text-muted); --sidebar-border:var(--border-subtle);
    --text-light:var(--text-on-solid); --text-heading:var(--text-primary);
    --border-color:var(--border-subtle); --border-color-dark:var(--border-default);
    --border-input:var(--border-strong);
    --border-radius:8px; --border-radius-sm:6px;
    --border-radius-lg:12px; --border-radius-xl:16px;
    --shadow-xs:0 1px 2px rgba(34,36,41,.04);
    --shadow-sm:0 1px 3px rgba(34,36,41,.08);
    --shadow:0 4px 12px rgba(34,36,41,.09);
    --shadow-md:0 10px 24px rgba(34,36,41,.12);
    --shadow-lg:0 18px 40px rgba(34,36,41,.14);
    --shadow-xl:0 24px 56px rgba(34,36,41,.18);
    --shadow-inner:inset 0 1px 3px rgba(34,36,41,.08);
    --gradient-primary:var(--accent-9); --gradient-primary-hover:var(--accent-10);
    --gradient-header:var(--accent-12); --gradient-success:var(--support-9);
    --gradient-danger:var(--danger-9); --gradient-sidebar:var(--surface-1);
    --sidebar-width:248px; --sidebar-collapsed-width:72px; --header-height:44px;
    --transition-fast:150ms cubic-bezier(.4,0,.2,1);
    --transition-normal:250ms cubic-bezier(.4,0,.2,1);
    --transition-slow:350ms cubic-bezier(.4,0,.2,1);
    --focus-ring:0 0 0 3px rgba(51,107,245,.30);
    --focus-ring-danger:0 0 0 3px rgba(226,40,26,.25);
    --focus-ring-success:0 0 0 3px rgba(28,133,97,.25);
}

/* ══════════════════════════════════════════════════════════════════════════
   2. 리셋 · 타이포그래피
   ══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

/* ★ 루트 14px. 이 한 줄이 빠지면 전 컴포넌트가 1.14배 커져 밀도가 무너진다. */
html { overflow-x: hidden; overflow-x: clip; font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    overflow-x: hidden;
    overflow-x: clip;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0; font-weight: 600; color: var(--text-heading); line-height: 1.4;
}
p { margin: 0; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }

/* ══════════════════════════════════════════════════════════════════════════
   3. 레이아웃 셸 (6-A 클래식)
   ══════════════════════════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column; overflow: hidden;
    z-index: 1000;
    transition: width var(--transition-normal), transform var(--transition-normal);
}
.main-content {
    flex: 1; margin-left: var(--sidebar-width); min-width: 0;
    transition: margin-left var(--transition-normal);
}
.header {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px; z-index: 999;
    transition: left var(--transition-normal);
}
.content-wrapper {
    padding: 24px 32px;
    padding-top: calc(var(--header-height) + 24px);
    min-height: 100vh; max-width: 1600px;
}

.sidebar-collapsed .sidebar      { width: var(--sidebar-collapsed-width); }
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }
.sidebar-collapsed .header       { left: var(--sidebar-collapsed-width); }
.sidebar-collapsed .nav-link-text,
.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .sidebar-user-info,
.sidebar-collapsed .nav-link-arrow { opacity: 0; width: 0; overflow: hidden; }

/* ── 사이드바 내부 ─────────────────────────────────────────────────────── */
.sidebar-header {
    height: var(--header-height); flex-shrink: 0;
    display: flex; align-items: center; padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sidebar-logo:hover { text-decoration: none; }
.sidebar-logo-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 1.15rem; color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .4);
}
.sidebar-logo-text {
    font-size: .95rem; font-weight: 700; color: var(--text-heading);
    letter-spacing: 0; white-space: nowrap;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 0; }
.nav-section { margin-bottom: 14px; }
.nav-section-title {
    padding: 0 20px 6px; font-size: .7rem; font-weight: 600;
    letter-spacing: 0; text-transform: uppercase;
    color: var(--sidebar-text-muted); white-space: nowrap;
}
.nav-item { position: relative; }
.nav-link {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; font-size: .9rem; font-weight: 500;
    color: var(--sidebar-text); text-decoration: none;
    transition: all var(--transition-fast);
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: var(--text-heading); text-decoration: none; }
.nav-link-icon { width: 20px; flex-shrink: 0; font-size: 1.1rem; display: inline-flex; }
.nav-link-text { white-space: nowrap; }
.nav-link-arrow { margin-left: auto; transition: transform var(--transition-fast); }

.nav-link.active {
    color: var(--primary); font-weight: 600; background: var(--bg-sidebar-active);
}
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-submenu { display: none; background: var(--gray-50); }
.nav-item.open > .nav-submenu { display: block; }
.nav-item.open > .nav-link .nav-link-arrow { transform: rotate(90deg); }
.nav-submenu .nav-link { padding-left: 32px; font-size: .85rem; }

.sidebar-footer { flex-shrink: 0; border-top: 1px solid var(--sidebar-border); padding: 14px 20px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: .9rem; font-weight: 600; color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .4);
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
    font-size: .85rem; font-weight: 600; color: var(--text-heading);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: .75rem; color: var(--sidebar-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── 헤더 ──────────────────────────────────────────────────────────────── */
.sidebar-toggle {
    width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-secondary); font-size: 1.2rem; cursor: pointer;
    transition: all var(--transition-fast);
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--text-heading); }
.header-title { font-size: .95rem; font-weight: 600; color: var(--text-heading); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.sidebar-overlay { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   4. 페이지 헤더
   ══════════════════════════════════════════════════════════════════════════ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.page-title {
    font-size: 1.25rem; font-weight: 700; letter-spacing: 0;
    color: var(--text-heading); margin: 0;
}
.page-description { font-size: .85rem; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 10px; }

.page-header-gradient {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    background: transparent; border: 0; border-bottom: 1px solid var(--border-color);
    border-radius: 0; padding: 2px 0 12px;
    margin-bottom: 16px; box-shadow: none; overflow: visible;
}
.page-header-gradient .page-title {
    font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px;
}
.page-header-gradient .page-description { font-size: .8rem; color: var(--text-secondary); margin: 0; }
.page-header-gradient .page-header-actions { display: flex; align-items: center; gap: 8px; }
.export-buttons { display: inline-flex; gap: 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   5. 버튼
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; font-size: .9rem; font-weight: 500; line-height: 1.4;
    border-radius: var(--border-radius); border: 1px solid transparent;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: all var(--transition-fast);
}
.btn:hover { text-decoration: none; }
.btn:focus { outline: none; }
.btn i { font-size: 1rem; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.btn-primary:hover  { background: var(--gradient-primary-hover); color: #fff;
                      transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus  { box-shadow: 0 1px 3px rgba(37,99,235,.3), var(--focus-ring); }

.btn-success { background: var(--gradient-success); color: #fff; box-shadow: 0 1px 3px rgba(5,150,105,.3); }
.btn-success:hover  { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35); }
.btn-success:active { transform: translateY(0); }
.btn-success:focus  { box-shadow: 0 1px 3px rgba(5,150,105,.3), var(--focus-ring-success); }

.btn-danger { background: var(--gradient-danger); color: #fff; box-shadow: 0 1px 3px rgba(220,38,38,.3); }
.btn-danger:hover  { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.35); }
.btn-danger:active { transform: translateY(0); }
.btn-danger:focus  { box-shadow: 0 1px 3px rgba(220,38,38,.3), var(--focus-ring-danger); }

.btn-secondary { background: var(--gray-100); color: var(--text-secondary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--gray-200); color: var(--text-heading); }
.btn-secondary:focus { box-shadow: var(--focus-ring); }

.btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border-color-dark); }
.btn-outline:hover { background: var(--gray-50); color: var(--text-heading); }

.btn-outline-primary { background: transparent; color: var(--primary-dark); border-color: var(--primary-200); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger-light); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-white { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-white:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.btn-white-outline { background: transparent; color: var(--text-secondary); border-color: var(--border-color-dark); }
.btn-white-outline:hover { background: var(--gray-100); color: var(--text-heading); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon-sm { width: 30px; height: 30px; padding: 0; font-size: .85rem; }

.btn-group { display: inline-flex; gap: 1px; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: var(--border-radius) 0 0 var(--border-radius); }
.btn-group > .btn:last-child  { border-radius: 0 var(--border-radius) var(--border-radius) 0; }

.btn-export-excel { background: #217346; color: #fff; border-color: #217346; }
.btn-export-excel:hover { background: #1a5c38; color: #fff; }
.btn-export-pdf { background: #D32F2F; color: #fff; border-color: #D32F2F; }
.btn-export-pdf:hover { background: #b52626; color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════
   6. 카드
   ══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast); margin-bottom: 24px;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    padding: 16px 24px; background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title {
    font-size: .95rem; font-weight: 600; color: var(--text-heading);
    display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-title i { color: var(--primary); font-size: 1.1rem; }
.card-body { padding: 24px; }
.card-body.p-0 { padding: 0; }
.card-footer {
    padding: 16px 24px; background: var(--gray-50);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}
.card-flat { box-shadow: none; }

/*
 * 카드 직계 자식 여백.
 *
 * 디자인 시스템의 정석은 .card-body 로 감싸는 것이지만, 표 하나만 담는
 * 카드까지 래퍼를 두면 마크업이 두 겹씩 깊어진다. 표는 스스로 셀 패딩을
 * 가지므로(그리고 .card .table 규칙이 양끝을 24px 로 맞춘다) 래퍼가 없어도
 * 정렬이 맞고, 그 외 직계 자식만 여기서 안쪽 여백을 받는다.
 */
.card > .table-responsive,
.card > .table { border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg); }
.card > p,
.card > form,
.card > .filter-form,
.card > .text-muted { padding-left: 24px; padding-right: 24px; }
.card > p:first-child,
.card > form:first-child { padding-top: 20px; }
.card > p:last-child,
.card > form:last-child,
.card > .filter-form:last-child { padding-bottom: 20px; }
.card > .filter-form { padding-top: 16px; }
.card-header + .table-responsive .table th { border-top: 0; }

/* 카드 헤더에 제목 클래스를 안 준 경우에도 제목처럼 보이게 한다. */
.card-header > span:first-child { font-weight: 600; color: var(--text-heading); }

/* ══════════════════════════════════════════════════════════════════════════
   7. 폼
   ══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-label, label {
    display: block; margin-bottom: 6px; font-weight: 500;
    font-size: .85rem; color: var(--text-heading);
}
label.required::after, .form-label.required::after { content: ' *'; color: var(--danger); }

.form-control, .form-select,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="url"], input[type="search"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="month"], input[type="week"],
textarea, select {
    width: 100%; padding: 10px 14px; font-size: .9rem; font-family: inherit; line-height: 1.5;
    border: 1.5px solid var(--border-input);
    border-radius: var(--border-radius);
    background: var(--bg-input); color: var(--text-primary);
    transition: all var(--transition-fast);
}
.form-control:hover, select:hover, textarea:hover, input:hover { border-color: var(--gray-400); }
.form-control:focus, select:focus, textarea:focus, input:focus {
    outline: none; border-color: var(--primary); box-shadow: var(--focus-ring);
}
.form-control:disabled, select:disabled, input:disabled, [readonly] {
    background: var(--gray-100); border-color: var(--gray-200);
    color: var(--text-muted); cursor: not-allowed;
}
textarea { resize: vertical; }

/* 네이티브 화살표 제거 + SVG chevron */
select, .form-select, .filter-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
select:focus, .form-select:focus, .filter-select:focus {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

input[type="checkbox"], input[type="radio"] {
    width: 18px; height: 18px; accent-color: var(--primary);
    cursor: pointer; vertical-align: middle;
}
.form-check { display: inline-flex; align-items: center; gap: 6px; }
.form-check label { margin: 0; font-size: .85rem; cursor: pointer; }

.is-invalid { border-color: var(--danger) !important; }
.is-invalid:focus { box-shadow: var(--focus-ring-danger) !important; }
.is-valid { border-color: var(--success) !important; }
.is-valid:focus { box-shadow: var(--focus-ring-success) !important; }
.invalid-feedback { font-size: .8rem; color: var(--danger); margin-top: 4px; }
.valid-feedback { font-size: .8rem; color: var(--success); margin-top: 4px; }

.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > *:first-child { border-radius: var(--border-radius) 0 0 var(--border-radius); }
.input-group > *:last-child  { border-radius: 0 var(--border-radius) var(--border-radius) 0; }
.input-group-text {
    display: flex; align-items: center; padding: 10px 14px; font-size: .9rem;
    background: var(--gray-100); border: 1.5px solid var(--border-input);
    color: var(--text-secondary); white-space: nowrap;
}

.form-section { margin-bottom: 28px; }
.form-section-title {
    font-size: 1rem; font-weight: 600; color: var(--text-heading);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-100);
    display: flex; align-items: center; gap: 8px;
}
.form-section-title i { color: var(--primary); }
.form-actions {
    display: flex; gap: 12px; margin-top: 24px; padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.form-actions-right   { justify-content: flex-end; }
.form-actions-center  { justify-content: center; }
.form-actions-between { justify-content: space-between; }

/* ══════════════════════════════════════════════════════════════════════════
   8. 테이블
   ══════════════════════════════════════════════════════════════════════════ */
.table-wrapper, .table-responsive {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-width: 100%; border-radius: var(--border-radius-lg);
}
.table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.table th, .table td {
    padding: 9px 14px; text-align: left; vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    background: var(--gray-50); font-weight: 600; font-size: .8rem;
    color: var(--text-heading); text-transform: uppercase;
    letter-spacing: 0; white-space: nowrap;
}
.table tbody tr:hover { background: var(--primary-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-child(even) { background: var(--gray-50); }
.card .table th:first-child, .card .table td:first-child { padding-left: 24px; }
.card .table th:last-child,  .card .table td:last-child  { padding-right: 24px; }
.table td { font-variant-numeric: tabular-nums; }

.table-row-danger  { background: var(--danger-light); }
.table-row-warning { background: var(--warning-light); }
.table-row-success { background: var(--success-light); }

.table-empty { padding: 48px 14px; text-align: center; color: var(--text-muted); }
.table-empty i { font-size: 2.5rem; opacity: .4; display: block; margin-bottom: 8px; }

.table-actions { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════
   9. 뱃지 · 알럿
   ══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    font-size: .75rem; font-weight: 600; border-radius: 6px; letter-spacing: 0;
    white-space: nowrap;
}
.badge-primary   { background: var(--primary-100);   color: var(--primary-dark); }
.badge-secondary { background: var(--gray-200);      color: var(--gray-700); }
.badge-success   { background: var(--success-light); color: var(--success-dark); }
.badge-warning   { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger    { background: var(--danger-light);  color: var(--danger-dark); }
.badge-info      { background: var(--info-light);    color: var(--info-dark); }
.badge-sm { padding: 2px 8px; font-size: .7rem; }
.badge-lg { padding: 6px 14px; font-size: .85rem; }

.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; margin-bottom: 16px; font-size: .9rem;
    border-radius: var(--border-radius);
}
.alert i { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert span { flex: 1; }
.alert-success { background: var(--success-light); color: var(--success-dark); border: 1px solid rgba(5,150,105,.2); }
.alert-warning { background: var(--warning-light); color: var(--warning-dark); border: 1px solid rgba(217,119,6,.2); }
.alert-danger  { background: var(--danger-light);  color: var(--danger-dark);  border: 1px solid rgba(220,38,38,.2); }
.alert-info    { background: var(--info-light);    color: var(--info-dark);    border: 1px solid rgba(8,145,178,.2); }
.alert-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: inherit; opacity: .6; font-size: 1.1rem; line-height: 1; padding: 0;
}
.alert-close:hover { opacity: 1; }
.messages .alert { animation: alertSlideIn .3s ease-out; }
@keyframes alertSlideIn { from { opacity: 0; transform: translateY(-10px); }
                          to   { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════════════════
   10. 통계 카드
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg); padding: 20px 24px;
    box-shadow: var(--shadow-sm); transition: all var(--transition-fast);
    text-decoration: none; display: block; color: inherit;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.stat-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.stat-card-title { font-size: .85rem; font-weight: 500; color: var(--text-secondary); }
.stat-card-icon {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--border-radius);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.stat-card-value { font-size: 2rem; font-weight: 700; letter-spacing: 0;
                   color: var(--text-heading); margin-bottom: 4px; line-height: 1.15;
                   font-variant-numeric: tabular-nums; }
.stat-card-change { font-size: .8rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════════
   11. 필터 섹션
   ══════════════════════════════════════════════════════════════════════════ */
.filter-section {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg); padding: 20px 24px;
    margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.filter-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.filter-group.flex-grow { flex: 1; min-width: 200px; }
.filter-label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0; color: var(--text-secondary); margin: 0;
}
.filter-input, .filter-select {
    height: 40px; padding: 9px 14px; font-size: .9rem; width: 100%;
    border: 1.5px solid var(--border-input); border-radius: var(--border-radius);
    background-color: var(--bg-input); color: var(--text-primary);
    transition: all var(--transition-fast);
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.filter-btn {
    height: 40px; padding: 9px 18px; display: inline-flex; align-items: center;
    gap: 6px; font-size: .9rem; font-weight: 500; border: none;
    border-radius: var(--border-radius); cursor: pointer; white-space: nowrap;
    text-decoration: none; transition: all var(--transition-fast);
}
.filter-btn:hover { text-decoration: none; }
.filter-btn-primary { background: var(--gradient-primary); color: #fff; }
.filter-btn-primary:hover { color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.filter-btn-secondary { background: var(--gray-100); color: var(--text-secondary); border: 1px solid var(--border-color); }
.filter-btn-secondary:hover { background: var(--gray-200); color: var(--text-heading); }

.search-box { position: relative; flex: 1; }
.search-box .filter-input { padding-left: 40px; }
.search-box-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: 1rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   12. 상세 정보 패턴 (.detail-item)
   ══════════════════════════════════════════════════════════════════════════ */
.detail-section { padding: 24px 28px; border-bottom: 1px solid var(--border-color); }
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
    font-size: .95rem; font-weight: 600; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 2px solid var(--primary-100);
    display: flex; align-items: center; gap: 10px;
}
.detail-section-title i { color: var(--primary); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.detail-grid-3 { grid-template-columns: repeat(3, 1fr); }
.detail-grid-4 { grid-template-columns: repeat(4, 1fr); }
.detail-item {
    display: flex; flex-direction: column; gap: 4px; padding: 12px 16px;
    background: var(--gray-50); border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-200);
}
.detail-item.full-width { grid-column: span 2; }
.detail-label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0; color: var(--text-muted);
}
.detail-value { font-size: .95rem; font-weight: 500; color: var(--text-primary); word-break: break-word; }
.detail-value.empty { color: var(--text-muted); font-style: italic; font-weight: 400; }
.detail-actions {
    display: flex; justify-content: flex-end; gap: 12px; padding: 20px 28px;
    background: var(--gray-50); border-top: 1px solid var(--border-color);
}

/* ══════════════════════════════════════════════════════════════════════════
   13. 페이지네이션 · 리스트 · 프로그레스
   ══════════════════════════════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    font-size: .9rem; font-weight: 500; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius); text-decoration: none;
}
.page-link:hover { color: var(--primary); background: var(--primary-50); border-color: var(--primary-200); text-decoration: none; }
.page-item.active .page-link { background: var(--gradient-primary); color: #fff;
                               border-color: var(--primary); box-shadow: 0 2px 4px rgba(37,99,235,.3); }
.page-item.disabled .page-link { color: var(--text-muted); background: var(--gray-50);
                                 cursor: not-allowed; pointer-events: none; }
.pagination-info { text-align: center; margin-top: 12px; font-size: .85rem; color: var(--text-muted); }

.list-group { list-style: none; margin: 0; padding: 0; }
.list-group-item { padding: 16px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.list-group-item:hover { background: var(--gray-50); }
.list-group-item:last-child { border-bottom: none; }

.progress { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gradient-primary); transition: width var(--transition-normal); }
.progress-lg { height: 20px; }
.progress-bar-success { background: var(--gradient-success); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-danger  { background: var(--gradient-danger); }

/* ══════════════════════════════════════════════════════════════════════════
   14. 대시보드 그리드
   ══════════════════════════════════════════════════════════════════════════ */
.dashboard-grid { display: grid; gap: 24px; margin-top: 24px; }
.dashboard-grid-2-1 { grid-template-columns: 2fr 1fr; }
.dashboard-grid-1-1 { grid-template-columns: 1fr 1fr; }
.dashboard-grid-3   { grid-template-columns: repeat(3, 1fr); }

/* ══════════════════════════════════════════════════════════════════════════
   15. 로그인 · 외부 안내
   ══════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 50%, #1E293B 100%);
}
.login-page::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(circle at 15% 20%, rgba(59,130,246,.20) 0%, transparent 45%),
      radial-gradient(circle at 85% 80%, rgba(37,99,235,.16) 0%, transparent 45%);
}
.login-card {
    position: relative; width: 100%; max-width: 420px; padding: 40px;
    background: var(--bg-card); border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-logo-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff; background: var(--gradient-primary);
    box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.login-title { font-size: 1.15rem; font-weight: 700; letter-spacing: 0; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.login-subtitle { font-size: .85rem; color: var(--text-secondary); }

/* 외부 수신자(선주·선급)가 보는 안내 화면 — 사내 메뉴 없이 내용만 */
.notice-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: var(--bg-main);
}
.notice {
    width: 100%; max-width: 460px; padding: 40px; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl); box-shadow: var(--shadow-md);
}
.notice-icon {
    width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
    background: var(--gray-100); color: var(--text-secondary);
}
.notice.tone-blue  .notice-icon { background: var(--primary-100);   color: var(--primary-dark); }
.notice.tone-amber .notice-icon { background: var(--warning-light); color: var(--warning-dark); }
.notice.tone-red   .notice-icon { background: var(--danger-light);  color: var(--danger-dark); }
.notice-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.notice-msg { font-size: .95rem; line-height: 1.7; color: var(--text-secondary); }
.notice-contact {
    margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-color);
    font-size: .85rem; color: var(--text-muted);
}
.notice-trace { margin-top: 10px; font-size: .8rem; color: var(--text-muted); }
.notice-trace code {
    font-size: .8rem; padding: 2px 8px; background: var(--gray-100);
    border-radius: var(--border-radius-sm);
}

/* 외부 뷰어 (P08 / P08-M) */
.viewer-page { min-height: 100vh; background: var(--bg-main); padding: 32px 24px 64px; }
.viewer-wrap { max-width: 900px; margin: 0 auto; }

/* ══════════════════════════════════════════════════════════════════════════
   16. 그리드 & 유틸리티
   ══════════════════════════════════════════════════════════════════════════ */
.row { display: flex; flex-wrap: wrap; margin-left: -12px; margin-right: -12px; }
.row > * { padding-left: 12px; padding-right: 12px; width: 100%; }
.col { flex: 1 0 0%; width: auto; }
.col-auto { width: auto; flex: 0 0 auto; }
.col-1{width:8.3333%}.col-2{width:16.6667%}.col-3{width:25%}.col-4{width:33.3333%}
.col-5{width:41.6667%}.col-6{width:50%}.col-7{width:58.3333%}.col-8{width:66.6667%}
.col-9{width:75%}.col-10{width:83.3333%}.col-11{width:91.6667%}.col-12{width:100%}
@media (min-width: 768px) {
  .col-md-1{width:8.3333%}.col-md-2{width:16.6667%}.col-md-3{width:25%}.col-md-4{width:33.3333%}
  .col-md-5{width:41.6667%}.col-md-6{width:50%}.col-md-7{width:58.3333%}.col-md-8{width:66.6667%}
  .col-md-9{width:75%}.col-md-10{width:83.3333%}.col-md-11{width:91.6667%}.col-md-12{width:100%}
}
@media (min-width: 1024px) {
  .col-lg-1{width:8.3333%}.col-lg-2{width:16.6667%}.col-lg-3{width:25%}.col-lg-4{width:33.3333%}
  .col-lg-5{width:41.6667%}.col-lg-6{width:50%}.col-lg-7{width:58.3333%}.col-lg-8{width:66.6667%}
  .col-lg-9{width:75%}.col-lg-10{width:83.3333%}.col-lg-11{width:91.6667%}.col-lg-12{width:100%}
}

.text-center{text-align:center}.text-right,.text-end{text-align:right}.text-left,.text-start{text-align:left}
.text-muted{color:var(--text-muted)}.text-secondary{color:var(--text-secondary)}
.text-primary{color:var(--primary)}.text-success{color:var(--success)}
.text-danger{color:var(--danger)}.text-warning{color:var(--warning)}
.fw-normal{font-weight:400}.fw-medium{font-weight:500}.fw-semibold{font-weight:600}.fw-bold{font-weight:700}
.fs-sm{font-size:.85rem}.fs-base{font-size:1rem}.fs-lg{font-size:1.125rem}.fs-xl{font-size:1.25rem}
.small{font-size:.85rem}
.font-mono{font-family:ui-monospace,'Cascadia Mono',Consolas,monospace;font-size:.85rem}

.m-0{margin:0}.m-1{margin:4px}.m-2{margin:8px}.m-3{margin:16px}.m-4{margin:24px}.m-5{margin:32px}
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:16px}.mt-4{margin-top:24px}.mt-5{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:16px}.mb-4{margin-bottom:24px}.mb-5{margin-bottom:32px}
.ms-1{margin-left:4px}.ms-2{margin-left:8px}.ms-3{margin-left:16px}.ms-auto{margin-left:auto}
.me-1{margin-right:4px}.me-2{margin-right:8px}.me-auto{margin-right:auto}.mx-auto{margin-left:auto;margin-right:auto}
.p-0{padding:0}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:16px}.p-4{padding:24px}.p-5{padding:32px}
.pt-0{padding-top:0}.pt-2{padding-top:8px}.pt-3{padding-top:16px}.pt-4{padding-top:24px}
.pb-0{padding-bottom:0}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:16px}.pb-4{padding-bottom:24px}
.py-1{padding-top:4px;padding-bottom:4px}.py-2{padding-top:8px;padding-bottom:8px}
.py-3{padding-top:16px;padding-bottom:16px}.py-4{padding-top:24px;padding-bottom:24px}
.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}
.px-3{padding-left:16px;padding-right:16px}.px-4{padding-left:24px;padding-right:24px}

.d-none{display:none}.d-block{display:block}.d-inline{display:inline}.d-inline-block{display:inline-block}
.d-flex{display:flex}.d-inline-flex{display:inline-flex}.d-grid{display:grid}
.flex-row{flex-direction:row}.flex-column{flex-direction:column}
.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}
.flex-grow-1{flex-grow:1}.flex-shrink-0{flex-shrink:0}
.justify-content-start{justify-content:flex-start}.justify-content-center{justify-content:center}
.justify-content-end{justify-content:flex-end}.justify-content-between{justify-content:space-between}
.align-items-start{align-items:flex-start}.align-items-center{align-items:center}
.align-items-end{align-items:flex-end}.align-items-baseline{align-items:baseline}
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:16px}.gap-4{gap:24px}.gap-5{gap:32px}

.bg-white{background:#fff}.bg-light{background:var(--gray-50)}
.bg-transparent{background:transparent}.bg-primary-50{background:var(--primary-50)}
.border{border:1px solid var(--border-color)}.border-0{border:0}
.border-top{border-top:1px solid var(--border-color)}.border-bottom{border-bottom:1px solid var(--border-color)}
.rounded{border-radius:var(--border-radius)}.rounded-lg{border-radius:var(--border-radius-lg)}.rounded-0{border-radius:0}
.w-100{width:100%}.w-auto{width:auto}.h-100{height:100%}.h-auto{height:auto}
.position-relative{position:relative}.position-absolute{position:absolute}
.opacity-40{opacity:.4}.opacity-60{opacity:.6}.cursor-pointer{cursor:pointer}

/* ══════════════════════════════════════════════════════════════════════════
   17. 스크롤바
   ══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.sidebar-nav::-webkit-scrollbar { width: 4px; }

/* ══════════════════════════════════════════════════════════════════════════
   18. 반응형 (데스크톱 퍼스트 / max-width)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .header { left: 0; }
    /* ★ .sidebar-overlay 는 .sidebar 의 바로 다음 형제여야 한다 (+ 결합자) */
    .sidebar-overlay { display: none; position: fixed; inset: 0;
                       background: rgba(0,0,0,.5); z-index: 999; }
    .sidebar.open + .sidebar-overlay { display: block; }
    .dashboard-grid-2-1, .dashboard-grid-1-1, .dashboard-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    html { font-size: 13px; }
    .content-wrapper { padding: 16px; padding-top: calc(var(--header-height) + 16px); }
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-group, .filter-group.flex-grow { min-width: 0; width: 100%; }
    .filter-actions { width: 100%; }
    .filter-btn { flex: 1; justify-content: center; }
    .page-header, .page-header-gradient .d-flex { flex-direction: column; align-items: flex-start; }
    .detail-grid, .detail-grid-3, .detail-grid-4 { grid-template-columns: 1fr; }
    .detail-item.full-width { grid-column: span 1; }
    .card-body { padding: 16px; }
    .card-header, .card-footer { padding: 14px 16px; }
    .card .table th:first-child, .card .table td:first-child { padding-left: 14px; }
    .card .table th:last-child,  .card .table td:last-child  { padding-right: 14px; }
}

@media (max-width: 576px) {
    .stats-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   19. 인쇄
   ══════════════════════════════════════════════════════════════════════════ */
@media print {
    .sidebar, .header, .sidebar-overlay, .page-header-actions,
    .filter-section, .btn, .pagination { display: none !important; }
    .main-content { margin-left: 0; }
    .content-wrapper { padding: 0; padding-top: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* 외부 ID/PW 포털 - 내부 메뉴와 분리된 원본형 네이비 업무 포털 */
.external-portal-body { min-height: 100vh; background: #f1f5f9; color: #1f2937; }
.external-login-shell { display: grid; width: min(920px, calc(100% - 32px)); min-height: 500px; margin: max(7vh, 36px) auto; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(15, 32, 64, .12); }
.external-login-brand { display: flex; padding: 48px; justify-content: center; flex-direction: column; background: #0f2040; color: #fff; }
.external-login-brand > span { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 48px; color: #bfdbfe; font-weight: 700; }
.external-login-brand h1 { max-width: 420px; color: #fff; font-size: 30px; line-height: 1.25; }
.external-login-brand p { max-width: 430px; margin-top: 14px; color: #cbd5e1; line-height: 1.75; }
.external-login-form { display: flex; padding: 42px; justify-content: center; flex-direction: column; }
.external-login-form h2 { color: #0f2040; font-size: 22px; }
.external-login-form > p { margin: 5px 0 24px; color: #64748b; font-size: 13px; }
.external-login-form label,
.portal-password-shell label { display: grid; gap: 5px; margin-bottom: 14px; color: #475569; font-size: 12px; font-weight: 600; }
.external-login-form input,
.portal-password-shell input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #1f2937; font: inherit; }
.external-login-form input:focus,
.portal-password-shell input:focus { border-color: #2563eb; outline: 0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.external-login-form > button,
.portal-password-shell button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 5px; background: #2563eb; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.external-login-form > a { margin-top: 18px; color: #64748b; font-size: 12px; text-align: center; }
.portal-password-shell { display: flex; min-height: 100vh; padding: 24px; align-items: center; justify-content: center; }
.portal-password-shell form { width: min(410px, 100%); padding: 34px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(15, 32, 64, .1); }
.portal-mark { display: flex; width: 42px; height: 42px; margin-bottom: 15px; align-items: center; justify-content: center; border-radius: 6px; background: #dbeafe; color: #1d4ed8; font-size: 22px; }
.portal-password-shell h1 { color: #0f2040; font-size: 21px; }
.portal-password-shell p { margin: 6px 0 22px; color: #64748b; font-size: 13px; }
.portal-password-shell small { display: block; margin: -4px 0 16px; color: #64748b; }
.portal-password-shell button { width: 100%; }
.portal-shell { min-height: 100vh; }
.portal-header { display: flex; height: 58px; padding: 0 max(24px, calc((100% - 1180px) / 2)); align-items: center; justify-content: space-between; background: #0f2040; color: #fff; }
.portal-header > a { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.portal-header > div { display: flex; align-items: center; gap: 10px; color: #cbd5e1; font-size: 12px; }
.portal-header > div a,
.portal-header button { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: transparent; color: #fff; cursor: pointer; }
.portal-header form { display: flex; }
.portal-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.portal-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.portal-title h1 { color: #0f2040; font-size: 22px; }
.portal-title p { color: #64748b; font-size: 13px; }
.portal-document-layout { display: grid; min-height: 440px; grid-template-columns: minmax(0, 1fr) 350px; overflow: hidden; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; }
.portal-document-list { border-right: 1px solid #e2e8f0; }
.portal-document-list > a { display: flex; min-height: 78px; padding: 13px 16px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef2f7; color: #1f2937; }
.portal-document-list > a:hover,
.portal-document-list > a.active { background: #eff6ff; text-decoration: none; }
.portal-document-list > a.active { box-shadow: inset 3px 0 #2563eb; }
.portal-document-list b,
.portal-document-list span,
.portal-document-list small { display: block; overflow-wrap: anywhere; }
.portal-document-list b { color: #0f2040; }
.portal-document-list span { margin-top: 2px; font-weight: 600; }
.portal-document-list small { margin-top: 3px; color: #64748b; font-size: 11px; }
.portal-document-list em { padding: 2px 8px; border-radius: 4px; background: #dcfce7; color: #15803d; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.portal-document-list > p,
.portal-file-panel > p { padding: 28px; color: #64748b; text-align: center; }
.portal-file-panel { padding: 18px; background: #f8fafc; }
.portal-file-panel h2 { margin-bottom: 13px; color: #0f2040; font-size: 15px; }
.portal-file-panel > a { display: flex; gap: 9px; margin-bottom: 7px; padding: 10px; border: 1px solid #dbe3ee; border-radius: 6px; background: #fff; color: #1f2937; }
.portal-file-panel > a:hover { border-color: #93c5fd; text-decoration: none; }
.portal-file-panel > a i { color: #2563eb; font-size: 20px; }
.portal-file-panel b,
.portal-file-panel small { display: block; overflow-wrap: anywhere; }
.portal-file-panel small { color: #64748b; font-size: 10px; }

@media (max-width: 760px) {
    .external-login-shell { min-height: 0; grid-template-columns: 1fr; margin: 16px auto; }
    .external-login-brand { padding: 26px; }
    .external-login-brand > span { margin-bottom: 22px; }
    .external-login-brand h1 { font-size: 23px; }
    .external-login-form { padding: 28px 24px; }
    .portal-header { padding: 0 16px; }
    .portal-header > a span,
    .portal-header > div > span { display: none; }
    .portal-document-layout { grid-template-columns: 1fr; }
    .portal-document-list { border-right: 0; border-bottom: 1px solid #e2e8f0; }
}
/* EC07 code governance */
.code-rule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border-color);background:#fff;margin-bottom:16px}
.code-rule-grid>div{padding:14px;border-right:1px solid var(--border-color);display:flex;flex-direction:column;gap:4px}
.code-rule-grid>div:last-child{border-right:0}.code-rule-grid b{font-size:13px;color:#111827}.code-rule-grid span{font-size:12px;color:#64748b;line-height:1.5}
.code-editor-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:16px}.code-desc-field{grid-column:span 2}
.code-remark-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px;grid-column:span 2}.code-editor-form .filter-actions{grid-column:1/-1}
.code-remarks{min-width:170px}.code-remarks span{display:block;font-size:11px;color:#64748b}.code-mapping summary{cursor:pointer;list-style:none}.code-mapping .admin-table-wrap{max-height:520px;overflow:auto}
.compose-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.compose-section{margin:0}.compose-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px}.compose-wide{grid-column:1/-1}.compose-message{grid-column:1/-1}.compose-actions{display:flex;justify-content:flex-end;gap:8px;padding:0 16px 16px}.recipient-picker{margin:0 16px 12px;border:1px solid var(--border-color);padding:10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.recipient-picker>div{grid-column:1/-1;display:flex;gap:8px;align-items:baseline}.recipient-picker>div span{font-size:11px;color:var(--text-muted)}.recipient-option{display:flex;gap:8px;align-items:center;padding:8px;background:var(--gray-50);border:1px solid var(--border-color)}.recipient-option[hidden]{display:none}.recipient-option span{display:flex;flex-direction:column;min-width:0}.recipient-option small{overflow:hidden;text-overflow:ellipsis}.approval-line-readonly{margin:0 16px 16px;padding:12px;background:var(--gray-50);border:1px solid var(--border-color)}.approval-line-readonly>span{display:block;font-size:11px;color:var(--text-muted);margin-bottom:8px}.approval-line-option{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.approval-line-option[hidden]{display:none}.approval-line-option span{display:inline-flex;align-items:center;gap:5px}.approval-line-option b{font-size:11px;background:var(--primary-100);color:var(--primary-darker);padding:2px 6px}.approval-line-option em{font-size:12px;font-style:normal}
.compose-translation-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;border:1px solid #bfd2f5;border-radius:6px;background:#f4f8ff}.compose-translation-toolbar>div{display:flex;align-items:center;gap:9px}.compose-translation-toolbar strong{color:#174ea6;font-size:13px}.compose-translation-toolbar strong i{margin-right:5px}.compose-translation-toolbar span{color:var(--text-muted);font-size:11px}.compose-lang-badge{flex:0 0 auto;padding:4px 9px;border-radius:4px;background:#174ea6;color:#fff!important;font-size:11px!important;font-weight:700}.compose-translation-compare{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}.compose-translation-compare.is-translating{grid-template-columns:repeat(2,minmax(0,1fr))}.compose-translation-panel{display:flex;min-width:0;flex-direction:column;gap:7px}.compose-translation-panel[hidden]{display:none}.compose-translation-result{display:flex;min-height:32px;align-items:center;justify-content:space-between;gap:12px;padding:7px 9px;border:1px solid var(--border-color);border-radius:5px;background:var(--gray-50)}.compose-translation-result>span{color:var(--text-muted);font-size:11px;line-height:1.45}.compose-translation-result>span.warning{color:#a85b00}.compose-translation-result>span.is-reviewed{color:#0b6b59;font-weight:700}.compose-review-check{flex:0 0 auto;margin:0}.compose-translation-note{display:flex;align-items:center;gap:7px;color:var(--text-muted);font-size:11px}.compose-translation-note i{color:#2563eb;font-size:15px}
.comment-entry-form .wf-card-body{display:flex;gap:8px;align-items:flex-end}.comment-entry-form textarea{flex:1}.comment-inline-reply{display:grid;grid-template-columns:1fr auto;gap:4px}.comment-inline-reply textarea,.comment-inline-reply select,.comment-inline-reply input[type=file]{min-width:0;width:100%;font-size:11px;border:1px solid var(--border-color)}.comment-inline-reply input[type=file]{grid-column:1/-1}.comment-inline-reply button{border:0;background:var(--primary);color:#fff}
.correspondence-stats{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--border-color);background:#fff;margin-bottom:12px}.correspondence-stats>div{padding:12px 16px;border-right:1px solid var(--border-color);display:flex;align-items:baseline;gap:8px}.correspondence-stats>div:last-child{border:0}.correspondence-stats b{font-size:22px}.correspondence-stats span{font-size:12px;color:var(--text-muted)}
@media(max-width:900px){.code-rule-grid{grid-template-columns:1fr 1fr}.code-rule-grid>div:nth-child(2){border-right:0}.code-editor-form{grid-template-columns:1fr 1fr}.code-desc-field,.code-remark-pair{grid-column:span 2}}
@media(max-width:900px){.compose-grid{grid-template-columns:1fr}.compose-message{grid-column:1}}
@media(max-width:600px){.code-rule-grid,.code-editor-form,.compose-fields,.compose-translation-compare.is-translating{grid-template-columns:1fr}.code-rule-grid>div{border-right:0;border-bottom:1px solid var(--border-color)}.code-desc-field,.code-remark-pair,.compose-wide{grid-column:1}.code-remark-pair,.recipient-picker{grid-template-columns:1fr}.compose-translation-toolbar,.compose-translation-toolbar>div,.compose-translation-result{align-items:flex-start;flex-direction:column}.compose-review-check{width:100%}}

/* 0822 운영 UI: P10 / EC-M1 / EC-M2 / EC01 / P19 / P23 */
.icon-btn{display:inline-flex;width:34px;height:34px;align-items:center;justify-content:center;border:1px solid var(--border-color);border-radius:6px;background:#fff;color:var(--text-secondary);cursor:pointer}.icon-btn:hover{border-color:var(--primary);color:var(--primary);text-decoration:none}
.segmented-control{display:inline-flex;overflow:hidden;border:1px solid var(--border-color);border-radius:6px;background:#fff}.segmented-control a,.segmented-control button{display:inline-flex;min-height:34px;align-items:center;justify-content:center;gap:6px;padding:6px 13px;border:0;border-right:1px solid var(--border-color);background:#fff;color:var(--text-secondary);font:inherit;font-size:13px;cursor:pointer}.segmented-control a:last-child,.segmented-control button:last-child{border-right:0}.segmented-control .is-active{background:#17396b;color:#fff;text-decoration:none}
.external-account-stage-filter{display:flex;align-items:center;gap:12px;margin-bottom:16px}.external-account-stage-label{display:inline-flex;align-items:center;gap:6px;color:var(--text-secondary);font-size:12px;font-weight:700}.external-account-stage-label i{color:#2563eb;font-size:16px}.external-account-stage-filter .segmented-control a{min-width:78px}

.correspondence-kpis{display:grid;grid-template-columns:repeat(8,minmax(92px,1fr));gap:8px;margin-bottom:10px}.correspondence-kpis a{display:flex;min-height:72px;flex-direction:column;align-items:center;justify-content:center;border:1px solid #cbd5e1;border-top:3px solid #17396b;border-radius:7px;background:#fff;color:#17396b}.correspondence-kpis a:hover,.correspondence-kpis a.is-active{box-shadow:var(--shadow);text-decoration:none;transform:translateY(-1px)}.correspondence-kpis a.is-active{outline:2px solid currentColor;outline-offset:-2px}.correspondence-kpis b{font-size:22px;line-height:1.1}.correspondence-kpis span{margin-top:5px;font-size:12px;font-weight:600}.correspondence-kpis .is-send{border-top-color:#2563eb;color:#1d4ed8}.correspondence-kpis .is-recv,.correspondence-kpis .is-approved{border-top-color:#16a34a;color:#15803d}.correspondence-kpis .is-general{border-top-color:#0d9488;color:#0f766e}.correspondence-kpis .is-approval{border-top-color:#7c3aed;color:#6d28d9}.correspondence-kpis .is-pending{border-top-color:#d97706;color:#b45309}.correspondence-kpis .is-rejected{border-top-color:#dc2626;color:#b91c1c}
.correspondence-audience-row{display:flex;align-items:center;gap:8px;margin-bottom:12px}.correspondence-audience-row>span{padding:7px 11px;border:1px solid var(--border-color);border-radius:6px;background:#fff;color:var(--text-secondary);font-size:12px}.correspondence-audience-row>span b{color:var(--text-primary)}.unmatched-shortcut{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:8px 12px;border:1px solid #f59e0b;border-radius:6px;background:#fffbeb;color:#92400e;font-size:12px;font-weight:600}.unmatched-shortcut:hover{background:#fef3c7;text-decoration:none}
.unmatched-strip{display:flex;align-items:center;gap:8px;overflow-x:auto;margin-bottom:12px;padding:9px 11px;border:1px solid #fcd34d;border-radius:7px;background:#fffbeb}.unmatched-strip>strong{flex:0 0 auto;color:#92400e;font-size:12px}.unmatched-strip>a{display:flex;max-width:270px;flex:0 0 auto;flex-direction:column;padding:6px 9px;border:1px solid #fde68a;border-radius:5px;background:#fff;color:var(--text-secondary)}.unmatched-strip>a span{font-size:10px}.unmatched-strip>a b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.correspondence-table{min-width:1300px}

.matching-chain{display:flex;align-items:center;gap:7px;margin-bottom:14px;padding:10px 12px;border:1px solid var(--border-color);border-radius:7px;background:#f8fafc;font-size:12px}.matching-chain span{font-weight:700}.matching-chain b{color:#1d4ed8}.matching-chain em{margin-left:auto;color:var(--text-muted);font-style:normal}.matching-queue-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.matching-queue-item{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;border:1px solid var(--border-color);border-radius:7px;background:#fff}.matching-queue-item.is-selected{border-color:#2563eb;background:#eff6ff}.matching-queue-icon{display:flex;width:40px;height:40px;align-items:center;justify-content:center;border-radius:50%;background:#fff7ed;color:#c2410c;font-size:19px}.matching-queue-copy b,.matching-queue-copy span,.matching-queue-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.matching-queue-copy span{color:var(--text-secondary);font-size:12px}.matching-queue-copy small{color:var(--text-muted);font-size:11px}.matching-queue-actions{display:flex;align-items:center;gap:6px}.matching-queue-actions form{margin:0}
.matching-dialog-backdrop{position:fixed;z-index:1100;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(15,32,64,.58)}.matching-dialog-panel{width:min(900px,100%);max-height:calc(100vh - 40px);overflow:auto;border-radius:8px;background:#fff;box-shadow:0 20px 60px rgba(15,23,42,.28)}.matching-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border-color)}.matching-dialog-header>div{display:flex;align-items:center;gap:9px}.matching-dialog-header h2{margin:0;font-size:18px}.matching-mail-summary{display:grid;grid-template-columns:1fr 2fr 1fr;gap:10px;padding:14px 18px;background:#fffbeb}.matching-mail-summary dl{margin:0;min-width:0}.matching-mail-summary dt{color:#92400e;font-size:10px}.matching-mail-summary dd{margin:2px 0 0;overflow-wrap:anywhere;font-size:12px;font-weight:600}.matching-search{display:grid;grid-template-columns:1fr 1fr 1fr auto;align-items:end;gap:8px;padding:14px 18px;border-bottom:1px solid var(--border-color)}.matching-search label{display:flex;min-width:0;flex-direction:column;gap:4px}.matching-search label span{font-size:11px;font-weight:600}.matching-results{max-height:340px;overflow:auto;padding:0 18px}.matching-dialog-footer{padding:14px 18px;border-top:1px solid var(--border-color);background:#f8fafc}.matching-register-form{display:flex;align-items:center;justify-content:flex-end;gap:8px}.matching-register-form select{max-width:230px}

.stats-title-row{display:flex;align-items:center;gap:9px}.preview-badge{display:inline-flex;padding:3px 8px;border:1px solid #f59e0b;border-radius:4px;background:#fffbeb;color:#92400e;font-size:11px;font-weight:700;text-transform:uppercase}.manual-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:14px}.manual-kpi-grid>a,.manual-kpi-grid>div{display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;gap:0 8px;align-items:center;min-height:82px;padding:12px 14px;border:1px solid #bfdbfe;border-left:4px solid #2563eb;border-radius:7px;background:#eff6ff;color:#1e3a8a}.manual-kpi-grid>a:hover{text-decoration:none;transform:translateY(-1px);box-shadow:var(--shadow)}.manual-kpi-grid i{grid-row:1/3;font-size:24px}.manual-kpi-grid b{font-size:23px;line-height:1}.manual-kpi-grid b small{font-size:12px}.manual-kpi-grid span{font-size:11px;font-weight:600}.manual-kpi-grid .is-danger{border-color:#fecaca;border-left-color:#dc2626;background:#fef2f2;color:#991b1b}.manual-kpi-grid .is-success{border-color:#bbf7d0;border-left-color:#16a34a;background:#f0fdf4;color:#166534}.manual-kpi-grid .is-average{border-color:#ddd6fe;border-left-color:#7c3aed;background:#f5f3ff;color:#5b21b6}.stats-operation-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.8fr);gap:14px}.vessel-bars{padding:14px 16px}.vessel-bar-row+ .vessel-bar-row{margin-top:13px}.vessel-bar-row>div:first-child{display:flex;justify-content:space-between;gap:8px;margin-bottom:5px;font-size:12px}.vessel-bar-row span{color:var(--text-secondary)}.vessel-bar-row em{color:#dc2626;font-style:normal}.vessel-bar-track{height:9px;overflow:hidden;border-radius:4px;background:#e2e8f0}.vessel-bar-track span{display:block;height:100%;border-radius:inherit;background:#2563eb}.vessel-bar-track span.has-delay{background:#d97706}.delay-days{color:#b91c1c}.delayed-top-card .table{margin:0}
.admin-tab-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px}.recipient-vessel-filter{display:flex;align-items:center;gap:6px;margin-left:auto}.recipient-vessel-filter .filter-input{max-width:180px}.mail-audience-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}.mail-audience-tabs>a{display:flex;align-items:center;gap:11px;padding:12px 15px;border:1px solid var(--border-color);border-left:4px solid #94a3b8;border-radius:7px;background:#fff;color:var(--text-secondary)}.mail-audience-tabs>a:hover,.mail-audience-tabs>a.is-active{text-decoration:none;border-left-color:#2563eb;background:#eff6ff;color:#1d4ed8}.mail-audience-tabs i{font-size:22px}.mail-audience-tabs b,.mail-audience-tabs small{display:block}.mail-audience-tabs small{margin-top:2px;font-size:10px}
.team-view-toggle{align-self:center}.team-list-table{min-width:780px}

@media(max-width:1100px){.correspondence-kpis{grid-template-columns:repeat(4,minmax(92px,1fr))}.manual-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.stats-operation-grid{grid-template-columns:1fr}.matching-queue-grid{grid-template-columns:1fr}}
@media(max-width:700px){.correspondence-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.correspondence-audience-row{align-items:stretch;flex-wrap:wrap}.unmatched-shortcut{width:100%;margin-left:0}.manual-kpi-grid{grid-template-columns:1fr}.matching-mail-summary,.matching-search{grid-template-columns:1fr}.matching-register-form{align-items:stretch;flex-direction:column}.matching-register-form select,.matching-register-form button{width:100%;max-width:none}.admin-tab-toolbar{align-items:stretch;flex-direction:column}.recipient-vessel-filter{margin-left:0}.mail-audience-tabs{grid-template-columns:1fr}.matching-chain{align-items:flex-start;flex-wrap:wrap}.matching-chain em{width:100%;margin-left:0}.external-account-stage-filter{align-items:flex-start;flex-direction:column}.external-account-stage-filter .segmented-control{display:grid;width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}.external-account-stage-filter .segmented-control a{min-width:0}}

/* 0822 통합 로그인/계정 보안 */
.login-help { margin-top: 18px; border-top: 1px solid var(--border-color, #dfe3e8); padding-top: 14px; }
.login-help summary { color: #45515f; cursor: pointer; font-size: 13px; }
.login-help-form { margin-top: 12px; }
.login-help-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.header-language { display: inline-flex; align-items: center; gap: 6px; color: #46515f; }
.header-language select { min-width: 92px; height: 34px; border: 1px solid #d7dde4; border-radius: 4px; background: #fff; padding: 0 26px 0 8px; }
.account-password-page { max-width: 760px; margin: 0 auto; }
.account-password-panel { max-width: 520px; padding: 24px; border: 1px solid #dce2e8; border-radius: 6px; background: #fff; }
.account-password-form { display: grid; gap: 16px; }
.temporary-password-alert { align-items: center; gap: 10px; }
.temporary-password-alert strong { font-family: Consolas, monospace; font-size: 16px; letter-spacing: 0; user-select: all; }
.comment-upload { position: relative; display: flex; min-width: 96px; min-height: 42px; align-items: center; justify-content: center; gap: 6px; border: 1px dashed #aab4c0; border-radius: 5px; padding: 6px 8px; cursor: pointer; color: #52606d; }
.comment-upload.is-dragging { border-color: var(--primary); background: var(--primary-50); }
.comment-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.comment-upload img { width: 38px; height: 38px; object-fit: cover; border-radius: 3px; }
.comment-upload span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.comment-image-thumb { display: block; width: 72px; height: 52px; margin-top: 6px; padding: 0; overflow: hidden; border: 1px solid #cfd6de; border-radius: 4px; background: #fff; cursor: zoom-in; }
.comment-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.comment-delete-form { display: inline-flex; margin-top: 6px; }
.comment-image-dialog { width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 6px; padding: 44px 12px 12px; background: #fff; }
.comment-image-dialog::backdrop { background: rgba(17, 24, 39, .72); }
.comment-image-dialog > button { position: absolute; top: 8px; right: 8px; }
.comment-image-dialog > img { display: block; max-width: 100%; max-height: calc(100vh - 88px); margin: 0 auto; object-fit: contain; }
.submission-mail-review { display: grid; gap: 7px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #dde3e9; }
.submission-recipient-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid #e3e8ee; }
.submission-recipient-chips span { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.submission-recipient-chips .to { background: #e7f0ff; color: #174ea6; }
.submission-recipient-chips .cc { background: #eef1f4; color: #46515f; }
.untranslated-link { display: inline-flex; gap: 4px; margin: 0 4px; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.term-chat-log { display: flex; min-height: 110px; max-height: 280px; overflow: auto; flex-direction: column; gap: 8px; padding: 14px; background: #f6f8fa; border: 1px solid #e0e5ea; }
.term-chat-message { max-width: 78%; padding: 9px 11px; border-radius: 6px; white-space: pre-wrap; line-height: 1.45; }
.term-chat-message.user { align-self: flex-end; background: #174ea6; color: #fff; }
.term-chat-message.assistant { align-self: flex-start; background: #fff; border: 1px solid #d8dee5; color: #26313d; }
.term-chat-message.error { color: #a12822; }
.term-chat-compose textarea { min-width: min(620px, 100%); }
.term-chat-register { margin-top: 10px; }
.term-language-row td { background:#f8fafc;padding-top:8px;padding-bottom:10px; }
.term-language-list { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px; }
.term-language-list span { display:inline-flex;align-items:center;gap:6px;border:1px solid #d8dee5;background:#fff;padding:4px 7px;border-radius:4px; }
.term-language-list b { color:#174ea6;font-size:11px; }
.term-language-list i { font-style:normal;color:#374151;font-size:12px; }
.term-usage-link { display: inline-flex; min-width: 30px; justify-content: center; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.vessel-excel-actions { display: flex; align-items: center; gap: 7px; }
.vessel-excel-actions form { margin: 0; }
.vessel-excel-actions input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.vessel-code-input { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 5px; }
@media (max-width: 640px) {
  .header-language i { display: none; }
  .header-language select { min-width: 78px; max-width: 96px; }
  .login-help-row { grid-template-columns: 1fr; }
}

/* GlobalEcho Pro2 semantic state object and keyboard focus policy. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.st {
    --st-bg: var(--neutral-3);
    --st-fg: var(--neutral-10);
    --st-line: var(--neutral-5);
    display: inline-flex;
    min-height: 22px;
    padding: 2px 7px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--st-line);
    border-radius: var(--radius-sm);
    background: var(--st-bg);
    color: var(--st-fg);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.st::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.st-neutral { --st-bg: var(--neutral-3); --st-fg: var(--neutral-10); --st-line: var(--neutral-5); }
.st-progress { --st-bg: var(--accent-2); --st-fg: var(--accent-10); --st-line: var(--accent-5); }
.st-done { --st-bg: var(--exec-2); --st-fg: var(--exec-10); --st-line: var(--exec-5); }
.st-action { --st-bg: var(--support-2); --st-fg: var(--support-10); --st-line: var(--support-5); }
.st-back { --st-bg: var(--danger-2); --st-fg: var(--danger-10); --st-line: var(--danger-5); }
.st-target { border-style: dashed; }
.st-solid { border-color: var(--st-fg); background: var(--st-fg); color: #fff; }

.toast-stack {
    position: fixed;
    top: 52px;
    right: 14px;
    z-index: 6000;
    display: grid;
    width: min(360px, calc(100vw - 28px));
    gap: 8px;
}
.toast {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-panel);
    box-shadow: var(--shadow-lg);
}
.toast::before { background: var(--accent-9); content: ""; }
.toast.is-success::before { background: var(--exec-9); }
.toast.is-warning::before { background: var(--support-9); }
.toast.is-danger::before { background: var(--danger-9); }
.toast-body { min-width: 0; padding: 11px 12px; }
.toast-body strong, .toast-body span { display: block; }
.toast-body strong { color: var(--text-primary); font-size: .86rem; }
.toast-body span { margin-top: 2px; color: var(--text-secondary); font-size: .78rem; line-height: 1.45; }
.toast-close { width: 34px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.mail-raw-body {
  margin: 16px 0 0;
  padding: 18px;
  border: 1px solid #d9dee7;
  background: #f8fafc;
  color: #202b3c;
  font: 13px/1.7 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.workflow-total {
  min-width: 78px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.workflow-guide {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #d9dee7;
  background: #fff;
  color: #334155;
}

.workflow-guide > span { font-size: 13px; }
.workflow-guide > i { color: #8792a2; }

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.workflow-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 92px;
  border: 1px solid #d9dee7;
  background: #fff;
}

.workflow-row.is-locked { background: #f6f7f9; }

.workflow-code {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: #17365d;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.workflow-copy { min-width: 0; padding: 14px 16px; }
.workflow-copy small { display: block; margin-bottom: 4px; color: #647084; font-size: 11px; }
.workflow-copy h3 { margin: 0 0 7px; font-size: 15px; line-height: 1.35; }
.workflow-copy span { color: #0b6b59; font-size: 11px; font-weight: 700; }

.workflow-open {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #17365d;
  text-decoration: none;
}

@media (max-width: 860px) {
  .workflow-guide { grid-template-columns: 1fr; }
  .workflow-guide > i { transform: rotate(90deg); justify-self: center; }
  .workflow-list { grid-template-columns: 1fr; }
}
/* P07 final-mail preview: mirrors the information visible in Outlook and webmail. */
.submission-mail-preview { margin-top: 14px; border: 1px solid #cfd8e6; background: #fff; }
.submission-mail-preview header { display: flex; align-items: center; gap: 7px; padding: 10px 13px; border-bottom: 1px solid #dfe6ef; color: #1c3150; background: #f5f8fc; }
.submission-mail-preview header span { margin-left: auto; color: #6d7d92; font-size: 11px; }
.submission-mail-preview dl { display: grid; grid-template-columns: 58px 1fr; margin: 0; padding: 10px 14px; border-bottom: 1px solid #e5eaf1; font-size: 12px; }
.submission-mail-preview dt { color: #748399; font-weight: 700; }
.submission-mail-preview dd { min-width: 0; margin: 0; color: #26364d; overflow-wrap: anywhere; }
.submission-preview-body { min-height: 92px; padding: 14px; color: #26364d; line-height: 1.6; white-space: pre-wrap; }
.submission-preview-files { padding: 10px 14px; border-top: 1px solid #e5eaf1; color: #526174; font-size: 12px; }
.submission-preview-files ul { margin: 5px 0 0; padding-left: 18px; }
.submission-preview-drawings { padding: 10px 14px; border-top: 1px solid #e5eaf1; font-size: 12px; }
.submission-preview-drawings table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.submission-preview-drawings th,
.submission-preview-drawings td { padding: 7px 8px; border: 1px solid #dce3ec; text-align: left; }
.submission-preview-drawings th { background: #f4f7fb; color: #526174; }
.submission-mail-preview footer { display: flex; flex-direction: column; gap: 3px; padding: 9px 14px; border-top: 1px solid #e5eaf1; color: #76869a; background: #fafbfd; font-size: 10px; }
.submission-mail-preview footer strong { color: #17365d; font-size: 13px; }
