/*
 * Rebeauty Mail — 관리자 콘솔(PostfixAdmin) 테마
 * 템플릿: templates/rebeauty/  ·  설정: $CONF['theme'] = 'rebeauty'
 *
 * 토큰·Pretendard·아이콘(.rb-icon)·2열 로그인(.rb-auth)은 공유 디자인 시스템
 * /rb-assets/rb-design.css 에서 가져온다 (이 파일보다 먼저 로드됨, 여기서 재정의하지 않음).
 *
 * 1) 기본  2) 아이콘 목록  3) 레이아웃(헤더·사이드바·본문)  4) 페이지 헤더·카드
 * 5) 버튼·배지·상태  6) 표  7) 폼  8) 알림·대화상자  9) 페이지별  10) 반응형
 */

/* ── 1. 기본 ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
body.rb-console {
    min-width: 320px;
    background: var(--rb-bg-app);
    color: var(--rb-text);
    font-family: var(--rb-font);
    font-size: var(--rb-fs);
    line-height: var(--rb-lh);
    letter-spacing: var(--rb-tracking);
    word-break: keep-all;          /* 한글은 어절 단위로 줄바꿈 */
    overflow-wrap: break-word;     /* 긴 영문·주소는 넘칠 때만 끊음 (표 열 폭 계산에는 영향 없음) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body.rb-console a { color: var(--rb-primary); text-decoration: none; }
body.rb-console a:hover { text-decoration: underline; }
body.rb-console h1, body.rb-console h2, body.rb-console h3, body.rb-console h4, body.rb-console p { margin: 0; }
body.rb-console button, body.rb-console input, body.rb-console select, body.rb-console textarea {
    font: inherit; letter-spacing: inherit; color: inherit;
}
body.rb-console :focus-visible { outline: 2px solid var(--rb-primary); outline-offset: 2px; }
body.rb-console input[type="checkbox"], body.rb-console input[type="radio"] {
    width: 16px; height: 16px; margin: 0; accent-color: var(--rb-primary); flex: none; cursor: pointer;
}
body.rb-auth-page { margin: 0; }
.rb-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.rb-num { font-variant-numeric: tabular-nums; }
.rb-muted { color: var(--rb-text-muted); }
.rb-mono { font-family: var(--rb-font-mono); font-size: .95em; letter-spacing: 0; }

/* ── 2. 아이콘 (Lucide, ISC) — <i class="rb-icon i-users" aria-hidden="true"></i> ── */
.i-arrow-left { --rb-icon: url(/rb-assets/icons/lucide/arrow-left.svg); }
.i-arrow-right { --rb-icon: url(/rb-assets/icons/lucide/arrow-right.svg); }
.i-at-sign { --rb-icon: url(/rb-assets/icons/lucide/at-sign.svg); }
.i-book-open { --rb-icon: url(/rb-assets/icons/lucide/book-open.svg); }
.i-calendar { --rb-icon: url(/rb-assets/icons/lucide/calendar.svg); }
.i-check { --rb-icon: url(/rb-assets/icons/lucide/check.svg); }
.i-chevron-down { --rb-icon: url(/rb-assets/icons/lucide/chevron-down.svg); }
.i-chevron-left { --rb-icon: url(/rb-assets/icons/lucide/chevron-left.svg); }
.i-chevron-right { --rb-icon: url(/rb-assets/icons/lucide/chevron-right.svg); }
.i-chevrons-left { --rb-icon: url(/rb-assets/icons/lucide/chevrons-left.svg); }
.i-circle-alert { --rb-icon: url(/rb-assets/icons/lucide/circle-alert.svg); }
.i-circle-check { --rb-icon: url(/rb-assets/icons/lucide/circle-check.svg); }
.i-copy { --rb-icon: url(/rb-assets/icons/lucide/copy.svg); }
.i-download { --rb-icon: url(/rb-assets/icons/lucide/download.svg); }
.i-external-link { --rb-icon: url(/rb-assets/icons/lucide/external-link.svg); }
.i-file-spreadsheet { --rb-icon: url(/rb-assets/icons/lucide/file-spreadsheet.svg); }
.i-forward { --rb-icon: url(/rb-assets/icons/lucide/forward.svg); }
.i-globe { --rb-icon: url(/rb-assets/icons/lucide/globe.svg); }
.i-globe-lock { --rb-icon: url(/rb-assets/icons/lucide/globe-lock.svg); }
.i-hard-drive { --rb-icon: url(/rb-assets/icons/lucide/hard-drive.svg); }
.i-hourglass { --rb-icon: url(/rb-assets/icons/lucide/hourglass.svg); }
.i-inbox { --rb-icon: url(/rb-assets/icons/lucide/inbox.svg); }
.i-info { --rb-icon: url(/rb-assets/icons/lucide/info.svg); }
.i-key-round { --rb-icon: url(/rb-assets/icons/lucide/key-round.svg); }
.i-layout-dashboard { --rb-icon: url(/rb-assets/icons/lucide/layout-dashboard.svg); }
.i-link { --rb-icon: url(/rb-assets/icons/lucide/link.svg); }
.i-list-checks { --rb-icon: url(/rb-assets/icons/lucide/list-checks.svg); }
.i-lock { --rb-icon: url(/rb-assets/icons/lucide/lock.svg); }
.i-log-out { --rb-icon: url(/rb-assets/icons/lucide/log-out.svg); }
.i-mail { --rb-icon: url(/rb-assets/icons/lucide/mail.svg); }
.i-mail-check { --rb-icon: url(/rb-assets/icons/lucide/mail-check.svg); }
.i-mail-plus { --rb-icon: url(/rb-assets/icons/lucide/mail-plus.svg); }
.i-mail-warning { --rb-icon: url(/rb-assets/icons/lucide/mail-warning.svg); }
.i-mails { --rb-icon: url(/rb-assets/icons/lucide/mails.svg); }
.i-megaphone { --rb-icon: url(/rb-assets/icons/lucide/megaphone.svg); }
.i-menu { --rb-icon: url(/rb-assets/icons/lucide/menu.svg); }
.i-monitor { --rb-icon: url(/rb-assets/icons/lucide/monitor.svg); }
.i-pencil { --rb-icon: url(/rb-assets/icons/lucide/pencil.svg); }
.i-plane { --rb-icon: url(/rb-assets/icons/lucide/plane.svg); }
.i-plus { --rb-icon: url(/rb-assets/icons/lucide/plus.svg); }
.i-refresh-cw { --rb-icon: url(/rb-assets/icons/lucide/refresh-cw.svg); }
.i-scroll-text { --rb-icon: url(/rb-assets/icons/lucide/scroll-text.svg); }
.i-search { --rb-icon: url(/rb-assets/icons/lucide/search.svg); }
.i-send { --rb-icon: url(/rb-assets/icons/lucide/send.svg); }
.i-server { --rb-icon: url(/rb-assets/icons/lucide/server.svg); }
.i-shield-check { --rb-icon: url(/rb-assets/icons/lucide/shield-check.svg); }
.i-shield-user { --rb-icon: url(/rb-assets/icons/lucide/shield-user.svg); }
.i-smartphone { --rb-icon: url(/rb-assets/icons/lucide/smartphone.svg); }
.i-trash-2 { --rb-icon: url(/rb-assets/icons/lucide/trash-2.svg); }
.i-triangle-alert { --rb-icon: url(/rb-assets/icons/lucide/triangle-alert.svg); }
.i-user { --rb-icon: url(/rb-assets/icons/lucide/user.svg); }
.i-user-plus { --rb-icon: url(/rb-assets/icons/lucide/user-plus.svg); }
.i-x { --rb-icon: url(/rb-assets/icons/lucide/x.svg); }

/* ── 3. 레이아웃: 상단 헤더 + 왼쪽 사이드바 + 본문(남은 폭 100%) ── */
.rb-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    height: var(--rb-header-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 16px 0 20px;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--rb-border);
}
.rb-brand {
    display: flex; align-items: center; gap: 10px; flex: none;
    width: calc(var(--rb-sidebar-w) - 36px);
    color: var(--rb-text) !important; text-decoration: none !important;
}
.rb-brand__mark { width: 32px; height: 32px; flex: none; display: block; }
.rb-brand__name { font-size: var(--rb-fs-lg); font-weight: 800; letter-spacing: var(--rb-tracking-tight); white-space: nowrap; }
.rb-brand__tag {
    padding: 2px 8px; border-radius: var(--rb-radius-pill);
    background: var(--rb-primary-soft); color: var(--rb-primary);
    font-size: var(--rb-fs-xs); font-weight: 600; white-space: nowrap;
}
.rb-topbar__search { position: relative; flex: 0 1 420px; min-width: 0; margin: 0; }
.rb-topbar__search .rb-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--rb-text-muted); pointer-events: none;
}
.rb-topbar__search input {
    width: 100%; height: 38px; padding: 0 12px 0 36px;
    border: 1px solid var(--rb-border); border-radius: var(--rb-radius);
    background: var(--rb-bg-subtle); font-size: var(--rb-fs); outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.rb-topbar__search input::placeholder { color: var(--rb-text-subtle); }
.rb-topbar__search input:focus { background: var(--rb-bg); border-color: var(--rb-primary); box-shadow: 0 0 0 3px var(--rb-primary-ring); }
.rb-topbar__spacer { flex: 1; }
.rb-topbar__actions { display: flex; align-items: center; gap: 4px; flex: none; }
.rb-topbar__link {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
    border: 0; border-radius: var(--rb-radius-sm); background: none; cursor: pointer;
    color: var(--rb-text-secondary) !important; font-size: var(--rb-fs); font-weight: 500;
    text-decoration: none !important; white-space: nowrap;
}
.rb-topbar__link .rb-icon { width: 18px; height: 18px; }
.rb-topbar__link:hover { background: var(--rb-bg-muted); color: var(--rb-text) !important; }
.rb-topbar__menu { display: none; }
.rb-user {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    margin: 0 4px 0 8px; padding-left: 14px; border-left: 1px solid var(--rb-border);
}
.rb-user__avatar {
    width: 34px; height: 34px; flex: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--rb-primary-soft); color: var(--rb-primary);
    font-size: var(--rb-fs); font-weight: 700; text-transform: uppercase; letter-spacing: 0;
}
.rb-user__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rb-user__email {
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--rb-fs-sm); font-weight: 600; color: var(--rb-text);
}
.rb-user__role { font-size: var(--rb-fs-xs); color: var(--rb-text-muted); }

.rb-sidebar {
    position: fixed; top: var(--rb-header-h); bottom: 0; left: 0; z-index: 30;
    width: var(--rb-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--rb-bg);
    border-right: 1px solid var(--rb-border);
    overflow-y: auto; overscroll-behavior: contain;
}
.rb-sidebar__head { display: none; }
.rb-nav { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 16px 12px; }
.rb-nav__group--drawer { display: none !important; }
.rb-nav__group { display: flex; flex-direction: column; gap: 2px; }
.rb-nav__heading {
    margin: 0 0 4px; padding: 0 12px;
    font-size: var(--rb-fs-xs); font-weight: 600; color: var(--rb-text-subtle);
}
.rb-nav__item {
    display: flex; align-items: center; gap: 10px;
    min-height: 38px; padding: 7px 12px; border-radius: 8px;
    color: var(--rb-text-secondary) !important; text-decoration: none !important;
    font-size: var(--rb-fs); font-weight: 500; line-height: 1.35;
    transition: background-color .12s, color .12s;
}
.rb-nav__item .rb-icon { width: 18px; height: 18px; color: var(--rb-text-muted); transition: color .12s; }
.rb-nav__item:hover { background: var(--rb-bg-muted); color: var(--rb-text) !important; }
.rb-nav__item:hover .rb-icon { color: var(--rb-text-secondary); }
.rb-nav__item.is-active { background: var(--rb-primary-soft); color: var(--rb-primary) !important; font-weight: 600; }
.rb-nav__item.is-active .rb-icon { color: var(--rb-primary); }
body.rb-console .rb-nav__item:focus-visible { outline-offset: -2px; }
.rb-nav__item--external .rb-icon:last-child { width: 14px; height: 14px; margin-left: auto; color: var(--rb-text-subtle); }
.rb-sidebar__foot {
    padding: 14px 24px 18px; border-top: 1px solid var(--rb-border);
    font-size: var(--rb-fs-xs); color: var(--rb-text-subtle); line-height: 1.6;
}
.rb-sidebar__foot a { color: var(--rb-text-muted) !important; }
.rb-scrim { display: none; }

.rb-main {
    display: flex; flex-direction: column; min-width: 0;
    min-height: 100vh; min-height: 100dvh;
    margin-left: var(--rb-sidebar-w);
    padding-top: var(--rb-header-h);
}
.rb-content {
    flex: 1; width: 100%; min-width: 0;          /* 남은 폭 100% — 가운데 고정폭 컨테이너 없음 */
    display: flex; flex-direction: column; gap: 20px;
    padding: 28px 32px 40px;
}
.rb-footer {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
    padding: 0 32px 24px;
    font-size: var(--rb-fs-xs); color: var(--rb-text-subtle);
}
.rb-footer a { color: var(--rb-text-muted) !important; }
.rb-footer__sep { width: 3px; height: 3px; border-radius: 50%; background: var(--rb-border-strong); }

/* ── 4. 페이지 헤더 · 카드 ───────────────────────────── */
.rb-page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.rb-page-head__text { min-width: 0; }
.rb-crumb {
    display: flex; align-items: center; gap: 4px; margin-bottom: 6px;
    font-size: var(--rb-fs-sm); color: var(--rb-text-muted);
}
.rb-crumb a { color: var(--rb-text-muted) !important; }
.rb-crumb a:hover { color: var(--rb-primary) !important; }
.rb-crumb .rb-icon { width: 14px; height: 14px; color: var(--rb-text-subtle); }
.rb-page-title {
    font-size: var(--rb-fs-2xl); font-weight: 700;
    line-height: var(--rb-lh-tight); letter-spacing: var(--rb-tracking-tight); color: var(--rb-text);
}
.rb-page-desc { margin-top: 6px !important; font-size: var(--rb-fs); color: var(--rb-text-muted); }
.rb-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.rb-card {
    min-width: 0;
    background: var(--rb-bg);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-lg);
    box-shadow: var(--rb-shadow-sm);
}
.rb-card__head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px;
    min-height: 60px; padding: 12px 20px;
    border-bottom: 1px solid var(--rb-border);
}
.rb-card__title {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--rb-fs-lg); font-weight: 700; letter-spacing: var(--rb-tracking-tight); color: var(--rb-text);
}
.rb-card__title .rb-icon { width: 20px; height: 20px; color: var(--rb-primary); }
.rb-card__sub { font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }
.rb-card__tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rb-card__body { padding: 20px; }
.rb-card__foot {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--rb-border);
    background: var(--rb-bg-subtle);
    border-radius: 0 0 var(--rb-radius-lg) var(--rb-radius-lg);
}
.rb-card__foot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.rb-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--rb-radius-pill);
    background: var(--rb-bg-muted); color: var(--rb-text-muted);
    font-size: var(--rb-fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.rb-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 44px 20px; text-align: center; color: var(--rb-text-muted); font-size: var(--rb-fs);
}
.rb-empty .rb-icon { width: 36px; height: 36px; color: var(--rb-text-subtle); }

/* ── 5. 버튼 · 배지 · 상태 ──────────────────────────── */
body.rb-console .rb-btn { text-decoration: none; }
.rb-btn .rb-icon { width: 18px; height: 18px; }
.rb-btn--sm { height: 36px; padding: 0 14px; gap: 6px; border-radius: 8px; font-size: var(--rb-fs); }
.rb-btn--sm .rb-icon { width: 16px; height: 16px; }
body.rb-console .rb-btn--primary, body.rb-console .rb-btn--primary:hover { color: #fff; }
body.rb-console .rb-btn--secondary { color: var(--rb-text); }
.rb-btn--outline { background: var(--rb-bg); color: var(--rb-text-secondary) !important; border-color: var(--rb-border-strong); }
.rb-btn--outline:hover { background: var(--rb-bg-muted); color: var(--rb-text) !important; }
.rb-btn--danger { background: var(--rb-danger); color: #fff !important; }
.rb-btn--danger:hover { background: #b91c1c; }
.rb-btn--danger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(220, 38, 38, .25); }
.rb-btn--danger-soft { background: var(--rb-bg); color: var(--rb-danger) !important; border-color: rgba(220, 38, 38, .35); }
.rb-btn--danger-soft:hover { background: var(--rb-danger-soft); }
.rb-btn:disabled, .rb-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.rb-icon-btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; flex: none;
    border: 1px solid var(--rb-border); border-radius: 8px;
    background: var(--rb-bg); color: var(--rb-text-secondary) !important;
    cursor: pointer; text-decoration: none !important;
    transition: background-color .12s, color .12s, border-color .12s;
}
.rb-icon-btn .rb-icon { width: 17px; height: 17px; }
.rb-icon-btn:hover { background: var(--rb-primary-softer); border-color: rgba(96, 16, 162, .3); color: var(--rb-primary) !important; }
.rb-icon-btn--danger:hover { background: var(--rb-danger-soft); border-color: rgba(220, 38, 38, .35); color: var(--rb-danger) !important; }

/* 툴팁: data-rb-tip="수정" */
[data-rb-tip] { position: relative; }
[data-rb-tip]::after {
    content: attr(data-rb-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 50;
    transform: translate(-50%, 4px);
    padding: 5px 9px; border-radius: 6px;
    background: #18181b; color: #fff;
    font-size: var(--rb-fs-xs); font-weight: 500; line-height: 1.3; white-space: nowrap; letter-spacing: 0;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .12s, transform .12s, visibility .12s;
}
[data-rb-tip]:hover::after, [data-rb-tip]:focus-visible::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.rb-actions [data-rb-tip]:last-child::after, [data-rb-tip-end]::after { left: auto; right: 0; transform: translate(0, 4px); }
.rb-actions [data-rb-tip]:last-child:hover::after, .rb-actions [data-rb-tip]:last-child:focus-visible::after,
[data-rb-tip-end]:hover::after, [data-rb-tip-end]:focus-visible::after { transform: translate(0, 0); }
@media (hover: none) { [data-rb-tip]::after { display: none; } }

.rb-badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: var(--rb-radius-pill);
    background: var(--rb-bg-muted); color: var(--rb-text-secondary);
    font-size: var(--rb-fs-xs); font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.rb-badge .rb-icon { width: 13px; height: 13px; }
.rb-badge--primary { background: var(--rb-primary-soft); color: var(--rb-primary); }
.rb-badge--success { background: var(--rb-success-soft); color: #15803d; }
.rb-badge--danger { background: var(--rb-danger-soft); color: var(--rb-danger); }
.rb-badge--warning { background: var(--rb-warning-soft); color: #b45309; }

/* 활성/비활성 상태 — 링크(editactive.php)면 클릭으로 전환 */
.rb-state {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px 0 9px; border-radius: var(--rb-radius-pill);
    border: 1px solid transparent;
    font-size: var(--rb-fs-sm); font-weight: 600; line-height: 1; white-space: nowrap;
    text-decoration: none !important;
    transition: box-shadow .12s, background-color .12s;
}
.rb-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.rb-state--on { background: var(--rb-success-soft); border-color: rgba(22, 163, 74, .22); color: #15803d !important; }
.rb-state--off { background: var(--rb-bg-muted); border-color: var(--rb-border); color: var(--rb-text-muted) !important; }
.rb-state--warn { background: var(--rb-warning-soft); border-color: rgba(217, 119, 6, .25); color: #b45309 !important; }
.rb-state--bad { background: var(--rb-danger-soft); border-color: rgba(220, 38, 38, .22); color: #b91c1c !important; }
a.rb-state { cursor: pointer; }
a.rb-state::after {
    content: ""; width: 12px; height: 12px; margin-left: 1px; opacity: 0; flex: none;
    background-color: currentColor;
    -webkit-mask: url(/rb-assets/icons/lucide/refresh-cw.svg) center / contain no-repeat;
    mask: url(/rb-assets/icons/lucide/refresh-cw.svg) center / contain no-repeat;
    transition: opacity .12s;
}
a.rb-state:hover::after, a.rb-state:focus-visible::after { opacity: .8; }
a.rb-state--on:hover { box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
a.rb-state--off:hover { box-shadow: 0 0 0 3px rgba(113, 113, 122, .15); }

/* 상태 표시점(PostfixAdmin show_status) — 인라인 배경색 span 을 작은 점으로 */
.rb-status { font-size: 0; line-height: 0; white-space: nowrap; }
.rb-status span[style] {
    display: inline-block; width: 8px; height: 8px; margin-right: 4px;
    border-radius: 50%; vertical-align: middle; box-shadow: 0 0 0 2px var(--rb-bg);
}
.rb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--rb-fs-xs); color: var(--rb-text-muted); }
.rb-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.rb-legend__item > span[style] { display: inline-block; width: 8px; height: 8px; border-radius: 50%; font-size: 0; }

/* 사용량 막대 (메일 용량·도메인 한도) */
.rb-usage { display: flex; flex-direction: column; gap: 5px; width: 100%; min-width: 150px; max-width: 240px; }
.rb-usage__bar { height: 6px; border-radius: var(--rb-radius-pill); background: var(--rb-bg-muted); overflow: hidden; }
.rb-usage__bar > span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--rb-primary); }
.rb-usage--mid .rb-usage__bar > span { background: var(--rb-warning); }
.rb-usage--high .rb-usage__bar > span { background: var(--rb-danger); }
.rb-usage__text {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: var(--rb-fs-xs); color: var(--rb-text-muted);
    font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.3;
}
.rb-usage__text b { color: var(--rb-text-secondary); font-weight: 600; }
.rb-usage--high .rb-usage__pct { color: var(--rb-danger); font-weight: 600; }
.rb-quota-plain { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--rb-text-secondary); }

/* ── 6. 표 ──────────────────────────────────────────── */
.rb-table-wrap { width: 100%; }
.rb-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: var(--rb-fs); font-variant-numeric: tabular-nums;
    overflow-wrap: normal;
}
.rb-table th {
    position: sticky; top: var(--rb-header-h); z-index: 3;   /* 스크롤 시 헤더 고정 */
    padding: 10px 14px; text-align: left; vertical-align: middle;
    background: var(--rb-bg-subtle); border-bottom: 1px solid var(--rb-border);
    color: var(--rb-text-muted); font-size: var(--rb-fs-sm); font-weight: 600; line-height: 1.4;
}
.rb-table td {
    padding: 12px 14px; vertical-align: middle;
    border-bottom: 1px solid var(--rb-border);
    color: var(--rb-text-secondary);
}
.rb-table th:first-child, .rb-table td:first-child { padding-left: 20px; }
.rb-table th:last-child, .rb-table td:last-child { padding-right: 20px; }
.rb-table tbody tr { transition: background-color .1s; }
.rb-table tbody tr:hover { background: var(--rb-primary-softer); }
.rb-table tbody tr:last-child td { border-bottom: 0; }
.rb-table a { font-weight: 600; }
.rb-cell-main { color: var(--rb-text) !important; font-weight: 600; }
.rb-cell-nowrap { white-space: nowrap; }
.rb-cell-email { white-space: nowrap; }
.rb-cell-muted { color: var(--rb-text-muted) !important; }
.rb-cell-date { white-space: nowrap; color: var(--rb-text-muted) !important; font-size: var(--rb-fs-sm); }
.rb-cell-status { width: 1%; white-space: nowrap; }
.rb-cell-dot { width: 1%; padding-right: 0 !important; }
.rb-cell-actions { width: 1%; white-space: nowrap; text-align: right; }
.rb-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.rb-actions form { display: inline-flex; margin: 0; }
.rb-lines { display: flex; flex-direction: column; gap: 2px; }
.rb-lines > span { white-space: nowrap; }
.rb-searchhit, .searchresult { background: #fef08a; color: var(--rb-text); border-radius: 3px; padding: 0 1px; }

/* 페이지 이동(list-virtual 의 cNav_bar 가 PHP 에서 만든 HTML) */
.rb-pager-slot .nav_bar { padding: 8px 20px; border-bottom: 1px solid var(--rb-border); }
.rb-card__foot .rb-pager-slot .nav_bar { padding: 0; border: 0; }
.rb-pager-slot .nav_bar table { width: 100% !important; border-collapse: collapse; }
.rb-pager-slot .nav_bar col { width: auto !important; }
.rb-pager-slot .nav_bar td { padding: 0; vertical-align: middle; font-size: var(--rb-fs-sm); }
.rb-pager-slot .nav_bar td:first-child > b:first-child { display: none; }   /* 표 제목 중복 숨김 */
.rb-pager-slot .nav_bar td:first-child > a, .rb-pager-slot .nav_bar td:first-child > b {
    display: inline-flex; align-items: center; height: 28px; padding: 0 10px; margin: 2px 2px 2px 0;
    border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none;
}
.rb-pager-slot .nav_bar td:first-child > a { color: var(--rb-text-secondary) !important; border: 1px solid var(--rb-border); }
.rb-pager-slot .nav_bar td:first-child > a:hover { background: var(--rb-bg-muted); }
.rb-pager-slot .nav_bar td:first-child > b:not(:first-child) { background: var(--rb-primary); color: #fff; border: 1px solid var(--rb-primary); }
.rb-pager-slot .nav_bar td:last-child { text-align: right; white-space: nowrap; }
.rb-pager-slot .nav_bar td:last-child a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-left: 4px; border-radius: 8px;
    border: 1px solid var(--rb-border); background: var(--rb-bg); color: var(--rb-text-secondary) !important;
}
.rb-pager-slot .nav_bar td:last-child a:hover { background: var(--rb-bg-muted); }
.rb-pager-slot .nav_bar td:last-child a .rb-icon { width: 16px; height: 16px; }
.rb-pager-slot .nav_bar img { width: 12px; height: 12px; }

/* 일반 페이지 버튼 (로그 보기) */
.rb-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rb-pager a, .rb-pager span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--rb-border); background: var(--rb-bg);
    color: var(--rb-text-secondary) !important; font-size: var(--rb-fs-sm); font-weight: 600;
    font-variant-numeric: tabular-nums; text-decoration: none !important;
}
.rb-pager a:hover { background: var(--rb-bg-muted); }
.rb-pager .is-current { background: var(--rb-primary); border-color: var(--rb-primary); color: #fff !important; }
.rb-pager .is-gap { border-color: transparent; background: none; min-width: 20px; padding: 0; color: var(--rb-text-subtle) !important; }
.rb-pager .rb-icon { width: 16px; height: 16px; }

/* ── 7. 폼 ──────────────────────────────────────────── */
.rb-control {
    display: block; width: 100%; height: 42px; padding: 0 12px;
    border: 1px solid var(--rb-border-strong); border-radius: var(--rb-radius);
    background: var(--rb-bg); color: var(--rb-text);
    font-size: var(--rb-fs-md); line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.rb-control::placeholder { color: var(--rb-text-subtle); }
.rb-control:hover { border-color: #b8b8c0; }
.rb-control:focus { border-color: var(--rb-primary); box-shadow: 0 0 0 3px var(--rb-primary-ring); }
textarea.rb-control { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.rb-control[multiple] { height: auto; min-height: 140px; padding: 6px; }
select.rb-control[multiple] option { padding: 6px 8px; border-radius: 6px; }
.rb-select { position: relative; display: block; min-width: 0; }
.rb-select select.rb-control { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer; text-overflow: ellipsis; }
.rb-select::after {
    content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
    background-color: var(--rb-text-muted); pointer-events: none;
    -webkit-mask: url(/rb-assets/icons/lucide/chevron-down.svg) center / contain no-repeat;
    mask: url(/rb-assets/icons/lucide/chevron-down.svg) center / contain no-repeat;
}
.rb-input-icon { position: relative; display: block; min-width: 0; }
.rb-input-icon > .rb-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--rb-text-muted); pointer-events: none;
}
.rb-input-icon > .rb-control, .rb-input-icon > select.rb-control { padding-left: 38px; }
.rb-input-icon:focus-within > .rb-icon { color: var(--rb-primary); }

.rb-form { margin: 0; }
.rb-fields { display: flex; flex-direction: column; }
.rb-field-row {
    display: grid;
    grid-template-columns: 200px minmax(0, 560px) minmax(0, 1fr);
    align-items: start; gap: 6px 28px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--rb-border);
}
.rb-field-row:last-child { border-bottom: 0; }
.rb-field-row__label { padding-top: 10px; font-size: var(--rb-fs); font-weight: 600; color: var(--rb-text); line-height: 1.45; }
.rb-field-row__label .rb-req { color: var(--rb-danger); margin-left: 2px; }
.rb-field-row__control { min-width: 0; }
.rb-field-row__help { padding-top: 11px; font-size: var(--rb-fs-sm); color: var(--rb-text-muted); line-height: 1.55; }
.rb-field-row__help:empty { display: none; }
.rb-field-row.is-error .rb-control { border-color: var(--rb-danger); }
.rb-field-row.is-error .rb-control:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.rb-field-row.is-error .rb-field-row__help { color: var(--rb-danger); font-weight: 500; }
.rb-static { padding-top: 10px; font-size: var(--rb-fs-md); font-weight: 500; color: var(--rb-text); overflow-wrap: anywhere; }
.rb-form-note {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 0; padding: 14px 24px; border-bottom: 1px solid var(--rb-border);
    background: var(--rb-primary-softer); color: var(--rb-text-secondary); font-size: var(--rb-fs);
    border-radius: calc(var(--rb-radius-lg) - 1px) calc(var(--rb-radius-lg) - 1px) 0 0;
}
.rb-form-note .rb-icon { width: 18px; height: 18px; color: var(--rb-primary); margin-top: 2px; }
.rb-form-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--rb-border);
    background: rgba(250, 250, 250, .96);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-radius: 0 0 var(--rb-radius-lg) var(--rb-radius-lg);
}
.rb-form-actions__start { margin-right: auto; }

/* 아이디 @ 도메인 (메일계정·별칭 생성) */
.rb-addr { display: flex; align-items: center; gap: 8px; }
.rb-addr > .rb-control { flex: 1 1 55%; min-width: 0; }
.rb-addr > .rb-select { flex: 1 1 45%; min-width: 0; }
.rb-addr__at { flex: none; font-size: var(--rb-fs-lg); font-weight: 600; color: var(--rb-text-muted); }
.rb-addr.is-error .rb-select .rb-control { border-color: var(--rb-danger); }
select.rb-control[multiple] option:checked { background: var(--rb-primary-soft) linear-gradient(0deg, var(--rb-primary-soft), var(--rb-primary-soft)); color: var(--rb-primary); }

/* 토글 스위치 (bool 필드) */
.rb-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; cursor: pointer; user-select: none; }
body.rb-console .rb-switch input {
    -webkit-appearance: none; appearance: none;
    position: relative; width: 42px; height: 24px; margin: 0; flex: none;
    border-radius: var(--rb-radius-pill); background: var(--rb-border-strong);
    cursor: pointer; transition: background-color .15s;
}
.rb-switch input::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(24, 24, 27, .25);
    transition: transform .15s;
}
body.rb-console .rb-switch input:checked { background: var(--rb-primary); }
.rb-switch input:checked::after { transform: translateX(18px); }
.rb-switch input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--rb-primary-ring); }
.rb-switch__on, .rb-switch__off { font-size: var(--rb-fs); color: var(--rb-text-secondary); }
.rb-switch input:checked ~ .rb-switch__off, .rb-switch input:not(:checked) ~ .rb-switch__on { display: none; }

.rb-choice { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: var(--rb-fs-md); color: var(--rb-text); }
.rb-choice-group { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }

/* 도메인 체크 목록 (관리자 폼의 list 필드) */
.rb-checklist { border: 1px solid var(--rb-border-strong); border-radius: var(--rb-radius); background: var(--rb-bg); overflow: hidden; }
.rb-checklist__search { position: relative; border-bottom: 1px solid var(--rb-border); }
.rb-checklist__search .rb-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--rb-text-muted); }
.rb-checklist__search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 0; outline: none; background: var(--rb-bg-subtle); font-size: var(--rb-fs); }
.rb-checklist ul { list-style: none; margin: 0; padding: 6px; max-height: 260px; overflow: auto; }
.rb-checklist li label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--rb-fs); color: var(--rb-text); }
.rb-checklist li label:hover { background: var(--rb-bg-muted); }
.rb-checklist__empty { padding: 12px 16px; font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }

/* ── 8. 알림 · 대화상자 ─────────────────────────────── */
.rb-alerts { display: flex; flex-direction: column; gap: 10px; }
.rb-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 14px 13px 16px; border: 1px solid; border-radius: var(--rb-radius);
    font-size: var(--rb-fs); line-height: 1.55;
}
.rb-alert > .rb-icon { width: 20px; height: 20px; margin-top: 1px; }
.rb-alert__body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rb-alert__body ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.rb-alert--success { background: var(--rb-success-soft); border-color: rgba(22, 163, 74, .25); color: #166534; }
.rb-alert--error { background: var(--rb-danger-soft); border-color: rgba(220, 38, 38, .25); color: #b91c1c; }
.rb-alert--info { background: var(--rb-primary-softer); border-color: var(--rb-primary-soft); color: var(--rb-primary); }
.rb-alert--warning { background: var(--rb-warning-soft); border-color: rgba(217, 119, 6, .25); color: #92400e; }
.rb-alert__close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin: -2px -4px -2px 0; padding: 0; flex: none;
    border: 0; border-radius: 6px; background: none; color: inherit; opacity: .6; cursor: pointer;
}
.rb-alert__close:hover { opacity: 1; background: rgba(0, 0, 0, .05); }
.rb-alert__close .rb-icon { width: 16px; height: 16px; }

.rb-dialog {
    width: min(440px, calc(100vw - 32px)); padding: 0; border: 0;
    border-radius: var(--rb-radius-lg); background: var(--rb-bg); color: var(--rb-text);
    box-shadow: 0 24px 60px -12px rgba(24, 24, 27, .35);
    font-family: var(--rb-font); letter-spacing: var(--rb-tracking); word-break: keep-all;
}
.rb-dialog::backdrop { background: rgba(24, 24, 27, .45); }
.rb-dialog__body { display: flex; gap: 16px; padding: 24px 24px 6px; }
.rb-dialog__icon {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none; border-radius: 50%;
    background: var(--rb-danger-soft); color: var(--rb-danger);
}
.rb-dialog__icon .rb-icon { width: 20px; height: 20px; }
.rb-dialog__title { margin: 0; font-size: var(--rb-fs-lg); font-weight: 700; line-height: 1.4; }
.rb-dialog__msg { margin: 6px 0 0; font-size: var(--rb-fs); color: var(--rb-text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.rb-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 24px 22px; }

/* ── 9. 페이지별 ────────────────────────────────────── */
/* 대시보드 */
.rb-search-hero { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; }
.rb-search-hero__title { font-size: var(--rb-fs-lg); font-weight: 700; }
.rb-search-hero__form { display: flex; gap: 8px; margin: 0; }
.rb-search-hero__form .rb-input-icon { flex: 1; }
.rb-search-hero__form .rb-control { height: 46px; }
.rb-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.rb-results__group { display: flex; flex-direction: column; gap: 4px; }
.rb-results__heading { display: flex; align-items: center; gap: 6px; margin-bottom: 4px !important; font-size: var(--rb-fs-sm); font-weight: 600; color: var(--rb-text-muted); }
.rb-results__heading .rb-icon { width: 15px; height: 15px; }
.rb-results__item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
    color: var(--rb-text) !important; font-weight: 500; text-decoration: none !important; overflow-wrap: anywhere;
}
.rb-results__item:hover { background: var(--rb-primary-softer); color: var(--rb-primary) !important; }
.rb-results__item .rb-icon { width: 14px; height: 14px; margin-left: auto; color: var(--rb-text-subtle); }
.rb-section-title { font-size: var(--rb-fs-md); font-weight: 700; color: var(--rb-text); margin: 4px 0 -6px !important; }
.rb-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rb-quick {
    display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px;
    background: var(--rb-bg); border: 1px solid var(--rb-border); border-radius: var(--rb-radius-lg);
    box-shadow: var(--rb-shadow-sm);
    color: var(--rb-text) !important; text-decoration: none !important;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rb-quick:hover { border-color: rgba(96, 16, 162, .35); box-shadow: var(--rb-shadow); transform: translateY(-1px); }
.rb-quick__icon {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none; border-radius: 12px;
    background: var(--rb-primary-soft); color: var(--rb-primary);
}
.rb-quick__icon .rb-icon { width: 22px; height: 22px; }
.rb-quick__text { min-width: 0; flex: 1; }
.rb-quick__title { display: block; font-size: var(--rb-fs-md); font-weight: 700; color: var(--rb-text); }
.rb-quick__desc { display: block; margin-top: 3px; font-size: var(--rb-fs-sm); line-height: 1.5; color: var(--rb-text-muted); }
.rb-quick__go { width: 16px; height: 16px; margin-top: 2px; color: var(--rb-text-subtle); transition: transform .15s, color .15s; }
.rb-quick:hover .rb-quick__go { color: var(--rb-primary); transform: translateX(2px); }
.rb-quick--danger .rb-quick__icon { background: var(--rb-danger-soft); color: var(--rb-danger); }

/* 메일계정 목록: 도메인 선택 · 검색 · 탭 */
.rb-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 16px 20px; }
.rb-toolbar form { margin: 0; }
.rb-toolbar__domain { flex: 0 1 320px; min-width: 200px; }
.rb-toolbar__search { flex: 0 1 340px; min-width: 200px; }
.rb-toolbar .rb-control { height: 40px; font-size: var(--rb-fs); }
.rb-toolbar__spacer { flex: 1; }
.rb-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-stat {
    display: inline-flex; align-items: baseline; gap: 6px;
    height: 32px; padding: 0 12px; align-items: center;
    border: 1px solid var(--rb-border); border-radius: var(--rb-radius-pill);
    background: var(--rb-bg-subtle); font-size: var(--rb-fs-sm); color: var(--rb-text-muted); white-space: nowrap;
}
.rb-stat b { color: var(--rb-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.rb-search-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; font-size: var(--rb-fs); color: var(--rb-text-secondary); }
.rb-search-note b { color: var(--rb-text); }
.rb-tabs {
    display: flex; gap: 4px; padding: 0 12px;
    border-top: 1px solid var(--rb-border);
    overflow-x: auto; scrollbar-width: none;
}
.rb-tabs::-webkit-scrollbar { display: none; }
.rb-tab {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    padding: 13px 10px 11px; margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--rb-text-muted) !important; font-size: var(--rb-fs); font-weight: 600;
    white-space: nowrap; text-decoration: none !important;
}
.rb-tab .rb-icon { width: 16px; height: 16px; }
.rb-tab:hover { color: var(--rb-text) !important; }
.rb-tab.is-active { color: var(--rb-primary) !important; border-bottom-color: var(--rb-primary); }

/* 로그 보기 */
.rb-log-data {
    display: block; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--rb-font-mono); font-size: var(--rb-fs-sm); letter-spacing: 0; color: var(--rb-text-secondary);
}
.rb-log-row { cursor: pointer; }
.rb-log-row.is-open .rb-log-data { max-width: none; white-space: pre-wrap; overflow-wrap: anywhere; }

/* DNS 설정 (dns.php) */
.rb-dns-domain { display: flex; flex-direction: column; min-width: 0; }
.rb-dns-domain__desc, .rb-dns-what__desc {
    display: block; margin-top: 2px; font-size: var(--rb-fs-sm); font-weight: 400; line-height: 1.5; color: var(--rb-text-muted);
}
.rb-dns-frac { color: var(--rb-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-dns-frac b { color: #15803d; font-weight: 700; }
.rb-dns-frac.is-short b { color: #b45309; }
.rb-dns-link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rb-dns-link .rb-icon { width: 14px; height: 14px; }
.rb-dns-when { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1.35; }
.rb-dns-when > span:first-child { color: var(--rb-text-secondary); font-weight: 600; }
.rb-dns-when__abs { font-size: var(--rb-fs-xs); color: var(--rb-text-subtle); }
.rb-dns-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; overflow-wrap: anywhere; }
.rb-dns-title .rb-state { font-size: var(--rb-fs-sm); letter-spacing: var(--rb-tracking); }
.rb-dns-dot { margin: 0 6px; color: var(--rb-text-subtle); }
.rb-page-desc b { color: var(--rb-text-secondary); font-weight: 600; }
.rb-dns-recheck { display: flex; margin: 0; }
.rb-dns-pending { align-items: center; }
.rb-dns-pending .rb-btn { flex: none; }
.rb-dns-empty b { color: var(--rb-text); font-size: var(--rb-fs-md); }
.rb-dns-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* 요약 타일 */
.rb-dns-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rb-dns-stat { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px 20px; border-left: 1px solid var(--rb-border); }
.rb-dns-stat:first-child { border-left: 0; }
.rb-dns-stat__icon {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--rb-bg-muted); color: var(--rb-text-muted);
}
.rb-dns-stat__icon .rb-icon { width: 21px; height: 21px; }
.rb-dns-stat--ok .rb-dns-stat__icon { background: var(--rb-success-soft); color: var(--rb-success); }
.rb-dns-stat--warn .rb-dns-stat__icon { background: var(--rb-warning-soft); color: var(--rb-warning); }
.rb-dns-stat--bad .rb-dns-stat__icon { background: var(--rb-danger-soft); color: var(--rb-danger); }
.rb-dns-stat__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.rb-dns-stat__label { font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }
.rb-dns-stat__value { margin-top: 2px; font-size: var(--rb-fs-lg); font-weight: 700; color: var(--rb-text); font-variant-numeric: tabular-nums; }
.rb-dns-stat__value small { font-size: var(--rb-fs-sm); font-weight: 500; color: var(--rb-text-muted); }
.rb-dns-ns { justify-content: flex-start; gap: 8px 20px; font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }
.rb-dns-ns__item { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.rb-dns-ns__item .rb-icon { width: 15px; height: 15px; color: var(--rb-text-subtle); }
.rb-dns-ns__item b { color: var(--rb-text-secondary); }
.rb-dns-ns code, .rb-dns-help code, .rb-dns-text code:not(.rb-dns-code) {
    padding: 1px 6px; border-radius: 5px; background: var(--rb-bg-muted);
    font-family: var(--rb-font-mono); font-size: .92em; letter-spacing: 0; color: var(--rb-text-secondary); overflow-wrap: anywhere;
}

/* 등록 방법 (접기/펼치기) */
.rb-dns-help > summary { list-style: none; cursor: pointer; border-bottom-color: transparent; }
.rb-dns-help > summary::-webkit-details-marker { display: none; }
.rb-dns-help[open] > summary { border-bottom-color: var(--rb-border); }
.rb-dns-help > summary:hover .rb-dns-help__toggle { color: var(--rb-primary); }
body.rb-console .rb-dns-help > summary:focus-visible { outline-offset: -2px; border-radius: var(--rb-radius-lg); }
.rb-dns-help__toggle { display: inline-flex; align-items: center; gap: 4px; font-size: var(--rb-fs-sm); font-weight: 600; color: var(--rb-text-muted); }
.rb-dns-help__toggle .rb-icon { width: 16px; height: 16px; transition: transform .15s; }
.rb-dns-help[open] .rb-dns-help__toggle .rb-icon { transform: rotate(180deg); }
.rb-dns-help__close, .rb-dns-help[open] .rb-dns-help__open { display: none; }
.rb-dns-help[open] .rb-dns-help__close { display: inline; }
.rb-dns-steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: rb-step; }
.rb-dns-steps > li { position: relative; padding-left: 38px; counter-increment: rb-step; color: var(--rb-text-secondary); line-height: 1.7; }
.rb-dns-steps > li::before {
    content: counter(rb-step); position: absolute; left: 0; top: 1px;
    display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--rb-primary-soft); color: var(--rb-primary); font-size: var(--rb-fs-sm); font-weight: 700;
}
.rb-dns-steps b, .rb-dns-tips b { color: var(--rb-text); font-weight: 600; }
.rb-dns-example {
    display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding: 12px 14px;
    border: 1px dashed var(--rb-border-strong); border-radius: var(--rb-radius); background: var(--rb-bg-subtle);
}
.rb-dns-example__row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: var(--rb-fs-sm); }
.rb-dns-example__row .rb-icon { width: 15px; height: 15px; color: var(--rb-primary); }
.rb-dns-example__k { color: var(--rb-text-muted); }
.rb-dns-tips {
    display: flex; flex-direction: column; gap: 8px; margin: 18px 0 0; padding: 14px 16px 14px 18px; list-style: none;
    border: 1px solid var(--rb-border); border-radius: var(--rb-radius); background: var(--rb-bg-subtle);
    font-size: var(--rb-fs-sm); line-height: 1.65; color: var(--rb-text-secondary);
}
.rb-dns-tips > li { position: relative; padding-left: 14px; }
.rb-dns-tips > li::before { content: ""; position: absolute; left: 0; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--rb-text-subtle); }
.rb-dns-tips > li.rb-dns-tips__warn { color: #92400e; }
.rb-dns-tips > li.rb-dns-tips__warn::before { background: var(--rb-warning); }
.rb-dns-tips > li.rb-dns-tips__warn b { color: #92400e; }

/* 레코드 표 */
.rb-dns-table { table-layout: fixed; }
.rb-dns-table .rb-dns-col-what { width: 19%; }
.rb-dns-table .rb-dns-col-status { width: 136px; }
.rb-dns-table .rb-dns-col-type { width: 72px; }
.rb-dns-table .rb-dns-col-host { width: 27%; }
.rb-dns-table td { vertical-align: top; }
.rb-dns-table td.rb-cell-status { white-space: normal; }
.rb-dns-table td.rb-cell-status .rb-state { white-space: normal; height: auto; min-height: 26px; padding-top: 4px; padding-bottom: 4px; line-height: 1.3; }
.rb-dns-table tbody tr:hover { background: none; }
.rb-dns-what__title { display: block; font-weight: 600; color: var(--rb-text); overflow-wrap: anywhere; }
.rb-dns-type__badge {
    display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px;
    background: var(--rb-bg-muted); border: 1px solid var(--rb-border);
    font-family: var(--rb-font-mono); font-size: var(--rb-fs-xs); font-weight: 700; letter-spacing: 0; color: var(--rb-text-secondary);
}
.rb-dns-names { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.rb-dns-names > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rb-dns-names dt { font-size: var(--rb-fs-xs); color: var(--rb-text-muted); }
.rb-dns-names dd { display: flex; align-items: flex-start; gap: 6px; min-width: 0; margin: 0; }
.rb-dns-code {
    display: inline-block; min-width: 0; max-width: 100%; padding: 3px 8px;
    border: 1px solid var(--rb-border); border-radius: 6px; background: var(--rb-bg-subtle);
    font-family: var(--rb-font-mono); font-size: 13px; line-height: 1.55; letter-spacing: 0; color: var(--rb-text);
    word-break: normal; overflow-wrap: anywhere; white-space: pre-wrap;
}
.rb-dns-code--soft { padding: 0; border: 0; background: none; font-size: 12px; color: var(--rb-text-muted); margin-top: 5px; }
.rb-dns-copyline { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.rb-dns-val { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 0 1 auto; min-width: 0; }
.rb-js .rb-dns-val--long:not(.is-open) .rb-dns-code {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.rb-dns-more { display: none; padding: 0; border: 0; background: none; cursor: pointer; color: var(--rb-primary); font-size: var(--rb-fs-sm); font-weight: 600; }
.rb-dns-more:hover { text-decoration: underline; }
.rb-js .rb-dns-more { display: inline-flex; }
.rb-dns-sub { margin-top: 6px; font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }
.rb-dns-sub b { color: var(--rb-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.rb-dns-current {
    display: flex; flex-direction: column; gap: 5px; margin-top: 10px; padding: 10px 12px;
    border: 1px solid rgba(217, 119, 6, .28); border-radius: 8px; background: var(--rb-warning-soft);
    font-size: var(--rb-fs-sm); color: #92400e;
}
.rb-dns-current__label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rb-dns-current__label .rb-icon { width: 15px; height: 15px; }
.rb-dns-current code {
    display: block; max-height: 7.8em; overflow: auto; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .7);
    font-family: var(--rb-font-mono); font-size: 12px; line-height: 1.55; letter-spacing: 0; color: var(--rb-text-secondary);
    word-break: break-all; white-space: pre-wrap;
}
.rb-dns-current__hint { line-height: 1.55; }

/* 복사 버튼 — 스크립트가 있을 때만 보임 (html.rb-js) */
.rb-copy { display: none !important; }
.rb-js .rb-copy { display: inline-flex !important; }
.rb-icon-btn--xs { width: 28px; height: 28px; border-radius: 7px; margin-top: 1px; }
.rb-icon-btn--xs .rb-icon { width: 14px; height: 14px; }
.rb-copy.is-copied { background: var(--rb-success-soft) !important; border-color: rgba(22, 163, 74, .35) !important; color: #15803d !important; }
.rb-copy.is-copied .rb-icon { --rb-icon: url(/rb-assets/icons/lucide/check.svg); }

/* 병원 전용 웹메일 · 메일 앱 설정 */
.rb-dns-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1361px) { .rb-dns-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.rb-dns-text { display: flex; flex-direction: column; gap: 12px; color: var(--rb-text-secondary); }
.rb-dns-text b { color: var(--rb-text); }
.rb-dns-url {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px;
    border: 1px solid rgba(22, 163, 74, .25); border-radius: var(--rb-radius); background: var(--rb-success-soft);
}
.rb-dns-url a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--rb-fs-md); font-weight: 700; overflow-wrap: anywhere; }
.rb-dns-url a .rb-icon { width: 16px; height: 16px; flex: none; }
.rb-dns-error { display: block; margin-top: 8px; font-size: var(--rb-fs-xs); font-family: var(--rb-font-mono); letter-spacing: 0; overflow-wrap: anywhere; opacity: .85; }
.rb-dns-note { font-size: var(--rb-fs-sm); color: var(--rb-text-muted); }
.rb-dns-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px 18px; margin: 0; padding: 16px 20px; border-top: 1px solid var(--rb-border); font-size: var(--rb-fs); }
.rb-dns-kv dt { color: var(--rb-text-muted); }
.rb-dns-kv dd { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; color: var(--rb-text); }
.rb-dns-kv--box { padding: 14px 16px; border: 1px solid var(--rb-border); border-radius: var(--rb-radius); background: var(--rb-bg-subtle); }
.rb-dns-client__intro { padding: 16px 20px 14px; font-size: var(--rb-fs-sm); line-height: 1.6; color: var(--rb-text-muted); }
.rb-dns-client__table { border-top: 1px solid var(--rb-border); }
.rb-dns-client__table td { color: var(--rb-text); }
.rb-dns-client__table td.rb-cell-title, .rb-dns-client__table td:nth-child(3), .rb-dns-client__table td:nth-child(4) { white-space: nowrap; }
.rb-dns-client__table .rb-dns-code { white-space: nowrap; overflow-wrap: normal; }
@media (min-width: 641px) { .rb-dns-client__table tbody tr:last-child td { border-bottom: 1px solid var(--rb-border); } }
.rb-dns-client .rb-dns-kv { border-top: 0; }
.rb-quick__title [data-rb-dns-summary] { margin-left: 4px; vertical-align: 1px; }
[data-rb-dns-summary][hidden] { display: none; }

/* ── 10. 반응형 ─────────────────────────────────────── */
/* 좁은 데스크톱·태블릿: 표는 카드 안에서 가로 스크롤 (고정 헤더 해제) */
@media (max-width: 1180px) {
    .rb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .rb-table th { position: static; }
    .rb-field-row { grid-template-columns: 180px minmax(0, 1fr); }
    .rb-field-row__help { grid-column: 2; padding-top: 0; }
    .rb-dns-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rb-dns-stat:nth-child(odd) { border-left: 0; }
    .rb-dns-stat:nth-child(n+3) { border-top: 1px solid var(--rb-border); }
}
@media (max-width: 1180px) and (min-width: 641px) {
    .rb-table { min-width: 720px; }
    .rb-dns-client__table { min-width: 0; }
    /* DNS 레코드 표: 가로 스크롤 대신 레코드마다 2줄 카드 (위: 이름·유형·상태, 아래: 호스트·값) */
    .rb-table.rb-dns-table { min-width: 0; }
    .rb-dns-table thead { display: none; }
    .rb-dns-table, .rb-dns-table tbody { display: block; width: 100%; }
    .rb-dns-table tr {
        display: grid; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--rb-border);
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 64px 128px;
        grid-template-areas: "what what type status" "names value value value";
    }
    .rb-dns-table tbody tr:last-child { border-bottom: 0; }
    .rb-dns-table td, .rb-dns-table td:first-child, .rb-dns-table td:last-child { display: block; padding: 0; border: 0; min-width: 0; }
    .rb-dns-table td.rb-dns-what { grid-area: what; }
    .rb-dns-table td.rb-dns-type { grid-area: type; justify-self: end; }
    .rb-dns-table td.rb-cell-status { grid-area: status; width: auto; justify-self: end; }
    .rb-dns-table td.rb-dns-names-cell { grid-area: names; }
    .rb-dns-table td.rb-dns-value-cell { grid-area: value; }
    .rb-dns-table td.rb-dns-value-cell::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: var(--rb-fs-xs); color: var(--rb-text-muted); }
}

/* 900px 이하: 사이드바 → 햄버거로 여는 서랍 */
@media (max-width: 900px) {
    .rb-topbar { gap: 8px; padding: 0 8px 0 8px; }
    .rb-topbar__menu { display: inline-flex; }
    .rb-brand { width: auto; min-width: 0; }
    .rb-topbar__search { display: none; }
    .rb-user { margin-left: 4px; padding-left: 8px; }
    .rb-user__meta, .rb-topbar__label { display: none; }
    .rb-topbar__link { padding: 0 9px; }
    .rb-sidebar {
        top: 0; z-index: 60; width: min(300px, 86vw);
        transform: translateX(-102%); visibility: hidden;
        transition: transform .22s ease, visibility 0s linear .22s;
        box-shadow: var(--rb-shadow-lg);
    }
    body.rb-drawer-open .rb-sidebar { transform: none; visibility: visible; transition: transform .22s ease; }
    .rb-sidebar__head {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        height: var(--rb-header-h); padding: 0 8px 0 18px; flex: none;
        border-bottom: 1px solid var(--rb-border);
    }
    .rb-sidebar__head .rb-brand { width: auto; }
    .rb-nav__group--drawer { display: flex !important; padding-top: 12px; border-top: 1px solid var(--rb-border); }
    .rb-scrim {
        display: block; position: fixed; inset: 0; z-index: 55;
        background: rgba(24, 24, 27, .42);
        opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s;
    }
    body.rb-drawer-open .rb-scrim { opacity: 1; visibility: visible; transition: opacity .2s; }
    body.rb-drawer-open { overflow: hidden; }
    .rb-main { margin-left: 0; }
    .rb-content { padding: 20px 16px 32px; gap: 16px; }
    .rb-footer { padding: 0 16px 20px; }
    .rb-page-title { font-size: var(--rb-fs-xl); }
}

/* 640px 이하(휴대폰): 표를 행 단위 카드로 쌓아 보여줌 (data-label 사용) */
@media (max-width: 640px) {
    .rb-table-wrap { overflow: visible; }
    .rb-table--stack, .rb-table--stack tbody, .rb-table--stack tr, .rb-table--stack td { display: block; width: 100%; }
    .rb-table--stack thead { display: none; }
    .rb-table--stack tr { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--rb-border); }
    .rb-table--stack tbody tr:last-child { border-bottom: 0; }
    .rb-table--stack td, .rb-table--stack td:first-child, .rb-table--stack td:last-child {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 5px 0; border: 0; text-align: right; min-height: 30px;
    }
    .rb-table--stack td::before {
        content: attr(data-label); flex: none; max-width: 45%;
        color: var(--rb-text-muted); font-size: var(--rb-fs-sm); font-weight: 500; text-align: left;
    }
    .rb-table--stack td:not([data-label])::before, .rb-table--stack td[data-label=""]::before { display: none; }
    .rb-table--stack td > * { min-width: 0; }
    .rb-table--stack .rb-cell-email, .rb-table--stack .rb-cell-nowrap { white-space: normal; overflow-wrap: anywhere; }
    .rb-table--stack td.rb-cell-title {
        justify-content: flex-start; gap: 8px; padding: 0 0 6px; text-align: left;
        font-size: var(--rb-fs-md); color: var(--rb-text);
    }
    .rb-table--stack td.rb-cell-title::before { display: none; }
    .rb-table--stack td.rb-cell-dot { position: absolute; top: 20px; right: 16px; width: auto; padding: 0 !important; min-height: 0; }
    .rb-table--stack td.rb-cell-actions { justify-content: flex-end; padding-top: 10px; width: 100%; }
    .rb-table--stack td.rb-cell-actions:empty { display: none; }
    .rb-table--stack .rb-lines { align-items: flex-end; }
    .rb-table--stack .rb-lines > span { white-space: normal; overflow-wrap: anywhere; }
    .rb-table--stack .rb-usage { max-width: 60%; min-width: 0; }
    .rb-table--stack .rb-log-data { max-width: 100%; }
    .rb-card__head { padding: 12px 16px; }
    .rb-card__foot { padding: 12px 16px; }
    .rb-toolbar { padding: 14px 16px; }
    .rb-toolbar__domain, .rb-toolbar__search { flex: 1 1 100%; min-width: 0; }
    .rb-toolbar__spacer { display: none; }
    .rb-search-note { padding: 0 16px 12px; }
    .rb-pager-slot .nav_bar { padding: 8px 16px; }
    .rb-field-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px; }
    .rb-field-row__label { padding-top: 0; }
    .rb-field-row__help { grid-column: 1; }
    .rb-static { padding-top: 0; }
    .rb-addr { flex-wrap: wrap; }
    .rb-addr > .rb-control { flex-basis: 100%; }
    .rb-addr > .rb-select { flex: 1 1 0; }
    .rb-form-actions { padding: 12px 16px; }
    .rb-form-actions .rb-btn { flex: 1; }
    .rb-form-actions__start { flex-basis: 100%; }
    .rb-page-actions { width: 100%; }
    .rb-page-actions .rb-btn { flex: 1; }
    .rb-search-hero { padding: 18px 16px; }
    .rb-quick-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .rb-quick { padding: 16px; }
    .rb-dns-stat { gap: 10px; padding: 14px 16px; }
    .rb-dns-stat__icon { width: 36px; height: 36px; border-radius: 10px; }
    .rb-dns-stat__icon .rb-icon { width: 18px; height: 18px; }
    .rb-dns-stat__value { font-size: var(--rb-fs-md); }
    .rb-dns-recheck { flex: 1; }
    .rb-dns-recheck .rb-btn { width: 100%; }
    .rb-dns-pending { flex-wrap: wrap; }
    .rb-dns-pending .rb-btn { margin-left: 32px; }
    .rb-dns-table { table-layout: auto; }
    .rb-table--stack.rb-dns-table td.rb-dns-cell-block { display: block; text-align: left; }
    .rb-table--stack.rb-dns-table td.rb-dns-cell-block::before { display: block; max-width: none; margin-bottom: 6px; }
    .rb-table--stack.rb-dns-table td.rb-dns-what { flex-direction: column; align-items: flex-start; gap: 2px; padding-right: 0; }
    .rb-dns-table td.rb-cell-status .rb-state { white-space: normal; height: auto; min-height: 26px; padding-top: 4px; padding-bottom: 4px; text-align: left; }
    .rb-dns-table .rb-dns-names dd, .rb-dns-table .rb-dns-copyline { justify-content: flex-start; }
    .rb-dns-client__table td .rb-dns-copyline { justify-content: flex-end; }
    .rb-dns-client__intro { padding: 14px 16px 12px; }
    .rb-dns-kv { padding: 14px 16px; gap: 8px 14px; }
    .rb-dns-help .rb-card__body { padding: 16px; }
    .rb-dns-steps > li { padding-left: 34px; }
    .rb-dns-list .rb-dns-when { align-items: flex-end; }
    .rb-dns-list .rb-dns-link { white-space: normal; overflow-wrap: anywhere; text-align: right; }
    .rb-table--stack.rb-dns-table td.rb-dns-names-cell::before { display: none; }
    .rb-brand__tag { display: none; }
}
@media (max-width: 380px) {
    .rb-brand__name { font-size: var(--rb-fs-md); }
}
