/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f6fa; color: #333; font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== Login Page ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #1a2a4a 0%, #2c3e6b 100%); }
.login-box { background: #fff; padding: 48px 40px; border-radius: 12px; text-align: center; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-box h1 { color: #1a2a4a; font-size: 24px; margin-bottom: 4px; }
.login-box h2 { color: #888; font-size: 14px; font-weight: 400; margin-bottom: 32px; }
.login-box input[type="password"],
.login-box input[type="text"] { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.login-box input:focus { outline: none; border-color: #1a2a4a; }
.login-box button { width: 100%; padding: 12px; background: #1a2a4a; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; transition: background 0.2s; }
.login-box button:hover { background: #2c3e6b; }
.login-box .error { color: #e74c3c; font-size: 13px; margin-bottom: 16px; }
.login-box .notice { color: #1a7a3a; font-size: 13px; margin-bottom: 16px; }
.login-box .login-links { margin-top: 18px; font-size: 13px; }
.login-box .login-links a { color: #1a2a4a; text-decoration: underline; }
.login-box .login-links a:hover { color: #2c3e6b; }

/* ===== Admin Layout ===== */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 240px; background: #1a2a4a; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-home-link { text-decoration: none; display: block; }
.sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-title-row .sidebar-home-link { flex: 1; min-width: 0; }
.sidebar-header h1 { font-size: 18px; color: #c9a96e; }
.sidebar-header p { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.sidebar-logout-btn { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); font-size: 11px; font-weight: 500; transition: all 0.2s; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.15); }
.sidebar-logout-btn:hover { background: rgba(231,76,60,0.3); color: #fff; border-color: rgba(231,76,60,0.5); }
.sidebar-subtitle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.sidebar-subtitle-row .sidebar-home-link { flex: 1; min-width: 0; }
.sidebar-username { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 500; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: 4px 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.nav-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.35); padding: 7px 20px 3px; }
.nav-section-title:first-child { padding-top: 4px; }
.nav-item { display: flex; align-items: center; padding: 5px 20px; color: rgba(255,255,255,0.7); transition: all 0.2s; gap: 10px; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(201,169,110,0.25); color: #c9a96e; border-left: 3px solid #c9a96e; font-weight: 600; }
.nav-icon { font-size: 16px; width: 24px; text-align: center; }
.nav-label { font-size: 13px; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1); padding: 8px 0; }

/* Mobile Nav Toggle (햄버거) — 데스크톱에서는 숨김, 모바일에서만 노출 */
.mobile-nav-toggle { display: none; position: fixed; top: 10px; left: 10px; z-index: 101;
    width: 40px; height: 40px; padding: 0; border: none; border-radius: 8px;
    background: #1a2a4a; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.mobile-nav-toggle span { display: block; width: 20px; height: 2px; margin: 4px auto;
    background: #fff; border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
body.nav-open .mobile-nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .mobile-nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99; }

/* Mobile Top Bar (사이트명 + 루트 링크) — PC 에서는 숨김, 모바일 @media 에서 노출 */
.mobile-topbar { display: none; }

/* Main Content */
.main-content { margin-left: 240px; flex: 1; padding: 24px 32px; min-height: 100vh; min-width: 0; overflow-x: hidden; }

/* Page Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e0e0e0; }
.page-header h2 { font-size: 20px; color: #1a2a4a; }
.version-badge { font-size: 12px; color: #c9a96e; background: rgba(201,169,110,0.12); border: 1px solid rgba(201,169,110,0.35); padding: 3px 10px; border-radius: 12px; font-weight: 500; }
.page-header-actions { display: flex; align-items: center; gap: 10px; }
.pwa-install-btn { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 12px; background: rgba(201,169,110,0.12); color: #c9a96e; font-size: 12px; font-weight: 600; border: 1px solid rgba(201,169,110,0.35); cursor: pointer; transition: background 0.2s; }
.pwa-install-btn:hover { background: rgba(201,169,110,0.22); }
.pwa-install-btn[hidden] { display: none; }

/* ===== Dashboard Layout ===== */
.dashboard-layout { display: flex; gap: 24px; align-items: stretch; height: calc(100vh - 130px); min-height: 480px; }
.dashboard-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dashboard-right { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; }

/* ===== Dashboard Cards ===== */
.dash-group { margin-bottom: 18px; }
.dash-group-title { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; padding-left: 2px; }
.dash-group-primary .dash-group-title { color: #1a2a4a; font-size: 13px; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dashboard-cards.primary .dash-card { background: linear-gradient(135deg, #fff 0%, #fdfaf3 100%); border-color: #e8dcc0; }
.dashboard-cards.primary .dash-card:hover { border-color: #c9a96e; box-shadow: 0 4px 14px rgba(201,169,110,0.18); }
.dash-card { background: #fff; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: all 0.2s; border: 1px solid #eee; }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #c9a96e; }
.dash-icon { font-size: 18px; }
.dash-label { font-size: 13px; font-weight: 600; color: #1a2a4a; }
.dash-desc { font-size: 11px; color: #888; }

/* ===== Update Notes ===== */
.update-notes { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; margin-top: 4px; display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; }
.update-notes .update-notes-scroll { max-height: 150px; }
.update-notes-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.update-notes-header h3 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.update-notes-latest { font-size: 12px; font-weight: 500; color: #c9a96e; }
.update-notes-caret { color: #aaa; font-size: 12px; transition: transform 0.15s; flex-shrink: 0; }
.update-notes.collapsed .update-notes-caret { transform: rotate(-90deg); }
.update-notes.collapsed .update-notes-scroll { display: none; }
.update-notes-header { margin-bottom: 8px; }
.update-notes-header h3 { font-size: 15px; color: #1a2a4a; margin: 0; padding: 0; border: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.update-notes-version { font-size: 12px; color: #c9a96e; font-weight: 600; }
.update-notes-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.update-notes-entry + .update-notes-entry { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e5e5e5; }
.update-notes-version-row { font-size: 13px; color: #c9a96e; font-weight: 600; margin: 0 0 4px; padding: 0; border: none; }
.update-notes-list { list-style: none; padding: 0; margin: 0; }
.update-notes-list li { font-size: 13px; color: #444; padding: 3px 0 3px 18px; border-bottom: 1px solid #f5f5f5; position: relative; line-height: 1.4; }
.update-notes-list li::before { content: '▸'; color: #c9a96e; position: absolute; left: 4px; top: 3px; font-size: 12px; }
.update-notes-list li:last-child { border-bottom: none; }
.update-notes-list strong { color: #1a2a4a; font-weight: 600; }
.update-notes-list code { background: #f5f6fa; padding: 1px 5px; border-radius: 3px; font-size: 12px; color: #2c3e6b; font-family: 'SFMono-Regular', Menlo, monospace; }

/* ===== Drafts Panel ===== */
.drafts-panel { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; }
.drafts-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.drafts-header h3 { font-size: 15px; color: #1a2a4a; margin: 0; border: none; padding: 0; }
.drafts-count { font-size: 12px; color: #fff; background: #c9a96e; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.drafts-empty { color: #888; font-size: 13px; text-align: center; padding: 20px 0; }
.drafts-loading { color: #aaa; font-size: 13px; text-align: center; padding: 20px 0; }
.drafts-list { list-style: none; padding: 0; margin: 0; }
.draft-item { padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.draft-item:last-child { border-bottom: none; }
.draft-subject { font-size: 13px; font-weight: 500; color: #1a2a4a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.draft-meta { display: flex; justify-content: space-between; align-items: center; }
.draft-to { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.draft-date { font-size: 11px; color: #aaa; white-space: nowrap; }

/* ===== Today Deadlines Panel ===== */
.today-deadlines-panel { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; margin-top: 16px; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.today-deadlines-panel > #todayDeadlinesBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.today-deadlines-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.today-deadlines-header h3 { font-size: 15px; color: #1a2a4a; margin: 0; border: none; padding: 0; }
.today-deadlines-count { font-size: 12px; color: #fff; background: #c9a96e; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.today-deadlines-empty { color: #888; font-size: 13px; text-align: center; padding: 20px 0; }
.today-deadlines-loading { color: #aaa; font-size: 13px; text-align: center; padding: 20px 0; }
.today-deadlines-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.today-deadlines-list { list-style: none; padding: 0; margin: 0; }
.today-deadlines-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.today-deadlines-item:last-child { border-bottom: none; }
.today-deadlines-item .td-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; line-height: 1.5; word-break: break-all; }
.today-deadlines-item .td-row-1 { font-size: 12px; color: #333; }
.today-deadlines-item .td-row-2 { font-size: 12px; color: #555; margin-top: 2px; }
.today-deadlines-item .td-ref { font-weight: 600; color: #1a2a4a; }
.today-deadlines-item .td-appno { color: #444; }
.today-deadlines-item .td-applicant { color: #000; }
.today-deadlines-item .td-kind { color: #5a6776; }
.today-deadlines-item .td-sep { color: #ccc; padding: 0 2px; }
.today-deadlines-item .td-deadline { color: #c00; font-weight: 600; background: #fff3cd; padding: 1px 6px; border-radius: 3px; }
.today-deadlines-item .td-row-link, .today-deadlines-item .td-row-plain { display: block; text-decoration: none; color: inherit; }
.today-deadlines-item .td-row-link { cursor: pointer; margin: 0 -8px; padding: 2px 8px; border-radius: 5px; transition: background 0.15s; }
.today-deadlines-item .td-row-link:hover { background: #faf6ec; }

/* ===== Recent notices panel (dashboard center) ===== */
.recent-notices-panel { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-bottom: 16px; }
.recent-notices-panel > #recentNoticesBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.recent-notices-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.recent-notices-header h3 { font-size: 15px; color: #1a2a4a; margin: 0; border: none; padding: 0; }
.recent-notices-count { font-size: 12px; color: #fff; background: #c9a96e; padding: 2px 8px; border-radius: 10px; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.recent-notices-empty { color: #888; font-size: 13px; text-align: center; padding: 20px 0; }
.recent-notices-loading { color: #aaa; font-size: 13px; text-align: center; padding: 20px 0; }
.recent-notices-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.recent-notices-generic { font-size: 11px; font-weight: 500; color: #7a6a2f; background: #fef9e7; border: 1px solid #f5e6b8; padding: 1px 8px; border-radius: 10px; }
/* 2-column: 좌(심사 관련) / 우(등록 관련) */
.recent-notices-cols { display: flex; gap: 18px; flex: 1 1 auto; min-height: 0; }
.recent-notices-cols .rn-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.recent-notices-cols .rn-col + .rn-col { border-left: 1px solid #f0f0f0; padding-left: 18px; }
/* 카테고리별 색상 구분 — 심사(파랑)/등록(초록)/심판·국제(보라) */
.recent-notices-cols .rn-col-exam { --rn-accent: #2563eb; }
.recent-notices-cols .rn-col-reg  { --rn-accent: #15803d; }
.recent-notices-cols .rn-col-intl { --rn-accent: #7c3aed; }
.rn-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 10px; padding-bottom: 6px; color: var(--rn-accent, #666); border-bottom: 2px solid var(--rn-accent, #eee); }
.rn-col-label { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.rn-col-count { color: #fff; background: var(--rn-accent, #999); padding: 0 7px; border-radius: 9px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rn-col-caret { display: none; color: var(--rn-accent, #999); font-size: 11px; transition: transform 0.15s; flex-shrink: 0; }
.rn-col-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.recent-notices-list { list-style: none; padding: 0; margin: 0; }
.recent-notices-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.recent-notices-item:last-child { border-bottom: none; }
.recent-notices-item .rn-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; line-height: 1.5; word-break: break-all; }
.recent-notices-item .rn-row-1 { justify-content: space-between; gap: 8px; flex-wrap: nowrap; }
.recent-notices-item .rn-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; }
.recent-notices-item .rn-doc { font-size: 13px; font-weight: 600; color: #1a2a4a; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-notices-item .rn-maildate { font-size: 11px; color: #999; white-space: nowrap; flex-shrink: 0; }
.recent-notices-item .rn-deadline { font-size: 12px; color: #c00; font-weight: 600; background: #fff3cd; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.recent-notices-item .rn-deadline-none { color: #888; background: #f0f0f0; font-weight: 500; }
.recent-notices-item .rn-row-2 { font-size: 12px; color: #444; margin-top: 2px; }
.recent-notices-item .rn-ref { font-weight: 600; color: #1a2a4a; }
.recent-notices-item .rn-appno { color: #444; }
.recent-notices-item .rn-applicant { color: #000; }
.recent-notices-item .rn-sep { color: #ccc; padding: 0 2px; }
.recent-notices-item .rn-row-3 { font-size: 12px; color: #5a6776; margin-top: 2px; }
.recent-notices-item .rn-row-link, .recent-notices-item .rn-row-plain { display: block; text-decoration: none; color: inherit; }
.recent-notices-item .rn-row-link { cursor: pointer; margin: 0 -8px; padding: 2px 8px; border-radius: 5px; transition: background 0.15s; }
.recent-notices-item .rn-row-link:hover { background: #faf6ec; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }
.tab-btn { padding: 10px 20px; background: none; border: none; cursor: pointer; color: #888; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: #1a2a4a; }
.tab-btn.active { color: #1a2a4a; border-bottom-color: #c9a96e; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Cards & Panels ===== */
.card { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; margin-bottom: 20px; }
.card h3 { font-size: 16px; color: #1a2a4a; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.2s;
}
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; }
.form-group input[type="number"] { width: auto; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a2a4a; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; gap: 8px; align-items: end; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #1a2a4a; color: #fff; }
.btn-primary:hover { background: #2c3e6b; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-gold { background: #c9a96e; color: #fff; }
.btn-gold:hover { background: #b8944f; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; margin-top: 16px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
th { background: #f8f9fc; color: #555; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbfe; }
td.actions { white-space: nowrap; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 4px; font-size: 13px; }
.pagination a { background: #f0f0f0; color: #333; }
.pagination a:hover { background: #e0e0e0; }
.pagination span.current { background: #1a2a4a; color: #fff; }
.pagination span.dots { background: none; color: #999; padding: 6px 4px; }

/* ===== Search Bar ===== */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.search-bar input:focus { outline: none; border-color: #1a2a4a; }

/* ===== Status & Alerts ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.status-connected { background: #d4edda; color: #155724; }
.status-disconnected { background: #f8d7da; color: #721c24; }

/* ===== Modal ===== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal h3 { font-size: 18px; margin-bottom: 16px; color: #1a2a4a; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ===== Invoice Specific ===== */
.invoice-items { width: 100%; }
.invoice-items th { background: #1a2a4a; color: #fff; font-size: 12px; }
.invoice-items td { padding: 6px 8px; }
.invoice-items input { width: 100%; padding: 6px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.invoice-items input[type="number"] { text-align: right; }
.invoice-total { text-align: right; font-size: 16px; font-weight: 600; padding: 12px 0; color: #1a2a4a; }
.invoice-total span { color: #c9a96e; }

/* ===== Email Preview ===== */
.email-preview-box { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; }
.email-field { margin-bottom: 12px; }
.email-field label { font-weight: 600; color: #555; font-size: 12px; display: block; margin-bottom: 4px; }
.email-body { min-height: 200px; padding: 16px; border: 1px solid #eee; border-radius: 6px; background: #fafafa; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.email-body table { width: auto; }

/* 표 행/열 추가 편집기 (미리보기 전용 오버레이) */
.table-edit-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 5; }
.table-edit-btn {
    position: absolute; pointer-events: auto;
    width: 18px; height: 18px; padding: 0; margin: 0;
    border: 1px solid #c8a96a; border-radius: 50%;
    background: #fffdf8; color: #b08a3e;
    font-size: 12px; font-weight: 700; line-height: 1;
    cursor: pointer; opacity: 0.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.table-edit-overlay:hover .table-edit-btn { opacity: 0.85; }
.table-edit-btn:hover {
    opacity: 1; transform: scale(1.25);
    background: #c8a96a; color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1;
}

/* ===== File Upload ===== */
.upload-zone { border: 2px dashed #ccc; border-radius: 8px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; background: #fafbfe; }
.upload-zone:hover, .upload-zone.dragover { border-color: #c9a96e; background: #fef9f0; }
.upload-zone p { color: #888; font-size: 13px; margin-top: 8px; }
.file-list-items { margin-top: 12px; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #f8f9fc; border-radius: 6px; margin-bottom: 4px; font-size: 13px; }
.file-item .remove-file { color: #e74c3c; cursor: pointer; background: none; border: none; font-size: 16px; }

/* ===== Loading ===== */
.loading-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.8); z-index: 2000; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
.loading-overlay.show { display: flex; }
.spinner { width: 36px; height: 36px; border: 3px solid #eee; border-top-color: #1a2a4a; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* 사이드바: 햄버거로 여닫는 드로어. 기본 숨김 → body.nav-open 시 슬라이드 인 */
    .mobile-nav-toggle { display: block; background: transparent; box-shadow: none;
        top: 4px; left: 4px; }
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease;
        box-shadow: 2px 0 14px rgba(0,0,0,0.25); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop { display: block; }
    .sidebar-header { padding-left: 58px; }
    .nav-item { padding: 9px 20px; }
    .main-content { margin-left: 0; padding: 64px 16px 16px; }

    /* 모바일 상단 바: 햄버거 우측에 사이트명/로고를 중앙 정렬, 루트로 이동 */
    .mobile-topbar { display: flex; align-items: center; justify-content: center;
        position: fixed; top: 0; left: 0; right: 0; height: 48px;
        background: #1a2a4a; color: #fff; text-decoration: none;
        padding: 0 56px; z-index: 100;
        box-shadow: 0 2px 8px rgba(0,0,0,0.18); overflow: hidden; }
    .mobile-topbar-title { font-size: 15px; font-weight: 600; color: #fff;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-topbar-logo { max-height: 32px; max-width: 100%; object-fit: contain; }
    .form-row { flex-direction: column; gap: 0; }
    .dash-group { display: none; }
    .dashboard-layout { flex-direction: column; height: auto; min-height: 0; }
    .dashboard-left, .dashboard-right { display: contents; }
    .dashboard-cards { grid-template-columns: 1fr; }
    .drafts-panel { order: 50; }
    .today-deadlines-panel { order: 51; }
    .recent-notices-panel { order: 40; margin-bottom: 16px; }
    .recent-notices-cols { flex-direction: column; gap: 10px; }
    .recent-notices-cols .rn-col + .rn-col { border-left: none; padding-left: 0; }
    /* 모바일 아코디언: 각 탭은 기본 닫힘, 제목을 누르면 전체 건이 펼쳐짐(내부 스크롤 없음) */
    .recent-notices-cols .rn-col-title { cursor: pointer; margin-bottom: 0; padding: 9px 2px; font-size: 13.5px; }
    .recent-notices-cols .rn-col.open .rn-col-title { margin-bottom: 8px; }
    .recent-notices-cols .rn-col-caret { display: inline-block; }
    .recent-notices-cols .rn-col.open .rn-col-caret { transform: rotate(180deg); }
    .recent-notices-cols .rn-col-scroll { display: none; max-height: none; overflow: visible; }
    .recent-notices-cols .rn-col.open .rn-col-scroll { display: block; }
    .update-notes { order: 99; margin-top: 16px; }
    .update-notes-scroll { max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* 페이지 헤더: 제목과 액션 버튼이 한 줄에 안 들어가면 세로 배치 */
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header-actions { flex-wrap: wrap; }
    .page-header-title { gap: 8px; flex-wrap: wrap; }

    /* 탭: 개수가 많으면 가로 스크롤, 줄바꿈으로 깨지지 않게 */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-btn { flex: 0 0 auto; white-space: nowrap; padding: 10px 14px; }

    /* 가로 나열 폼/버튼 요소 세로 배치 및 줄바꿈 */
    .form-inline { flex-direction: column; align-items: stretch; gap: 10px; }
    .btn-group { flex-wrap: wrap; }
    .search-bar { flex-wrap: wrap; }
    .modal-actions { flex-wrap: wrap; }

    /* 카드/모달 패딩 축소로 좁은 화면 가로 여유 확보 */
    .card { padding: 16px; }
    .modal { padding: 18px; }

    /* 표는 가로 스크롤 허용 (셀이 잘리지 않게) */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* 양식관리: 모바일은 청구서/보고 양식 카드 세로 배치 */
    .template-upload-row { flex-direction: column; gap: 0; }

    /* 이메일 탭 서명블록: HTML 원본/미리보기 2단을 1단으로 */
    .email-signature-grid { grid-template-columns: 1fr; }
}

/* 이메일 서명블록 — PC 2단, 모바일은 위 @media 에서 1단 */
.email-signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== 양식관리 (settings/template_upload.php) ===== */
/* 청구서/보고 양식 업로드 카드 — PC는 가로, 모바일은 세로 (위 @media 에서 전환) */
.template-upload-row { display: flex; gap: 20px; align-items: stretch; }
.template-upload-row > .card { flex: 1 1 0; margin-bottom: 20px; }

/* 양식 편집기 — 본문/표 영역은 .email-body 와 동일 스타일 사용. */
.tpl-edit-body { min-height: 80px; }
.tpl-edit-body table { width: auto; }
#emailTemplateEditorCard input[type="text"] {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
#emailTemplateEditorCard select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
#emailTemplateEditorCard code {
    background: #f5f5f5; padding: 1px 5px; border-radius: 3px; font-size: 12px;
}

/* 플레이스홀더 안내 패널 */
.placeholder-ref {
    border: 1px solid #eee; border-radius: 6px; padding: 10px 12px;
    background: #fafafa; max-height: 280px; overflow-y: auto; font-size: 12px;
}
.placeholder-cat {
    font-weight: 600; color: #1a2a4a; font-size: 12px;
    margin: 8px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #e8e8e8;
}
.placeholder-cat:first-child { margin-top: 0; }
.placeholder-table { width: 100%; border-collapse: collapse; }
.placeholder-table td { padding: 2px 4px; vertical-align: top; }
.placeholder-table td:first-child { white-space: nowrap; width: 1%; }
.placeholder-table td:last-child { color: #555; }
.placeholder-chip {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
    padding: 1px 6px; border: 1px solid #d6c08a; background: #fffdf6; color: #7a5a18;
    border-radius: 3px; cursor: pointer; transition: background 0.1s;
}
.placeholder-chip:hover { background: #f5e8c0; }
.placeholder-chip:active { background: #e8d4a0; }

/* ===== 기업 대시보드 ===== */
.page-header-title { display: flex; align-items: center; gap: 12px; }
.corp-dash-btn { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 14px; background: #1a2a4a; color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; border: 1px solid #1a2a4a; transition: background 0.2s; }
.corp-dash-btn:hover { background: #2a3a5a; }

.corp-btn { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.corp-btn-disabled { opacity: 0.55; }
.corp-btn-back { background: #f0f0f0; color: #444; border: 1px solid #ddd; }
.corp-btn-back:hover { background: #e4e4e4; }
.corp-btn-refresh { background: rgba(201,169,110,0.14); color: #b08d4a; border: 1px solid rgba(201,169,110,0.4); }
.corp-btn-refresh:hover { background: rgba(201,169,110,0.26); }
.corp-btn-refresh:disabled { opacity: 0.6; cursor: default; }

.corp-search-bar { margin-bottom: 16px; }
.corp-search-bar form { display: flex; gap: 8px; }
.corp-search-input { flex: 1 1 auto; padding: 10px 14px; border: 1px solid #d4d4d4; border-radius: 8px; font-size: 14px; }
.corp-search-input:focus { outline: none; border-color: #c9a96e; }
.corp-search-btn { padding: 10px 22px; background: #1a2a4a; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.corp-search-btn:hover { background: #2a3a5a; }

.corp-dropdown { margin-top: 8px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.corp-dropdown[hidden] { display: none; }
.corp-dropdown-title { font-size: 12px; color: #8a7340; padding: 8px 12px; background: #faf6ec; border-bottom: 1px solid #eee; }
.corp-dropdown-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.corp-dropdown-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f3f3f3; }
.corp-dropdown-item:last-child { border-bottom: none; }
.corp-dropdown-item:hover { background: #faf6ec; }
.corp-dd-name { font-size: 13px; color: #1a2a4a; font-weight: 600; word-break: break-all; }
.corp-dd-count { font-size: 11px; color: #fff; background: #c9a96e; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }

.corp-demo-banner { background: #fdfaf3; border: 1px solid #e8dcc0; color: #8a7340; font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.corp-loading { color: #aaa; font-size: 13px; text-align: center; padding: 40px 0; }
.corp-notfound { text-align: center; padding: 60px 20px; background: #fff; border-radius: 10px; border: 1px solid #eee; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.corp-notfound-icon { font-size: 40px; margin-bottom: 12px; }
.corp-notfound-title { font-size: 17px; font-weight: 700; color: #1a2a4a; margin: 0 0 8px; }
.corp-notfound-desc { font-size: 13px; color: #888; line-height: 1.7; margin: 0; }
.corp-empty { color: #999; font-size: 13px; text-align: center; padding: 18px 0; }

.corp-grid { display: flex; gap: 16px; align-items: stretch; }
.corp-main { flex: 2 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.corp-side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.corp-panel { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #eee; }
.corp-panel-title { font-size: 15px; color: #1a2a4a; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.corp-panel-sub { font-size: 11px; color: #999; font-weight: 400; margin-left: 6px; }
.corp-count { font-size: 11px; color: #fff; background: #c9a96e; padding: 2px 8px; border-radius: 10px; font-weight: 500; }

.corp-right-block { margin-bottom: 14px; }
.corp-right-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; flex-wrap: wrap; gap: 4px; }
.corp-right-name { font-size: 13px; font-weight: 700; color: #1a2a4a; display: inline-flex; align-items: center; gap: 8px; }
.corp-right-counts { font-size: 12px; color: #777; }
.corp-right-counts b { color: #1a2a4a; }

.corp-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #f0f0f0; }
.corp-bar-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.corp-bar-reg { background: #5a8f7b; }
.corp-bar-pen { background: #c9a96e; }
.corp-bar-pct { background: #4a78b0; }
.corp-bar-dead { background: #595959; }
.corp-bar-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 12px; color: #555; }
.corp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.corp-dot-reg { background: #5a8f7b; }
.corp-dot-pen { background: #c9a96e; }
.corp-dot-pct { background: #4a78b0; }
.corp-dot-dead { background: #595959; }

.corp-pie-row { display: flex; flex-wrap: nowrap; gap: 10px; margin-bottom: 12px; }
.corp-pie-block { flex: 1 1 0; min-width: 0; text-align: center; }
.corp-pie-cap { font-size: 13px; font-weight: 700; color: #1a2a4a; margin-bottom: 6px; }
.corp-pie { width: 96px; height: 96px; max-width: 100%; border-radius: 50%; margin: 0 auto; }
.corp-pie-empty { background: #eee; }
.corp-pie-total { font-size: 11px; color: #888; margin-top: 6px; }
.corp-shared-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; padding: 8px 10px; background: #fafafa; border-radius: 6px; }
.corp-legend-chip { font-size: 12px; color: #444; display: inline-flex; align-items: center; }

.corp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.corp-table th { text-align: left; color: #888; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #eee; }
.corp-table td { padding: 6px 8px; border-bottom: 1px solid #f5f5f5; color: #333; }
.corp-table th:not(:first-child), .corp-table td:not(:first-child) { text-align: right; }
.corp-table tr:last-child td { border-bottom: none; }
.corp-table .corp-cell-empty { color: #ccc; }
.corp-table .corp-cell-total { font-weight: 700; color: #1a2a4a; }
.corp-table-note { font-size: 11px; color: #999; margin-top: 6px; text-align: right; }

.corp-panel-week { margin-bottom: 16px; }
.corp-week-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.corp-week-col { min-width: 0; }
.corp-week-head { font-size: 12px; font-weight: 700; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid; }
.corp-week-head b { float: right; }
.corp-week-new { color: #2a6a8f; border-color: #2a6a8f; }
.corp-week-oa  { color: #a05a5a; border-color: #a05a5a; }
.corp-week-decision { color: #b07d2a; border-color: #b07d2a; }
.corp-week-reg { color: #5a8f7b; border-color: #5a8f7b; }

.corp-event-list { list-style: none; padding: 0; margin: 0; }
.corp-event-item { padding: 6px 0; border-bottom: 1px solid #f5f5f5; }
.corp-event-item:last-child { border-bottom: none; }
.corp-event-line1 { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; align-items: baseline; }
.corp-event-ref { font-weight: 600; color: #1a2a4a; }
.corp-event-appno { color: #666; }
.corp-event-date { color: #999; margin-left: auto; }
.corp-event-title { font-size: 12px; color: #333; margin-top: 2px; word-break: break-all; }

/* ===== 권리별 상세보기 ===== */
.corp-right-detail-btn { font-size: 11px; font-weight: 600; line-height: 1.4; color: #8a7340; background: #faf6ec; border: 1px solid #e8dcc0; border-radius: 6px; padding: 1px 8px; cursor: pointer; }
.corp-right-detail-btn:hover { background: #f1e7cf; color: #6f5b28; }

.corp-panel-detail { margin-bottom: 16px; }
.corp-detail-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.corp-detail-title { margin: 0; padding: 0; border: none; }
.corp-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.corp-detail-col { min-width: 0; display: flex; flex-direction: column; }
.corp-detail-head { font-size: 12px; font-weight: 700; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid; }
.corp-detail-head b { float: right; }
.corp-detail-prep     { color: #777;    border-color: #777; }
.corp-detail-filed    { color: #2a6a8f; border-color: #2a6a8f; }
.corp-detail-oa       { color: #a05a5a; border-color: #a05a5a; }
.corp-detail-oares    { color: #b07d2a; border-color: #b07d2a; }
.corp-detail-decision { color: #6a6aa0; border-color: #6a6aa0; }
.corp-detail-reg      { color: #5a8f7b; border-color: #5a8f7b; }
.corp-detail-dead     { color: #595959; border-color: #595959; }
.corp-detail-expired  { color: #9a4a4a; border-color: #9a4a4a; }
/* 4열×2행 — 두 행이 화면 하단까지 차도록 각 칸 목록을 가변 높이로 스크롤 */
.corp-detail-scroll { flex: 1 1 auto; min-height: 180px; max-height: calc((100vh - 340px) / 2); overflow-y: auto; }

.corp-panel-deadlines { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.corp-deadlines-scroll { flex: 1 1 auto; min-height: 200px; max-height: 560px; overflow-y: auto; }
.corp-deadlines-list { list-style: none; padding: 0; margin: 0; }
.corp-deadline-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.corp-deadline-item:last-child { border-bottom: none; }
.corp-dl-row1 { font-size: 12px; }
.corp-dl-ref { font-weight: 600; color: #1a2a4a; }
.corp-dl-appno { color: #555; }
.corp-dl-sep { color: #ccc; }
.corp-dl-title { font-size: 12px; color: #333; margin-top: 2px; word-break: break-all; }
.corp-dl-row2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-top: 3px; }
.corp-dl-kind { color: #5a6776; }
.corp-dl-date { color: #c00; font-weight: 600; background: #fff3cd; padding: 1px 6px; border-radius: 3px; }

.corp-dm-scroll { max-height: 280px; overflow-y: auto; }
.corp-dm-list { list-style: none; padding: 0; margin: 0; }
.corp-dm-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.corp-dm-item:last-child { border-bottom: none; }
.corp-dm-row1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; }
.corp-tag { font-size: 10px; font-weight: 700; color: #fff; padding: 1px 6px; border-radius: 8px; }
.corp-tag-dispute { background: #a05a5a; }
.corp-tag-misc { background: #6a6aa0; }
.corp-dm-ref { font-weight: 600; color: #1a2a4a; }
.corp-dm-kind { color: #5a6776; }
.corp-dm-title { font-size: 12px; color: #333; margin-top: 3px; word-break: break-all; }
.corp-dm-status { font-size: 11px; color: #888; margin-top: 2px; }

.corp-row-link, .corp-row-plain { display: block; text-decoration: none; color: inherit; }
.corp-row-link { cursor: pointer; margin: 0 -8px; padding: 2px 8px; border-radius: 5px; transition: background 0.15s; }
.corp-row-link:hover { background: #faf6ec; }

/* 상태 갱신 모달 */
.corp-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.corp-modal[hidden] { display: none; }
.corp-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.corp-modal-box { position: relative; background: #fff; border-radius: 12px; width: 720px; max-width: calc(100% - 32px); max-height: 92vh; box-shadow: 0 12px 40px rgba(0,0,0,0.3); overflow: hidden; display: flex; flex-direction: column; }
.corp-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.corp-modal-head h3 { font-size: 16px; color: #1a2a4a; margin: 0; }
.corp-modal-x { background: none; border: none; font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 0 4px; }
.corp-modal-x:hover { color: #333; }
.corp-modal-body { padding: 18px; min-height: 90px; flex: 1 1 auto; overflow-y: auto; }
.corp-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #eee; background: #fafafa; flex-shrink: 0; }
.corp-modal-btn { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid #ddd; background: #f0f0f0; color: #444; }
.corp-modal-btn:hover { background: #e4e4e4; }
.corp-modal-btn-primary { background: #1a2a4a; color: #fff; border-color: #1a2a4a; }
.corp-modal-btn-primary:hover { background: #2a3a5a; }
.corp-modal-btn-primary:disabled { opacity: 0.5; cursor: default; }
.corp-modal-note { font-size: 12px; color: #8a7340; background: #faf6ec; border: 1px solid #e8dcc0; border-radius: 6px; padding: 8px 10px; margin: 0 0 14px; line-height: 1.6; }
.corp-modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.corp-modal-table th { text-align: left; padding: 8px 6px; color: #1a2a4a; font-weight: 700; width: 32%; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.corp-modal-table td { padding: 8px 6px; color: #333; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.corp-modal-table tr:last-child th, .corp-modal-table tr:last-child td { border-bottom: none; }
.corp-modal-table b { color: #1a2a4a; font-size: 14px; }
.corp-modal-ex { color: #999; font-size: 12px; }
.corp-modal-ex span { display: block; font-size: 11px; color: #bbb; margin-top: 1px; }
.corp-modal-total { font-size: 13px; color: #333; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid #eee; }
.corp-modal-total b { color: #c9a96e; font-size: 16px; }
.corp-modal-none { font-size: 13px; color: #a05a5a; margin: 8px 0 0; }
.corp-modal-done { font-size: 15px; font-weight: 700; color: #5a8f7b; margin: 8px 0 4px; text-align: center; }
.corp-modal-doneline { font-size: 13px; color: #555; text-align: center; margin: 0; }
.corp-modal-newhead { font-size: 13px; font-weight: 700; color: #2a6a8f; margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid #eee; }
.corp-modal-newlist { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.corp-modal-newlist li { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #f5f5f5; }
.corp-modal-newlist li:last-child { border-bottom: none; }
.corp-ne-ref { font-weight: 600; color: #1a2a4a; flex-shrink: 0; }
.corp-ne-name { color: #333; flex: 1; min-width: 0; word-break: break-all; }
.corp-ne-date { color: #999; flex-shrink: 0; }
.corp-modal-newmore { font-size: 12px; color: #999; margin: 6px 0 0; }
.corp-modal-nonew { font-size: 13px; color: #888; text-align: center; margin: 12px 0 0; }

/* ===== corp_refresh 결과 — 사건별 상세 변경 (master_sync 스타일 섹션) ===== */
.corp-det-section { margin: 12px 0 4px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fafafa; }
.corp-det-summary { padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: #1a2a4a; user-select: none; }
.corp-det-summary:hover { background: #f0f3f7; }
.corp-det-count { color: #5a8f7b; font-weight: 600; margin-left: 4px; }
.corp-det-list { list-style: none; margin: 0; padding: 4px 12px 8px; background: #fff; border-top: 1px solid #eee; }
.corp-det-li { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #f5f5f5; flex-wrap: wrap; }
.corp-det-li:last-child { border-bottom: none; }
.corp-det-ref { font-weight: 600; color: #1a2a4a; flex-shrink: 0; min-width: 90px; }
.corp-det-app { color: #888; flex-shrink: 0; font-size: 11px; }
.corp-det-text { color: #333; flex: 1; min-width: 0; word-break: break-word; }
.corp-det-old { color: #c66; text-decoration: line-through; }
.corp-det-new { color: #1a6e35; font-weight: 600; }
.corp-det-src { color: #999; margin-left: 6px; font-size: 11px; }
.corp-det-note { color: #666; font-size: 11px; }
.corp-det-more { font-size: 12px; color: #999; margin: 4px 0 0; padding: 0 12px 6px; }

/* ===== 기업 대시보드 모바일 (기본 스타일 이후에 선언해 우선순위 확보) ===== */
@media (max-width: 768px) {
    .corp-grid { flex-direction: column; }
    .corp-week-grid { grid-template-columns: 1fr; }
    .corp-detail-grid { grid-template-columns: 1fr 1fr; }
    .corp-detail-scroll { max-height: 260px; }
    .corp-event-line1 { flex-direction: column; align-items: flex-start; gap: 2px; }
    .corp-event-date { margin-left: 0; }
}

/* 엑셀 다운로드 — 컬럼 선택/순서 모달 (assets/js/export_columns.js 공용) */
.exp-col-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.exp-col-box { background: #fff; border-radius: 8px; width: 520px; max-width: 96vw; max-height: 90vh; display: flex; flex-direction: column; }
.exp-col-head { padding: 16px 20px 10px; border-bottom: 1px solid #eee; }
.exp-col-head h3 { margin: 0 0 4px; font-size: 16px; }
.exp-col-head p { margin: 0; font-size: 12px; color: #777; }
.exp-col-tools { padding: 10px 20px; display: flex; gap: 8px; border-bottom: 1px solid #f0f0f0; }
.exp-col-list { list-style: none; margin: 0; padding: 6px 12px; overflow-y: auto; flex: 1; }
.exp-col-list li { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #eee; border-radius: 4px; margin-bottom: 3px; background: #fafbfc; font-size: 12px; line-height: 1.5; }
.exp-col-list li.on { background: #eef6ff; border-color: #cfe2fb; }
.exp-col-list li.dragging { opacity: 0.5; }
.exp-col-list li .hd { cursor: grab; color: #bbb; font-size: 12px; user-select: none; }
.exp-col-list li .hd:active { cursor: grabbing; }
.exp-col-list li .lbl { flex: 1; }
.exp-col-list li input[type=checkbox] { margin: 0; }
.exp-col-foot { padding: 12px 20px; border-top: 1px solid #eee; display: flex; gap: 8px; justify-content: flex-end; }

/* 인쇄/PDF 저장 — 헤더(사이드바)·모바일 상단바 등 화면 전용 chrome 을 숨기고
   본문 영역만 전체 폭으로 출력한다. 화면 표시에는 영향 없음.
   인쇄에서 빼고 싶은 요소(검색 폼·버튼 등)는 .no-print 클래스를 붙이면 된다. */
@media print {
    .sidebar,
    .mobile-nav-toggle,
    .mobile-topbar,
    .sidebar-backdrop,
    .no-print { display: none !important; }

    .admin-layout { display: block !important; min-height: 0 !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; min-height: 0 !important; }
    body { background: #fff !important; }
}
