/* eBizMail — 새 웹메일 기본 스타일. 외부 글꼴·스크립트 없이 (CSP 'self') */
:root {
    --fg: #393939;
    --dim: #6a6767;
    --line: #e3e3e3;
    --accent: #ba0000;
    --btn: #393939;
    --error: #d10000;
    --card: #fff;
    --bg: #f5f5f5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font: 16px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, "Segoe UI", system-ui, sans-serif;
    color: var(--fg);
    background: var(--bg);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- 로그인 */

body.login-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    /* 배경 그림 위에 짙은 막을 깔아 카드가 또렷하게 */
    background: linear-gradient(135deg, rgba(20, 38, 68, .82), rgba(31, 78, 140, .72)), #1f3354 url(../img/ebizmail_bg.png) center / cover no-repeat;
}

.login { width: 100%; max-width: 420px; }

.login-card {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 40px 36px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(8, 20, 40, .35);
}

.login-brand { text-align: center; }
.logo { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; color: #1f4e8c; }
.login-sub { margin-top: 6px; color: #667085; font-size: 13px; }

.login-box { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; color: #344054; font-size: 13px; font-weight: 600; }
.login-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    color: var(--fg);
    transition: border-color .15s, box-shadow .15s;
}
.login-field input::placeholder { color: #98a2b3; }
.login-field input:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 4px rgba(74, 143, 231, .18); }

.login-error { padding: 9px 12px; border: 1px solid #fecdca; border-radius: 8px; background: #fef3f2; color: #b42318; font-size: 13px; }

.login-btn {
    height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: #2f6fd1;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
}
.login-btn:hover, .login-btn:focus-visible { background: #255cb0; }

.login-notice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f4f7fb;
    color: #344054;
    font-size: 12.5px;
    line-height: 1.55;
}
.login-notice li { padding-left: 12px; position: relative; }
.login-notice li::before { content: ""; position: absolute; left: 0; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: #4a8fe7; }
.login-notice b { margin-right: 4px; color: #1d2939; }
.login-notice .dim { color: #667085; }

.copy { display: block; margin-top: 20px; font-size: 12px; color: rgba(255, 255, 255, .78); text-align: center; }
.copy:hover { color: #fff; text-decoration: underline; }
/* ---------------------------------------------------------------- 메일 화면 */

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; font-size: 18px; margin-right: auto; }
.topbar .who { color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }

form.inline { display: inline; }
.link-btn { border: 0; background: none; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.content { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.content h1 { font-size: 20px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- 안내 페이지 */

.notice-page { max-width: 560px; margin: 80px auto; padding: 0 16px; }
.notice-page h1 { font-size: 22px; margin-bottom: 12px; }
.notice-page p { margin-bottom: 8px; }
.notice-page a { color: var(--accent); }

@media (max-width: 480px) {
    .login-card { padding: 32px 20px 24px; }
    .logo { font-size: 30px; }
}

/* ---------------------------------------------------------------- 메일함 */

.mail-layout { display: flex; min-height: calc(100vh - 49px); }

.folders { flex: 0 0 200px; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; }
.folders a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 14px;
}
.folders a:hover, .folders a:focus-visible { background: #f0f0f0; }
.folders a.on { background: #393939; color: #fff; font-weight: 700; }
.folders .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folders li.custom:first-of-type, .folders li:not(.custom) + li.custom { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.folders a.on .badge { background: #fff; color: var(--accent); }

.mail-main { flex: 1; min-width: 0; padding: 16px; }
.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.list-head h1 { font-size: 18px; }
.list-head .summary { color: var(--dim); font-size: 13px; }
.empty { padding: 40px 0; text-align: center; }

.mail-list { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; font-size: 14px; }
.mail-list th, .mail-list td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-list th { font-size: 13px; color: var(--dim); font-weight: 600; background: #fafafa; }
.mail-list th a:hover { text-decoration: underline; }
.mail-list tr.unread td { font-weight: 700; }
.mail-list tbody tr:hover { background: #f7f9fc; }
.c-flag { width: 64px; }
.c-party { width: 250px; }   /* 기존 mail_list.asp 와 같게 고정 폭 */
.c-size { width: 70px; text-align: right !important; }
.c-date { width: 110px; }
.mail-list .deleted { text-decoration: line-through; }
.mail-list .approved { text-decoration: underline; }

.st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.st.new { background: #1a73e8; }
.st.old { background: transparent; border: 1px solid #ccc; }
.st.re { background: #0a7a35; }
.st.fwd { background: #b06000; }
.pri { font-weight: 700; margin-right: 2px; }
.pri.hi { color: var(--error); }
.pri.lo { color: #888; }
/* 첨부 아이콘 (Icons.Attachment — 인라인 SVG) */
.att { display: inline-flex; align-items: center; vertical-align: middle; color: #5b6b82; }
.ico { display: inline-block; flex: none; width: 16px; height: 16px; }
.mail-list .ico-att { width: 17px; height: 17px; }
.side-list .sl-subject .att { margin-right: 3px; }
.side-list .ico-att { width: 14px; height: 14px; }

/* 페이지 넘기기: 둥근 단추 + 페이지 번호로 이동 */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 16px 0; font-size: 13px; }
.pager .pg { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 6px;
             background: #fff; color: var(--fg); text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.pager a.pg:hover { background: #eef5ff; border-color: #9ec3ee; color: #1f4e8c; }
.pager .pg.disabled { color: #b0b6bf; background: #fafafa; border-color: #e4e7ec; cursor: default; }
.pg-goto { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px; }
.pg-goto input[type="number"] { width: 64px; height: 32px; padding: 0 8px; border: 1px solid #d0d5dd; border-radius: 6px;
                                font: inherit; text-align: center; background: #fff; }
.pg-goto input[type="number"]:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.pg-goto .pg-total { color: var(--dim); white-space: nowrap; }
.pg-goto button { height: 32px; padding: 0 14px; border: 1px solid #9ec3ee; border-radius: 6px; background: #cfe3fb; color: #1f4e8c;
                  font: inherit; font-weight: 700; cursor: pointer; }
.pg-goto button:hover { background: #b9d6f8; }
@media (max-width: 600px) { .pager .pg-label { display: none; } }

@media (max-width: 760px) {
    .mail-layout { flex-direction: column; }
    .folders { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .folders ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .folders li.custom:first-of-type, .folders li:not(.custom) + li.custom { margin-top: 0; border-top: 0; padding-top: 0; }
    .c-size, .c-flag { display: none; }
    .c-party { width: 35%; }
    .c-date { width: 90px; }
}
/* ---------------------------------------------------------------- 메일 읽기 */

.mail-list a.subj { display: block; overflow: hidden; text-overflow: ellipsis; }
.mail-list a.subj:hover { text-decoration: underline; }

.read { max-width: 1100px; margin: 0 auto; padding: 16px; }
.read-nav { margin-bottom: 10px; font-size: 14px; }
.read-nav a { color: var(--accent); }
.read-subject { font-size: 20px; margin-bottom: 10px; overflow-wrap: anywhere; }
.read-head { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 14px;
             padding: 10px 12px; background: #fff; border: 1px solid var(--line); }
.read-head dt { color: var(--dim); font-weight: 600; }
.read-head dd { overflow-wrap: anywhere; }
.read-note { margin-top: 10px; padding: 8px 12px; background: #fff8e1; border: 1px solid #f0d58a; font-size: 13px; }
.read-atts { margin-top: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.read-atts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 3px 0; }
.read-atts .att-name { overflow-wrap: anywhere; }
.read-atts a { color: var(--accent); }
/* 주의 안내 (_MailNotice): 보낸 사람 불일치 · 스팸 분류 이유 · 이미지 차단 */
.mail-notice { display: flex; gap: 8px; margin-top: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
               background: #fef3f2; border: 1px solid #fecdca; color: #475467; }
.mail-notice.spam { background: #f2f4f7; border-color: #d0d5dd; }
.mail-notice strong { color: #1d2939; }
.mail-notice a { color: #d92d20; text-decoration: underline; }
.mail-notice .mn-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
                        background: #f04438; color: #fff; font: 700 12px/18px sans-serif; text-align: center; }
.mail-notice.spam .mn-icon { background: #98a2b3; }
.mail-notice .mn-dim { color: #667085; overflow-wrap: anywhere; }
/* 번역 (mail-translate.js) */
.read-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.mail-translate { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.mail-translate[hidden], .mail-translate button[hidden] { display: none; }
.mail-translate select { font-size: 12px; padding: 2px; }
.mail-translate button { padding: 2px 8px; font-size: 12px; border: 1px solid #7ba7dc; background: #fff; color: #1d2939; cursor: pointer; }
.mail-translate .mt-status { color: #667085; margin-right: 4px; }
.read-body { display: block; width: 100%; height: calc(100vh - 120px); min-height: 400px; margin-top: 10px;
             border: 1px solid var(--line); background: #fff; }
/* ---------------------------------------------------------------- 메일 관리 · 검색 */

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.search input[type="search"] { flex: 0 1 160px; width: 160px; min-width: 0; padding: 6px 8px; border: 1px solid #ccc; font: inherit; }
.search .search-dates { display: inline-flex; align-items: center; gap: 4px; }
.search input[type="date"] { padding: 4px 6px; border: 1px solid #ccc; background: #fff; font: inherit; font-size: 13px; }
.search select, .search button, .toolbar select, .toolbar button { padding: 5px 8px; border: 1px solid #ccc; background: #fff; font: inherit; font-size: 13px; }
.search button, .toolbar button { cursor: pointer; }
.search button:hover, .toolbar button:hover { background: #f0f0f0; }
.search a { color: var(--accent); }
.search label { display: inline-flex; align-items: center; gap: 4px; }
.mail-main > .error { color: var(--error); font-size: 13px; margin-bottom: 8px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.toolbar .move { display: inline-flex; gap: 4px; }
.read-tools { margin-bottom: 10px; }
.c-check { width: 32px; text-align: center !important; }
/* ---------------------------------------------------------------- 메일 쓰기 */

.list-head .compose-btn, .btn { display: inline-block; padding: 5px 12px; border: 1px solid #393939; background: #393939; color: #fff; font-size: 13px; border-radius: 3px; }
/* 메일 쓰기: 주변(어두운 회색)과 구분되게 푸른 파스텔 */
.list-head .compose-btn { margin-right: 6px; background: #cfe3fb; border-color: #9ec3ee; color: #1f4e8c; font-weight: 700; }
.list-head .compose-btn:hover { background: #b9d6f8; opacity: 1; }
.btn { background: #fff; color: var(--fg); border-color: #ccc; }
.btn:hover { opacity: .85; }
.flash { margin-bottom: 10px; padding: 8px 12px; background: #e8f5e9; border: 1px solid #a5d6a7; font-size: 13px; }
.error-box { margin-bottom: 10px; padding: 8px 12px; background: #fdecea; border: 1px solid #f5c2c0; color: var(--error); font-size: 13px; }
.reply-tools { margin-bottom: 8px; }

.compose { max-width: 1000px; margin: 0 auto; padding: 16px; }
.compose h1 { font-size: 20px; margin-bottom: 12px; }
.compose-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.compose-grid > label { color: var(--dim); font-weight: 600; }
.compose-grid input:not([type="checkbox"]):not([type="file"]), .compose-grid select { width: 100%; padding: 6px 8px; border: 1px solid #ccc; font: inherit; }
.compose-grid .opts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.compose-grid .opts select { width: auto; }
.keep-atts li { padding: 2px 0; }
.compose textarea { width: 100%; min-height: 360px; padding: 10px; border: 1px solid #ccc; font: 14px/1.6 Consolas, "Malgun Gothic", monospace; resize: vertical; }
.compose-actions { margin-top: 10px; }
.compose-actions .primary { background: #393939; color: #fff; border-color: #393939; font-weight: 700; }
.compose-actions a { color: var(--accent); font-size: 13px; }
@media (max-width: 600px) { .compose-grid { grid-template-columns: 1fr; } }/* 메일 쓰기: HTML · TEXT 전환과 편집기 자리 */
[hidden] { display: none !important; }
.editor-host { min-height: 520px; }
.size-warn { margin-top: 4px; color: #b54708; font-size: 13px; }
/* 빈 편지함 */
.empty-list { padding: 48px 0; text-align: center; color: var(--dim); font-size: 14px; }
/* 읽기: 본문 틀을 내용 높이로 (mail.js) — 한 페이지 스크롤 */
.read-body.fitted { min-height: 120px; }
.to-top { margin: 16px 0 24px; text-align: right; font-size: 13px; }
.to-top a { color: var(--dim); text-decoration: none; }
.to-top a:hover { color: inherit; text-decoration: underline; }
/* 읽기: 왼쪽 메일 목록 + 오른쪽 내용 (목록은 화면에 붙어 따로 스크롤, 내용은 페이지 스크롤) */
.read-layout { display: flex; align-items: flex-start; }
.read-layout .read { flex: 1; min-width: 0; margin: 0; }
.side-list { flex: 0 0 280px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); }
.side-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center;
             padding: 8px 10px; background: #fafafa; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.side-pager a { margin-left: 8px; color: var(--accent); text-decoration: none; }
.side-list li a { display: block; padding: 8px 10px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.side-list li a:hover { background: #f5f7fa; }
.side-list li.on a { background: #dbe8f8; }
.side-list .sl-party, .side-list .sl-subject { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list .sl-party { color: var(--dim); font-size: 12px; }
.side-list li.unread .sl-party, .side-list li.unread .sl-subject { color: inherit; font-weight: 700; }
.side-list .sl-meta { display: block; margin-top: 2px; text-align: right; color: #8a8a8a; font-size: 11px; }
@media (max-width: 900px) { .side-list { display: none; } }
.read-head .addr-link { color: inherit; text-decoration: none; border-bottom: 1px dotted #999; } .read-head .addr-link:hover { color: var(--accent); border-bottom-color: currentColor; }

/* ---- 메일 쓰기: 옵션 스위치 · 첨부 상자 · 버튼 ---- */
.compose-grid .opts { gap: 10px 22px; }
.compose-grid .opts select { padding: 6px 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0;
                border-radius: 10px; background: #cfd4dc; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
                       background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
.switch input:checked { background: #4a8fe7; }
.switch input:checked::after { transform: translateX(14px); }
.switch input:focus-visible { outline: 2px solid #4a8fe7; outline-offset: 2px; }

.attach { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dropzone { position: relative; }
.dropzone .dz-icon, .dropzone .dz-text, .dropzone .dz-hint { display: none; }
.dropzone.enhanced { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px dashed #b8c4d6; border-radius: 8px;
                     background: #f8fafd; color: #475467; transition: border-color .15s, background .15s; }
.dropzone.enhanced:hover, .dropzone.enhanced.over { border-color: #4a8fe7; background: #eef5ff; }
.dropzone.enhanced input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone.enhanced .dz-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
                              background: #dce9fb; color: #1f4e8c; font-size: 16px; }
.dropzone.enhanced .dz-text { display: block; flex: 1; font-size: 13px; }
.dropzone.enhanced .dz-hint { display: block; flex: none; font-size: 12px; color: #8a94a6; }

.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid #e4e7ec; border-radius: 8px;
                background: #fff; font-size: 13px; }
.file-list li label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.file-list li input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #4a8fe7; }
.file-list .fi-icon { flex: none; }
.file-list .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .fi-size { flex: none; color: #8a94a6; font-size: 12px; }
.file-list .fi-remove { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent;
                        color: #98a2b3; font-size: 16px; line-height: 24px; cursor: pointer; }
.file-list .fi-remove:hover { background: #f2f4f7; color: #d92d20; }
.keep-atts li:has(input:not(:checked)) { opacity: .55; }

.compose-actions { gap: 8px; margin-top: 14px; }
.compose-actions button { padding: 8px 20px; border-radius: 6px; font-size: 14px; }
/* 보내기: 마우스를 올리면 살짝 밝아짐 */
.compose-actions .primary { background: #393939; border-color: #393939; color: #fff; transition: background .12s, border-color .12s; }
.compose-actions .primary:hover { background: #4d4d4d; border-color: #4d4d4d; color: #fff; }
.compose-actions .secondary { background: #fff; border: 1px solid #d0d5dd; color: var(--fg); }
/* 취소: 링크지만 임시 보관 버튼과 같은 모양 */
.compose-actions .cancel { display: inline-block; padding: 8px 20px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff;
                           color: var(--fg); font-size: 14px; line-height: normal; text-decoration: none; }
.compose-actions .cancel:hover, .compose-actions .secondary:hover { background: #f5f6f8; }
.compose-grid > label.top { align-self: start; padding-top: 9px; }
.dropzone.enhanced .dz-hint.over { color: #b54708; font-weight: 600; }   /* 20MB 넘으면 합계도 주황 */

/* ---- 상단 탭 (웹메일 · 폴더 관리 · 주소록 · 환경 설정 · 시스템 로그) ---- */
.tabs { display: flex; gap: 2px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs .tab { position: relative; padding: 11px 16px 10px; color: #555; font-size: 14px; text-decoration: none; white-space: nowrap; }
.tabs a.tab:hover { color: var(--fg); background: #f7f8fa; }
.tabs .tab.on { color: #1f4e8c; font-weight: 700; }
.tabs .tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: #4a8fe7; }
.tabs .tab.disabled { color: #b8bec7; cursor: default; }
.mail-layout { min-height: calc(100vh - 92px); }

/* ---- 폴더 관리 ---- */
.folders-page { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
.folders-page h1 { font-size: 20px; margin-bottom: 14px; }
.usage { margin-bottom: 16px; padding: 14px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.usage-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: #475467; }
.usage-num { font-weight: 600; color: var(--fg); }
.usage-bar { display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: #eef1f5; overflow: hidden; appearance: none; -webkit-appearance: none; }
.usage-bar::-webkit-progress-bar { background: #eef1f5; border-radius: 4px; }
.usage-bar::-webkit-progress-value { background: #4a8fe7; border-radius: 4px; }
.usage-bar::-moz-progress-bar { background: #4a8fe7; border-radius: 4px; }
.usage-bar.high::-webkit-progress-value { background: #d92d20; }
.usage-bar.high::-moz-progress-bar { background: #d92d20; }

.folder-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; overflow: hidden; font-size: 14px; }
.folder-table th, .folder-table td { padding: 10px 14px; border-bottom: 1px solid #eef0f3; text-align: left; }
.folder-table tbody tr:last-child td { border-bottom: 0; }
.folder-table th { background: #fafbfc; color: #667085; font-size: 13px; font-weight: 600; }
.folder-table .num { width: 110px; text-align: right; white-space: nowrap; }
.folder-table .acts { width: 170px; text-align: right; white-space: nowrap; }
.folder-table td a { color: var(--fg); text-decoration: none; }
.folder-table td a:hover { color: #1f4e8c; text-decoration: underline; }
.folder-table tr.system + tr:not(.system) td { border-top: 2px solid #e4e7ec; }
.unread-count { color: #1f4e8c; font-weight: 600; }
.folder-table .act { margin-left: 4px; padding: 4px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 12px; cursor: pointer; }
.folder-table .act:hover:not(:disabled) { background: #f5f6f8; }
.folder-table .act:disabled { color: #b8bec7; border-color: #e4e7ec; cursor: default; }
.folder-table .act.danger { color: #b42318; border-color: #f3c5c0; }
.folder-table .act.danger:hover { background: #fef3f2; }

.folder-forms { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding: 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.folder-form { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.folder-form label { color: #475467; font-size: 13px; font-weight: 600; }
.ff-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ff-row input, .ff-row select { height: 34px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; }
.ff-row input { flex: 1; min-width: 180px; max-width: 360px; }
.ff-row input:focus, .ff-row select:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.ff-arrow { color: #98a2b3; }
.ff-btn { height: 34px; padding: 0 18px; border: 1px solid #9ec3ee; border-radius: 6px; background: #cfe3fb; color: #1f4e8c; font: inherit; font-weight: 700; cursor: pointer; }
.ff-btn:hover { background: #b9d6f8; }
.ff-hint { margin-left: 120px; color: #8a94a6; font-size: 12px; }
@media (max-width: 600px) {
    .folder-form { grid-template-columns: 1fr; }
    .ff-hint { margin-left: 0; }
    .folder-table .num:nth-child(2) { display: none; }
}

/* ---- 주소록 ---- */
.contacts-page { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }
.contacts-page h1 { font-size: 20px; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid #d0d5dd; border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: 7px 16px; color: #475467; font-size: 13px; text-decoration: none; }
.seg a + a { border-left: 1px solid #d0d5dd; }
.seg a.on { background: #cfe3fb; color: #1f4e8c; font-weight: 700; }
.seg a:not(.on):hover { background: #f5f6f8; }
.ct-note { margin-bottom: 12px; padding: 9px 12px; background: #f8fafd; border: 1px solid #dce6f3; border-radius: 6px; color: #475467; font-size: 13px; }
.ct-quick { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 1fr auto; gap: 8px; margin-bottom: 14px; padding: 12px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.ct-quick input, .ct-edit input, .ct-paste textarea { height: 34px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; min-width: 0; }
.ct-quick input:focus, .ct-edit input:focus, .ct-paste textarea:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.ct-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ct-toolbar button, .ct-toolbar .tb-link { padding: 6px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.ct-toolbar button:hover, .ct-toolbar .tb-link:hover { background: #f5f6f8; }
.ct-count { margin-left: auto; color: #8a94a6; font-size: 12px; }
.ct-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; overflow: hidden; font-size: 14px; }
.ct-table th, .ct-table td { padding: 9px 12px; border-bottom: 1px solid #eef0f3; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-table tbody tr:last-child td { border-bottom: 0; }
.ct-table th { background: #fafbfc; color: #667085; font-size: 13px; font-weight: 600; }
.ct-table th a { color: inherit; text-decoration: none; }
.ct-table th:nth-child(2) { width: 38%; }
.ct-table tbody tr:hover { background: #f7f9fc; }
.ct-table td a { color: var(--fg); text-decoration: none; }
.ct-table td.ct-name a { font-weight: 600; }
.ct-table td a:hover { color: #1f4e8c; text-decoration: underline; }
.ct-table .dim { margin-left: 6px; font-size: 12px; }

.ct-edit { display: flex; flex-direction: column; gap: 14px; }
.ct-section { margin: 0; padding: 14px 16px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.ct-section legend { padding: 0 6px; color: #1f4e8c; font-size: 13px; font-weight: 700; }
.ct-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.ct-grid label { display: flex; flex-direction: column; gap: 4px; color: #475467; font-size: 12px; font-weight: 600; }
.ct-grid label.wide { grid-column: 1 / -1; }
.ct-edit input[readonly] { background: #f8f9fb; color: #475467; }

.ct-import { display: flex; flex-direction: column; gap: 14px; }
.ct-file { cursor: pointer; }
.ct-paste { display: flex; flex-direction: column; gap: 6px; color: #475467; font-size: 13px; font-weight: 600; }
.ct-paste textarea { height: auto; padding: 8px 10px; font: 12px/1.5 Consolas, monospace; resize: vertical; }
@media (max-width: 700px) {
    .ct-quick { grid-template-columns: 1fr 1fr; }
    .ct-grid { grid-template-columns: 1fr; }
}
.ct-table th.c-check, .ct-table td.c-check { width: 44px; text-overflow: clip; text-align: center; }
.ct-edit input { font-weight: 400; color: var(--fg); }

/* ---- 첨부 아이콘: 목록에서는 작고 연하게 ---- */
.att { color: #a3acb9; }
.mail-list .ico-att { width: 11px; height: 11px; }
.side-list .ico-att { width: 10px; height: 10px; }

/* ---- 메일 읽기: 주소 저장 링크 ---- */
.read-head .save-addr { margin-left: 10px; padding: 1px 8px; border: 1px solid #d0d5dd; border-radius: 10px; color: #475467; font-size: 12px; white-space: nowrap; }
.read-head .save-addr:hover { background: #f5f6f8; color: var(--fg); }
/* 받는 사람 · 참조: 3줄 넘으면 줄임 (+ / − 단추는 mail.js) */
.addr-wrap { display: flex; align-items: flex-start; gap: 6px; }
.addr-list { flex: 1; min-width: 0; }
.addr-list.clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.addr-toggle { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; border: 1px solid #d0d5dd; border-radius: 4px; background: #fff; color: #475467; font: 700 14px/1 sans-serif; cursor: pointer; }
.addr-toggle:hover { background: #f5f6f8; color: var(--fg); }

/* ---- 주소 저장 화면 ---- */
.save-table td input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid #d0d5dd; border-radius: 6px; font: inherit; font-size: 13px; }
.save-table td input:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.save-table td { white-space: normal; }
.save-table th:nth-child(2) { width: auto; }
.save-table th:nth-child(3) { width: 34%; }
.save-table tr.existing td { color: #667085; }
.saved { color: #12b76a; font-weight: 700; }
.save-legend { margin-top: 8px; color: #667085; font-size: 12px; }

/* ---- 메일 쓰기: 받는 사람 칸 옆 주소록 단추 + 고르기 창 ---- */
.addr-field { display: flex; gap: 6px; min-width: 0; }
.addr-field input { flex: 1; min-width: 0; }
.pick-btn { flex: none; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #475467; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.pick-btn:hover { background: #eef5ff; border-color: #9ec3ee; color: #1f4e8c; }
/* 받는 사람 칸 자동 완성 목록 (address-suggest.js) — 칸 바로 아래에 띄움 */
.addr-suggest { position: absolute; z-index: 50; max-height: 320px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #d0d5dd; border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 24, 40, .16); }
.addr-suggest li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; }
.addr-suggest li.on { background: #eef5ff; }
.as-name { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #1d2939; }
.as-mail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #667085; font-size: 13px; }
.as-tag { flex: none; padding: 1px 6px; border-radius: 4px; background: #f2f4f7; color: #667085; font-size: 11px; white-space: nowrap; }
.as-tag.as-recent { background: #fff4e5; color: #b54708; }
.as-remove { flex: none; width: 22px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: #98a2b3; font-size: 16px; line-height: 1; cursor: pointer; }
.as-remove:hover { background: #fee4e2; color: #b42318; }
.pick-dialog { width: min(520px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px)); margin: auto; padding: 0; border: 0; border-radius: 12px; box-shadow: 0 20px 50px rgba(8, 20, 40, .3); }
.pick-dialog[open] { display: flex; flex-direction: column; }
.pick-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.pick-head h2 { font-size: 16px; }
.pick-search { margin: 0 18px 8px; height: 36px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; font-size: 14px; }
.pick-search:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.pick-list { flex: 1; min-height: 180px; overflow-y: auto; margin: 0 18px; border: 1px solid #eef0f3; border-radius: 8px; }
.pick-list li + li { border-top: 1px solid #f2f4f7; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.pick-list label:hover { background: #f7f9fc; }
.pick-list input { flex: none; width: 16px; height: 16px; accent-color: #4a8fe7; }
.pick-name { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pick-mail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #667085; font-size: 13px; }
.pick-empty { padding: 24px 12px; color: #98a2b3; font-size: 13px; text-align: center; }
.pick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.pick-count { margin-right: auto; color: #1f4e8c; font-size: 13px; font-weight: 700; }
.pick-actions button { height: 34px; padding: 0 18px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.pick-actions .pick-ok { background: #393939; border-color: #393939; color: #fff; font-weight: 700; }
.pick-actions .pick-ok:hover { background: #4d4d4d; }

/* ---- 로그인 안내: 예시 · 덧붙임은 다음 줄에 한 줄로, 카드를 조금 넓혀 긴 문장도 한 줄에 ---- */
.login { max-width: 470px; }
.login-notice .dim { display: block; white-space: nowrap; }
.login-notice li { white-space: nowrap; }
@media (max-width: 480px) { .login-notice li, .login-notice .dim { white-space: normal; } }

/* ---- 첨부 아이콘 조금 더 진하게 ---- */
.att { color: #7f8a99; }

/* ---- 환경 설정 ---- */
.options-page { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.options-page h1 { font-size: 20px; margin-bottom: 14px; }
.opt-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.opt-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: #fff; border: 1px solid #e4e7ec; border-radius: 10px; color: var(--fg); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.opt-card:hover { border-color: #9ec3ee; box-shadow: 0 4px 14px rgba(31, 78, 140, .08); }
.opt-title { color: #1f4e8c; font-size: 15px; font-weight: 700; }
.opt-desc { color: #667085; font-size: 13px; line-height: 1.5; }
.opt-card.disabled { background: #fafbfc; cursor: default; }
.opt-card.disabled .opt-title { color: #98a2b3; }
.opt-card .soon { margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: #eef1f5; color: #98a2b3; font-size: 11px; font-weight: 600; }

.opt-form { display: flex; flex-direction: column; gap: 14px; }
.opt-form > div:not([class]), .adm-tabpanel { display: flex; flex-direction: column; gap: 14px; }
.adm-tabpanel[hidden] { display: none; }
/* 관리 화면 탭 (서비스 설정 — 스팸 차단 등, 원본 화면의 탭) */
.adm-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: -6px; }
.adm-tabs[hidden] { display: none; }
.adm-tabs button { padding: 8px 16px; border: 1px solid #d0d5dd; border-radius: 6px 6px 0 0; background: #f2f4f7; color: #475467; font: inherit; font-size: 14px; cursor: pointer; }
.adm-tabs button:hover { background: #e9eef6; color: var(--fg); }
.adm-tabs button.on { background: #dfeffc; border-color: #9cc3ea; color: #1f4e8c; font-weight: 700; }
.opt-group { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 16px 18px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.opt-group legend { padding: 0 6px; color: #1f4e8c; font-size: 13px; font-weight: 700; }
.opt-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; color: #475467; font-size: 13px; font-weight: 600; }
.opt-row.top { align-items: start; }
.opt-row.top > span { padding-top: 8px; }
.opt-col { display: flex; flex-direction: column; gap: 6px; color: #475467; font-size: 13px; font-weight: 600; }
.opt-form input:not([type="checkbox"]):not([type="radio"]), .opt-form select, .opt-form textarea {
    min-height: 36px; padding: 6px 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; font-weight: 400; color: var(--fg); }
.opt-form select { justify-self: start; }
.opt-form textarea { resize: vertical; line-height: 1.5; }
.opt-form .mono { font: 13px/1.5 Consolas, "Malgun Gothic", monospace; }
.opt-form .opt-wide { width: 100%; }
.opt-form input:focus, .opt-form select:focus, .opt-form textarea:focus { outline: none; border-color: #4a8fe7; box-shadow: 0 0 0 3px rgba(74, 143, 231, .18); }
.opt-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.opt-radio input { accent-color: #4a8fe7; }
.opt-inline { display: flex; gap: 8px; flex-wrap: wrap; padding-left: 42px; }
.opt-note { color: #667085; font-size: 12.5px; line-height: 1.55; }
.opt-rules { margin: 0; padding: 10px 14px 10px 28px; border-radius: 6px; background: #f8fafd; color: #475467; font-size: 12.5px; list-style: disc; }
@media (max-width: 640px) { .opt-row { grid-template-columns: 1fr; gap: 6px; } .opt-inline { padding-left: 0; } }
.opt-row input:not([type="checkbox"]):not([type="radio"]) { max-width: 440px; }

/* ---- 사용자 필터 ---- */
.flt-add { display: inline-flex; align-items: center; text-decoration: none; }
.flt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; list-style: none; }
.flt-item { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 10px; }
.flt-item.off { background: #fafbfc; }
.flt-item.off .flt-title a { color: #98a2b3; }
.flt-main { min-width: 0; flex: 1; }
.flt-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.flt-title a { color: #1f4e8c; font-weight: 700; text-decoration: none; }
.flt-title a:hover { text-decoration: underline; }
.flt-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eef5ff; color: #1f4e8c; font-size: 12px; font-weight: 700; }
.flt-state { padding: 1px 8px; border-radius: 10px; background: #ecfdf3; color: #067647; font-size: 11px; font-weight: 600; }
.flt-item.off .flt-state { background: #f2f4f7; color: #667085; }
.flt-cond { display: flex; flex-direction: column; gap: 2px; padding-left: 30px; font-size: 13px; color: #475467; }
.flt-cond code { padding: 0 5px; border-radius: 4px; background: #f2f4f7; color: #1d2939; font: 12.5px Consolas, "Malgun Gothic", monospace; word-break: break-all; }
.flt-then { padding: 4px 0 0 30px; color: #1d2939; font-size: 13px; font-weight: 600; }
.flt-tools { flex: none; }
.flt-tools form { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 28px; height: 28px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #475467; font-size: 11px; cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: #f5f6f8; }
.icon-btn:disabled { color: #d0d5dd; cursor: default; }
.flt-tools .act { padding: 4px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.flt-tools .act:hover { background: #f5f6f8; }
.flt-tools .act.danger { color: #b42318; border-color: #f3c5c0; }

.flt-grid { display: grid; grid-template-columns: 150px 190px 1fr auto; gap: 8px 10px; align-items: center; }
.flt-field { color: #475467; font-size: 13px; font-weight: 600; }
.flt-op-fixed { font-size: 13px; padding-left: 4px; }
.flt-case { display: flex; align-items: center; gap: 6px; color: #667085; font-size: 12px; white-space: nowrap; }
.flt-case input { accent-color: #4a8fe7; }
.flt-action { display: flex; gap: 8px; flex-wrap: wrap; }
.flt-action #flt-address { flex: 1; min-width: 240px; }
@media (max-width: 760px) { .flt-grid { grid-template-columns: 1fr 1fr; } .flt-field { grid-column: 1 / -1; margin-top: 6px; } .flt-item { flex-direction: column; } }
.pager { justify-content: flex-start; }   /* 페이지 넘기기는 왼쪽에 */

/* ---- 환경 설정: 메뉴 카드를 넓혀 제목 · 설명이 한 줄에 ---- */
.options-page { max-width: 1140px; }
.opt-menu { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); }
/* 설정 화면은 읽기 좋은 폭 그대로 */
.options-page .opt-form { max-width: 860px; }

/* ---- 설정 묶음 제목: 테두리에 걸치지 않고 상자 안 머리글로 ---- */
.opt-group > legend { float: left; width: 100%; margin: 0 0 4px; padding: 0 0 10px; border-bottom: 1px solid #eef0f3; color: #1d2939; font-size: 14px; font-weight: 700; }
.opt-group > legend + * { clear: both; }

/* ---- 시스템 로그 ---- */
.journal-page { padding: 20px 16px 40px; }
.journal-page h1 { font-size: 20px; margin-bottom: 14px; }
.jr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.jr-bar select { height: 34px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 14px; }
.jr-bar .ff-btn { padding: 0 14px; font-size: 14px; font-weight: 500; }
.jr-time, .jr-count { color: #667085; font-size: 13px; }
.jr-count { margin-left: auto; }
.jr-wrap { overflow-x: auto; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.jr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.jr-table th, .jr-table td { padding: 7px 10px; border-bottom: 1px solid #eef0f3; text-align: left; white-space: nowrap; }
.jr-table th { position: sticky; top: 0; background: #fafbfc; color: #667085; font-weight: 600; }
.jr-table tbody tr:hover { background: #f7f9fc; }
.jr-table td { font-family: Consolas, "Malgun Gothic", monospace; color: #344054; }

/* ------------------------------------------------------------------ 도메인 관리 */
.dm-head { max-width: 1140px; margin: 0 auto; padding: 20px 16px 0; }
.dm-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.dm-title h1 { margin: 0; font-size: 20px; }
.dm-domain { color: #667085; font-size: 14px; }
.dm-menu { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid #e4e7ec; }
.dm-menu a { padding: 6px 14px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; color: #475467; font-size: 13px; text-decoration: none; }
.dm-menu a:hover { background: #f5f8fd; }
.dm-menu a.on { border-color: #9ec3ee; background: #cfe3fb; color: #1f4e8c; font-weight: 700; }
.dm-page { padding-top: 16px; }
.dm-h2 { margin: 0 0 14px; font-size: 17px; color: #1d2939; word-break: break-all; }
.dm-info { display: grid; grid-template-columns: 170px 1fr; gap: 10px 12px; margin: 0; font-size: 13px; }
.dm-info dt { color: #475467; font-weight: 600; }
.dm-info dd { margin: 0; color: #1d2939; }
.dm-stat { margin: 0; padding: 10px 12px; background: #f8f9fb; border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.dm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.dm-count { display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px 12px; min-width: 220px; font-size: 13px; color: #475467; }
.dm-count .usage-bar { grid-column: 1 / -1; }
.dm-new { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-new .ff-btn { display: inline-flex; align-items: center; text-decoration: none; }
.ff-btn.disabled { border-color: #e4e7ec; background: #f2f4f7; color: #98a2b3; cursor: default; }
.dm-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.dm-search input { flex: 0 1 280px; height: 34px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; font: inherit; font-size: 14px; }
.dm-search .act { color: var(--accent); font-size: 13px; }
.dm-az { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; font-size: 12px; }
.dm-az a { min-width: 24px; padding: 3px 6px; border-radius: 4px; color: #475467; text-align: center; text-decoration: none; }
.dm-az a:hover { background: #eef1f5; }
.dm-az a.on { background: #1f4e8c; color: #fff; }
.dm-wrap { overflow-x: auto; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; }
.dm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dm-table th, .dm-table td { padding: 9px 12px; border-bottom: 1px solid #eef0f3; text-align: left; white-space: nowrap; }
.dm-table tbody tr:last-child td { border-bottom: 0; }
.dm-table th { background: #fafbfc; color: #667085; font-weight: 600; }
.dm-table tbody tr:hover { background: #f7f9fc; }
.dm-table tr.off td { color: #98a2b3; }
.dm-table .dm-sort { color: inherit; text-decoration: none; }
.dm-table .dm-name a { color: #1f4e8c; font-weight: 600; text-decoration: none; }
.dm-table .dm-name a:hover { text-decoration: underline; }
.dm-role { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #f2f4f7; color: #475467; font-size: 12px; }
.dm-role.admin { background: #fdecec; color: #b42318; }
.dm-role.alias { background: #ecf3fd; color: #1f4e8c; }
.dm-table td.dm-storage { min-width: 140px; }   /* 사용량을 나중에 채워도 칸 너비가 덜 움직이게 */
.dm-storage a { color: inherit; text-decoration: none; }
.dm-storage a:hover { text-decoration: underline; }
.dm-storage a.high { color: #b42318; }
.usage-bar.mini { width: 90px; height: 5px; margin-top: 4px; }
.dm-table .acts { width: 1%; text-align: right; }
.dm-table .act { margin-left: 4px; padding: 4px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.dm-table .act:hover { background: #f5f6f8; }
.dm-table .act.danger { color: #b42318; border-color: #f3c5c0; }
.dm-table .act.danger:hover { background: #fef3f2; }
.dm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.dm-addr { display: flex; align-items: center; gap: 6px; }
.dm-addr input { flex: 0 1 240px; }
.dm-num { width: 140px; }
/* 문장 안의 숫자 칸 (스팸 점수 기준 등) — 한 줄, 두 자리 숫자 폭 */
.adm-inline-num { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.adm-inline-num > span:first-child { font-weight: 600; }
.opt-form .adm-inline-num input.adm-num-xs { width: 72px; text-align: center; }
.adm-inline-num.bad input { border-color: var(--error); }
.dm-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--fg); cursor: pointer; }
.dm-check input { margin-top: 2px; }
.dm-check input:disabled + span { color: #98a2b3; }
.dm-sub { margin: -6px 0 2px 24px; }
.dm-list-opts { display: flex; flex-direction: column; gap: 12px; }
.dm-list-opts[hidden] { display: none; }
.opt-form textarea { width: 100%; max-width: 640px; padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; font: inherit; font-size: 13px; resize: vertical; }
.dm-info { grid-template-columns: 230px 1fr; }
.dm-new .ff-btn, .dm-search .ff-btn, .dm-page .toolbar .ff-btn { font-size: 14px; font-weight: 600; }
.dm-page .opt-row a { color: #1f4e8c; font-weight: 400; }@media (max-width: 640px) {
    .dm-info { grid-template-columns: 1fr; gap: 2px; }
    .dm-info dd { margin-bottom: 8px; }
}
.dm-su { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 860px; margin-top: 18px; padding: 14px 18px; background: #fff; border: 1px solid #f3c5c0; border-radius: 8px; font-size: 13px; }
.dm-su p { margin: 4px 0 0; }
.dm-su .act { flex: none; padding: 6px 14px; border: 1px solid #f3c5c0; border-radius: 6px; background: #fff; color: #b42318; font: inherit; cursor: pointer; }
.dm-su .act:hover { background: #fef3f2; }
.dm-vars code { margin-right: 6px; }
.dm-journal { max-width: 1140px; margin: 0 auto; padding-top: 16px; }
.dm-page .ct-head .dm-h2 { margin: 0; }
.dm-page .flt-add { display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; }
/* 로그 칸: 긴 주소는 칸 안에서 줄바꿈 (넘쳐서 옆 칸에 가려지지 않게) */
.jr-table td { max-width: 340px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }

/* ------------------------------------------------------------------ 시스템 관리 */
.adm-badge { margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: #1f4e8c; color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.adm-menu { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 16px; background: #fff; border-bottom: 1px solid #e4e7ec; }
.adm-menu a, .adm-menu span { padding: 11px 14px; border-bottom: 3px solid transparent; color: #475467; font-size: 14px; text-decoration: none; }
.adm-menu a:hover { color: #1f4e8c; }
.adm-menu a.on { border-bottom-color: #4a8fe7; color: #1f4e8c; font-weight: 700; }
.adm-menu span.disabled { color: #b8bec7; cursor: default; }
.adm-page { padding-top: 18px; }
.adm-h1 { margin: 0 0 14px; font-size: 20px; word-break: break-all; }
.adm-sub { margin-bottom: 16px; }
.adm-radios { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 400; color: var(--fg); }
.adm-radios.col { flex-direction: column; }
.adm-radios label { display: inline-flex; align-items: baseline; gap: 6px; }
.adm-dns { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-weight: 400; color: var(--fg); }
.dm-su input { margin-top: 8px; width: 100%; max-width: 280px; height: 32px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; font: inherit; }
.dm-new .act { padding: 6px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
fieldset[hidden] { display: none; }
/* 로고 = 웹메일(관리자는 관리 첫 화면)으로 가는 링크 */
.topbar a.brand, .topbar .brand > a { color: inherit; text-decoration: none; }
/* 메일 쓰기 버튼은 목록 머리 오른쪽 끝 */
.list-head .compose-btn { margin: 0 0 0 auto; align-self: center; }
/* 도메인 목록 아래: 왼쪽 도메인 수 · 새 도메인, 오른쪽 쪽 이동 */
.adm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 14px; }
.adm-foot-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.adm-foot-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; font-size: 13px; }
.adm-foot .ff-btn { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; text-decoration: none; }
/* 도메인 수 · 새 도메인은 붙여서 (막대는 짧게) */
.adm-foot .dm-count { display: flex; align-items: center; gap: 8px; min-width: 0; }
.adm-foot .dm-count .usage-bar { width: 110px; }
.adm-foot-left { gap: 12px; }
/* 시스템 관리 설정 화면 */
.adm-page .opt-form + .opt-form, .adm-page .opt-form + section.opt-form, .adm-page section.opt-form + .opt-form { margin-top: 16px; }
.adm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.adm-stack { display: flex; flex-direction: column; gap: 10px; }
.adm-indent { margin-left: 182px; }
.adm-inline .act, .adm-indent .act { padding: 5px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.adm-inline .act.danger { color: #b42318; border-color: #f3c5c0; }
.adm-page .ff-btn { font-size: 14px; font-weight: 600; }
.opt-rules[hidden] { display: none; }
@media (max-width: 640px) { .adm-indent { margin-left: 0; } }
/* 로그 표: IP · 날짜 칸은 한 줄로 */
.jr-table td.nw { white-space: nowrap; max-width: none; }
/* 시스템 관리 화면은 넓게 */
/* 넓은 화면은 시스템 로그만 (그 밖의 관리 화면은 다른 화면과 같은 폭) */
.adm-journal { max-width: 1440px; }
/* 외부 전달 점검 */
.fa-intro { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.fa-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.fa-run .primary { height: 36px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--btn); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.fa-run .primary:disabled { opacity: .6; cursor: wait; }
.fa-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.fa-chip { padding: 4px 12px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; font-size: 13px; }
.fa-chip b { margin-left: 4px; color: var(--accent); }
.fa-table td { vertical-align: top; }
.fa-ext { color: var(--accent); }
.fa-addr { word-break: break-all; max-width: 420px; }
.fa-off td { color: #98a2b3; }
.fa-tag { margin-left: 6px; padding: 0 6px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 11px; }
.adm-page .jr-wrap + .opt-note { margin-top: 10px; }
/* 외부 전달 점검 메뉴의 탭 (링크 — 서비스 설정 탭과 같은 모양) */
.fa-tabs { margin: 0 0 14px; border-bottom: 1px solid #d0d5dd; }
.fa-tabs a { padding: 8px 16px; border: 1px solid #d0d5dd; border-bottom: 0; border-radius: 6px 6px 0 0; background: #f2f4f7; color: #475467; font-size: 14px; text-decoration: none; }
.fa-tabs a:hover { background: #e9eef6; color: var(--fg); }
.fa-tabs a.on { background: #dfeffc; border-color: #9cc3ea; color: #1f4e8c; font-weight: 700; }
.fa-bad { margin: 6px 0 0 18px; list-style: disc; }
.fa-errors { margin-top: 14px; font-size: 13px; color: var(--dim); }
.fa-errors ul { margin: 6px 0 0 18px; list-style: disc; }
.adm-page .opt-form textarea { max-width: none; }
/* A~Z 바로 찾기: 한 단계 크게, 더 진하게 */
.dm-az { font-size: 13px; }
.dm-az a { color: #1d2939; font-weight: 600; }
.dm-az a.on { color: #fff; }
/* 시스템 관리 — 서비스 */
.adm-state { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.adm-state.on { background: #ecfdf3; color: #067647; }
.adm-state.off { background: #fef3f2; color: #b42318; }
.adm-refresh { padding: 5px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font-size: 13px; text-decoration: none; }
.adm-num { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; }
.opt-row.bad input, .opt-row.bad textarea, textarea.bad { border-color: #d92d20; background: #fffbfa; }
.adm-after { margin-top: 14px; }
.adm-after .act { padding: 6px 14px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.dm-table .c-check { width: 1%; }
/* SMTP 발송 대기열 */
.adm-queue { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; max-width: 860px; margin-bottom: 16px; padding: 12px 16px; background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; font-size: 13px; }
.adm-queue > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.adm-queue.stopped { border-color: #f3c5c0; }
.adm-queue .error-box { flex-basis: 100%; margin: 0; }
.adm-queue .act { padding: 4px 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.adm-queue .act.danger { color: #b42318; border-color: #f3c5c0; }
.adm-hint code { font-size: 12px; }
/* 인증서: 경로는 넓게(추가 인증서 칸과 같은 폭), 비밀번호는 절반 */
.adm-page .opt-row input.adm-wide { max-width: none; }
.adm-page .opt-row input.adm-half { max-width: 220px; }
/* DB-커넥터 · 공지 메일 */
.adm-page input.adm-full { width: 100%; max-width: none; height: 34px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 6px; font: inherit; font-size: 13px; }
.adm-event { border: 1px solid #eef0f3; border-radius: 6px; background: #fcfcfd; }
.adm-event > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; font-size: 13px; cursor: pointer; }
.adm-event[open] > summary { border-bottom: 1px solid #eef0f3; }
.adm-event > form { padding: 12px; }
.adm-hint code { display: inline-block; margin: 0 6px 2px 0; }
.adm-inline .act { padding: 6px 14px; }
.adm-targets label { align-items: center; }
/* 로그 날짜 검색 · 쪽 이동 */
.jr-dates { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jr-dates input[type="date"] { height: 34px; padding: 0 8px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.jr-dates .act { height: 34px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--fg); font: inherit; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.jr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; font-size: 13px; }

/* 메일 목록 아래 용량 바 (기존 qa_desc) — 너비는 CSP 때문에 인라인 style 대신 qw-0~100 */
.quota-bar { display: flex; align-items: center; height: 20px; margin: 12px 0 4px; border: 1px solid #9cb4e4; background: #fff; font-size: 12px; overflow: hidden; }
.quota-fill { flex: 0 0 auto; height: 100%; background: #0033bb; color: #efefef; text-align: right; display: flex; align-items: center; justify-content: flex-end; }
.quota-fill.high { background: #ff0000; }
.quota-fill span { padding-right: 10px; }
.quota-pct, .quota-max { padding: 0 8px; color: #393939; white-space: nowrap; }
.qw-0{width:0%}.qw-1{width:1%}.qw-2{width:2%}.qw-3{width:3%}.qw-4{width:4%}.qw-5{width:5%}.qw-6{width:6%}.qw-7{width:7%}.qw-8{width:8%}.qw-9{width:9%}.qw-10{width:10%}.qw-11{width:11%}.qw-12{width:12%}.qw-13{width:13%}.qw-14{width:14%}.qw-15{width:15%}.qw-16{width:16%}.qw-17{width:17%}.qw-18{width:18%}.qw-19{width:19%}.qw-20{width:20%}.qw-21{width:21%}.qw-22{width:22%}.qw-23{width:23%}.qw-24{width:24%}.qw-25{width:25%}.qw-26{width:26%}.qw-27{width:27%}.qw-28{width:28%}.qw-29{width:29%}.qw-30{width:30%}.qw-31{width:31%}.qw-32{width:32%}.qw-33{width:33%}.qw-34{width:34%}.qw-35{width:35%}.qw-36{width:36%}.qw-37{width:37%}.qw-38{width:38%}.qw-39{width:39%}.qw-40{width:40%}.qw-41{width:41%}.qw-42{width:42%}.qw-43{width:43%}.qw-44{width:44%}.qw-45{width:45%}.qw-46{width:46%}.qw-47{width:47%}.qw-48{width:48%}.qw-49{width:49%}.qw-50{width:50%}.qw-51{width:51%}.qw-52{width:52%}.qw-53{width:53%}.qw-54{width:54%}.qw-55{width:55%}.qw-56{width:56%}.qw-57{width:57%}.qw-58{width:58%}.qw-59{width:59%}.qw-60{width:60%}.qw-61{width:61%}.qw-62{width:62%}.qw-63{width:63%}.qw-64{width:64%}.qw-65{width:65%}.qw-66{width:66%}.qw-67{width:67%}.qw-68{width:68%}.qw-69{width:69%}.qw-70{width:70%}.qw-71{width:71%}.qw-72{width:72%}.qw-73{width:73%}.qw-74{width:74%}.qw-75{width:75%}.qw-76{width:76%}.qw-77{width:77%}.qw-78{width:78%}.qw-79{width:79%}.qw-80{width:80%}.qw-81{width:81%}.qw-82{width:82%}.qw-83{width:83%}.qw-84{width:84%}.qw-85{width:85%}.qw-86{width:86%}.qw-87{width:87%}.qw-88{width:88%}.qw-89{width:89%}.qw-90{width:90%}.qw-91{width:91%}.qw-92{width:92%}.qw-93{width:93%}.qw-94{width:94%}.qw-95{width:95%}.qw-96{width:96%}.qw-97{width:97%}.qw-98{width:98%}.qw-99{width:99%}.qw-100{width:100%}

/* 시스템 관리 → DKIM · DMARC (/admin/dkim) */
.dk-detail h2 { font-size: 18px; margin: 4px 0 10px; }
.dk-detail h2 a { font-size: 13px; font-weight: 400; margin-left: 8px; }
.dk-detail h3 { font-size: 15px; margin: 18px 0 6px; }
.dk-table { width: 100%; border-collapse: collapse; }
.dk-table th { width: 150px; text-align: left; vertical-align: top; padding: 6px 8px 6px 0; font-weight: 500; color: var(--muted, #666); }
.dk-table td { padding: 6px 0; vertical-align: top; word-break: break-all; }
.dk-table textarea { width: calc(100% - 70px); min-width: 200px; font-size: 12px; vertical-align: top; }
.dk-ok { color: #1a7f37; }
.dk-bad { color: #c62828; }
.dk-unknown { color: #a15c00; }
.dk-force { font-size: 12px; margin: 0 8px; }
.dk-howto { margin-top: 8px; }
.dk-howto ol { margin: 4px 0 0 18px; padding: 0; }
.dk-howto li { margin: 2px 0; }
tr.sel td { background: var(--hover, #f3f6fb); }
/* 도메인 관리 → 사용자 일괄 추가 (/domain/users/bulk) */
.bulk-table td { vertical-align: top; }
.bulk-table tr.bulk-bad td { color: #c62828; }
.bulk-errors { margin: 8px 0 0 18px; color: #c62828; }

/* 시스템 관리 → 스팸 기록 원문 (2026-10-14) */
.adm-spam-original { font-size: 12px; line-height: 1.5; word-break: break-all; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 6px; max-height: 70vh; overflow: auto; }
.adm-spamlog td { word-break: break-all; }
