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

/* ══════════════════════════════════════════════════════════════════════════
   1. 토큰
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Primary: Deep Blue Professional ── */
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-darker: #1E40AF;
    --primary-light: #60A5FA;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;

    /* ── Secondary ── */
    --secondary: #64748B;
    --secondary-dark: #475569;
    --secondary-light: #94A3B8;

    /* ── Status ── */
    --success: #059669;  --success-light: #D1FAE5;  --success-dark: #047857;
    --warning: #D97706;  --warning-light: #FEF3C7;  --warning-dark: #B45309;
    --danger:  #DC2626;  --danger-light:  #FEE2E2;  --danger-dark:  #B91C1C;
    --info:    #0891B2;  --info-light:    #CFFAFE;  --info-dark:    #0E7490;

    /* ── Neutral: Slate ── */
    --gray-50:  #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* ── Background ── */
    --bg-main: #F9FAFB;
    --bg-primary: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-sidebar-hover: #F3F4F6;
    --bg-sidebar-active: #EFF6FF;
    --bg-input: #FFFFFF;

    /* ── Sidebar text ── */
    --sidebar-text: #4B5563;
    --sidebar-text-muted: #6B7280;
    --sidebar-border: #E5E7EB;

    /* ── Text ── */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #FFFFFF;
    --text-heading: #1E293B;

    /* ── Border & Radius ── */
    --border-color: #E2E8F0;
    --border-color-dark: #CBD5E1;
    --border-input: #CBD5E1;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* ── Shadow ── */
    --shadow-xs: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
    --shadow:    0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,.05);

    /* ── Gradient (작은 면적 전용) ── */
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --gradient-primary-hover: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    --gradient-header: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-danger: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    --gradient-sidebar: #FFFFFF;

    /* ── Layout ── */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;

    /* ── Motion ── */
    --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 ── */
    --focus-ring:         0 0 0 3px rgba(37, 99, 235, .25);
    --focus-ring-danger:  0 0 0 3px rgba(220, 38, 38, .25);
    --focus-ring-success: 0 0 0 3px rgba(5, 150, 105, .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;
}

/* 원본 P02의 프로젝트별 상단 내비게이션을 공통 셸로 승격한다. */
.project-context {
    display: flex; min-height: 48px; margin-bottom: 14px; padding: 7px 12px;
    align-items: center; gap: 14px; overflow-x: auto;
    border: 1px solid #E5E7EB; border-radius: 6px; background: #F1F5F9;
}
.project-context-name {
    display: inline-flex; min-width: 190px; align-items: center; gap: 7px;
    color: #0F2040; font-size: .9rem; font-weight: 700; white-space: nowrap;
}
.project-context-name:hover { color: #2563EB; text-decoration: none; }
.project-context-name small {
    padding: 1px 6px; border-radius: 3px; background: #DBEAFE;
    color: #1D4ED8; font-size: .68rem; font-weight: 700;
}
.project-context-links { display: flex; align-items: center; gap: 4px; }
.project-context-links a {
    padding: 5px 9px; border-bottom: 2px solid transparent;
    color: #6B7280; font-size: .78rem; white-space: nowrap;
}
.project-context-links a:hover {
    border-bottom-color: #2563EB; color: #2563EB; text-decoration: none;
}
.project-context-change {
    display: inline-flex; margin-left: auto; align-items: center; gap: 4px;
    color: #64748B; font-size: .74rem; white-space: nowrap;
}

@media (max-width: 760px) {
    .project-context { align-items: flex-start; flex-direction: column; }
    .project-context-links { width: 100%; overflow-x: auto; }
    .project-context-change { margin-left: 0; }
}

.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: -.01em; 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: .1em; 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: -.02em;
    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 {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius); padding: 12px 16px;
    margin-bottom: 16px; box-shadow: none; overflow: hidden;
}
.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: .04em; 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: .02em;
    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: -.02em;
                   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: .04em; 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: 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: .04em; 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: -.02em; }
.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; }
}
