/* =========================================================================
   ShieldOS 운영자 콘솔 - 모던 셸 (sdadmin) 전용 스타일
   * 이 파일은 application/views/admin/default.php 에서만 로드됩니다.
   * /login 관리자 페이지 및 하위 콘텐츠 페이지에는 영향을 주지 않습니다.
   * hamburger.css 보다 뒤에 로드되어 셸(사이드바/탑바/콘텐츠 컨테이너)만 덮어씁니다.
   ========================================================================= */

:root {
    --sb-w: 252px;
    --sb-w-collapsed: 68px;
    --sb-top-h: 58px;
    --sb-bg: #0f172a;          /* slate-900  */
    --sb-bg-2: #111c33;
    --sb-border: #1e293b;      /* slate-800  */
    --sb-text: #94a3b8;        /* slate-400  */
    --sb-text-strong: #e2e8f0; /* slate-200  */
    --sb-muted: #64748b;       /* slate-500  */
    --sb-accent: #3b82f6;      /* blue-500   */
    --sb-accent-2: #2563eb;    /* blue-600   */
    --sb-accent-soft: rgba(59,130,246,.14);
    --canvas: #eef2f6;
    --card: #ffffff;
    --card-border: #e2e8f0;
    --ink: #0f172a;
}

/* ---- 셸 컨테이너 ---- */
.sb-app * { box-sizing: border-box; }
.sb-app {
    font-family: "Pretendard", "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01";
    letter-spacing: -0.011em;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}
body { background: var(--canvas); }

/* 숫자는 표 정렬을 위해 tabular(고정폭) 적용 — 전문적 정렬감 */
.sb-app .dc-value, .sb-app .cs-num, .sb-app .bar-val, .sb-app .rank-cnt,
.sb-app .patch-cnt, .sb-app .dash-badge, .sb-app table.sd-grid td,
.sb-app .sb-user-meta, .sb-app .sd-pagination { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* =========================================================================
   사이드바
   ========================================================================= */
.sb-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sb-w);
    background: linear-gradient(180deg, var(--sb-bg-2) 0%, var(--sb-bg) 100%);
    border-right: 1px solid var(--sb-border);
    display: flex; flex-direction: column;
    z-index: 40;
    transition: width .22s ease, transform .25s ease;
    overflow: hidden;
}

/* 브랜드 */
.sb-brand {
    height: var(--sb-top-h);
    flex: 0 0 var(--sb-top-h);
    display: flex; align-items: center; gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid var(--sb-border);
    color: #fff;
    white-space: nowrap; overflow: hidden;
}
.sb-brand .sb-logo {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--sb-accent) 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(59,130,246,.4);
}
.sb-brand .sb-logo svg { width: 18px; height: 18px; color: #fff; }
.sb-brand .sb-brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand .sb-brand-txt b { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.sb-brand .sb-brand-txt span { font-size: 10px; color: var(--sb-muted); letter-spacing: 1.5px; text-transform: uppercase; }

/* 네비게이션 스크롤 영역 */
.sb-nav {
    flex: 1 1 auto;
    overflow-y: auto; overflow-x: hidden;
    padding: 10px 12px 24px;
}
.sb-nav::-webkit-scrollbar { width: 8px; }
.sb-nav::-webkit-scrollbar-thumb { background: #243049; border-radius: 8px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }

/* 그룹 라벨 */
.sb-group { margin-top: 14px; }
.sb-group:first-child { margin-top: 2px; }
.sb-group-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sb-muted);
    padding: 6px 12px;
    white-space: nowrap; overflow: hidden;
}
.sb-group ul { list-style: none; margin: 0; padding: 0; }

/* 1depth 항목 */
.sb-item { position: relative; }
.sb-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin: 1px 0;
    border-radius: 9px;
    color: var(--sb-text); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s;
}
.sb-link .sb-ic { flex: 0 0 20px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: var(--sb-text); transition: color .15s; }
.sb-link .sb-ic svg { width: 18px; height: 18px; }
.sb-link .sb-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.sb-link .sb-caret { flex: 0 0 14px; width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.sb-link .sb-caret svg { width: 14px; height: 14px; }

.sb-link:hover { background: #18233b; color: var(--sb-text-strong); }
.sb-link:hover .sb-ic { color: var(--sb-text-strong); }

/* 활성 항목 */
.sb-item.active > .sb-link {
    background: var(--sb-accent-soft);
    color: #fff;
}
.sb-item.active > .sb-link .sb-ic { color: var(--sb-accent); }
.sb-item.active > .sb-link::before {
    content: ""; position: absolute; left: 0; top: 7px; bottom: 7px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--sb-accent);
}
.sb-item.expanded > .sb-link .sb-caret { transform: rotate(180deg); }

/* 2depth (서브메뉴) */
.sb-sub {
    list-style: none; margin: 2px 0 6px; padding: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
}
.sb-item.expanded > .sb-sub { max-height: 520px; }
.sb-sub a {
    display: block; position: relative;
    padding: 7px 12px 7px 43px; margin: 1px 0;
    border-radius: 8px;
    color: var(--sb-text); text-decoration: none;
    font-size: 12.8px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.sb-sub a::before {
    content: ""; position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: #334155;
    transition: background .15s;
}
.sb-sub a:hover { background: #18233b; color: var(--sb-text-strong); }
.sb-sub a:hover::before { background: var(--sb-muted); }
.sb-sub a.active { color: #fff; font-weight: 600; }
.sb-sub a.active::before { background: var(--sb-accent); box-shadow: 0 0 0 3px var(--sb-accent-soft); }

/* =========================================================================
   접힌(아이콘 전용) 사이드바 — 데스크탑
   ========================================================================= */
.sb-app.sb-collapsed .sb-sidebar { width: var(--sb-w-collapsed); }
.sb-app.sb-collapsed .sb-main-wrap { margin-left: var(--sb-w-collapsed); }
.sb-app.sb-collapsed .sb-brand-txt,
.sb-app.sb-collapsed .sb-group-label,
.sb-app.sb-collapsed .sb-label,
.sb-app.sb-collapsed .sb-caret { display: none; }
.sb-app.sb-collapsed .sb-link { justify-content: center; padding: 11px 0; }
.sb-app.sb-collapsed .sb-sub { display: none; }
.sb-app.sb-collapsed .sb-brand { justify-content: center; padding: 0; }
/* 접힘 상태에서 hover 시 라벨 툴팁 */
.sb-app.sb-collapsed .sb-item > .sb-link { position: relative; }
.sb-app.sb-collapsed .sb-item > .sb-link:hover::after {
    content: attr(data-tip);
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: #1e293b; color: #fff; font-size: 12px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 60;
    box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none;
}

/* =========================================================================
   메인 영역 (탑바 + 콘텐츠)
   ========================================================================= */
.sb-main-wrap {
    margin-left: var(--sb-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    background: var(--canvas);
    transition: margin-left .22s ease;
}

/* 탑바 */
.sb-topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--sb-top-h); flex: 0 0 var(--sb-top-h);
    display: flex; align-items: center; gap: 14px;
    padding: 0 20px;
    background: rgba(255,255,255,.85);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--card-border);
}
.sb-hamb {
    width: 38px; height: 38px; border: 0; border-radius: 9px;
    background: transparent; cursor: pointer; color: #475569;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.sb-hamb:hover { background: #eef2f6; }
.sb-hamb svg { width: 20px; height: 20px; }

.sb-page-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.sb-breadcrumb { font-size: 12px; color: var(--sb-muted); margin-left: 2px; }

.sb-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sb-user { display: flex; align-items: center; gap: 10px; }
.sb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--sb-accent) 0%, #7c3aed 100%);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(59,130,246,.35);
}
.sb-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.sb-user-meta b { font-size: 13px; font-weight: 600; color: var(--ink); }
.sb-user-meta span { font-size: 11px; color: var(--sb-muted); }
.sb-logout {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: 9px;
    background: #fff; border: 1px solid var(--card-border);
    color: #475569; font-size: 12.5px; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: all .15s;
}
.sb-logout:hover { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.sb-logout svg { width: 15px; height: 15px; }

/* 콘텐츠 카드 컨테이너 — hamburger.css #content 규칙을 덮어씀 */
.sb-main { flex: 1 1 auto; padding: 18px; }
.sb-app #content {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    padding: 22px 22px 28px;
    position: relative; width: auto; height: auto;
    min-height: calc(100vh - var(--sb-top-h) - 36px);
}
.sb-app #content h1 { color: var(--ink); font-size: 18px; font-weight: 700; margin: 0 0 16px; }

/* 구버전 .smenu(상단 서브탭) 숨김 — 사이드바 아코디언으로 대체 */
.sb-app .smenu, #contentLayer { display: none !important; }

/* =========================================================================
   모바일 오프캔버스
   ========================================================================= */
.sb-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    z-index: 39; opacity: 0; visibility: hidden; transition: opacity .2s;
}
.sb-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 900px) {
    .sb-sidebar { transform: translateX(-100%); width: var(--sb-w); }
    .sb-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
    .sb-main-wrap { margin-left: 0 !important; }
    .sb-app.sb-collapsed .sb-sidebar { width: var(--sb-w); }
    .sb-user-meta { display: none; }
}

@media (max-width: 560px) {
    .sb-main { padding: 10px; }
    .sb-app #content { border-radius: 10px; padding: 16px 14px 22px; }
    .sb-page-title { font-size: 14px; }
}

/* =========================================================================
   콘텐츠 영역 (그리드 / 툴바 / 페이지네이션 / 폼) — 좌측 사이드바 톤과 통일
   * 공유 템플릿(table_tmpl / pagesearch / paginatioin / querysearch)이 출력하는
     마크업을 셸 CSS 레벨에서 일괄 스타일링.
   ========================================================================= */

/* 본문 기본 타이포 */
.sb-app #content { font-size: 13px; color: #334155; line-height: 1.5; }
.sb-app #content a { color: var(--sb-accent-2); }

/* ---- 상단 툴바 (제목 + 검색) ---- */
.sb-app #content .sd-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    margin: 0 0 18px; padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
}
.sb-app #content .sd-toolbar-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sb-app #content .sd-toolbar-ic {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
    background: var(--sb-accent-soft); color: var(--sb-accent);
    display: flex; align-items: center; justify-content: center;
}
.sb-app #content .sd-toolbar-ic svg { width: 19px; height: 19px; }
.sb-app #content .sd-toolbar-h {
    font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.3px;
}
.sb-app #content .sd-toolbar-insert { margin-left: 4px; display: inline-flex; align-items: center; }
.sb-app #content .sd-toolbar-search { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 폼 컨트롤 ---- */
.sb-app #content .sd-select,
.sb-app #content .sd-input,
.sb-app #content .sd-textarea {
    height: 38px; border: 1.5px solid var(--card-border); border-radius: 10px;
    padding: 0 12px; font-size: 13px; color: var(--ink); background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.sb-app #content .sd-select { padding-right: 30px; cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.sb-app #content .sd-textarea { height: auto; min-height: 40px; padding: 8px 12px; line-height: 1.45; resize: vertical; }
.sb-app #content .sd-input:focus,
.sb-app #content .sd-select:focus,
.sb-app #content .sd-textarea:focus { border-color: var(--sb-accent); box-shadow: 0 0 0 3px var(--sb-accent-soft); }
.sb-app #content .sd-search-btn {
    height: 38px; min-width: 42px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, var(--sb-accent) 0%, var(--sb-accent-2) 100%);
    color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(37,99,235,.32);
    transition: filter .15s, box-shadow .15s;
}
.sb-app #content .sd-search-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(37,99,235,.42); }
.sb-app #content .sd-search-btn svg { width: 16px; height: 16px; }

/* ---- 그리드(데이터 테이블) ---- */
.sb-app #content .sd-grid-wrap {
    width: 100%; overflow-x: auto;
    border: 1px solid var(--card-border); border-radius: 12px;
    margin: 2px 0 8px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
    -webkit-overflow-scrolling: touch;
}
.sb-app #content table.sd-grid {
    border-collapse: collapse; width: 100%; min-width: max-content;
    font-size: 12.5px; background: #fff; color: #475569;
}
.sb-app #content table.sd-grid th {
    background: #1e293b; color: #f1f5f9;
    font-weight: 600; font-size: 11.5px; letter-spacing: .2px;
    padding: 7px 9px; text-align: center; white-space: nowrap;
    border-right: 1px solid #2b3a52; border-bottom: 1px solid #0f172a;
    position: sticky; top: 0;
}
.sb-app #content table.sd-grid th:last-child { border-right: 0; }
.sb-app #content table.sd-grid td {
    padding: 4px 9px; text-align: center; color: #475569; line-height: 1.45;
    border-right: 1px solid #f1f5f9; border-bottom: 1px solid #eef2f6;
    white-space: nowrap;
}
.sb-app #content table.sd-grid td:last-child { border-right: 0; }
.sb-app #content table.sd-grid tr:last-child td { border-bottom: 0; }
.sb-app #content table.sd-grid tr.alt td { background: #f8fafc; }
.sb-app #content table.sd-grid tr:hover td { background: #eef4ff; }
.sb-app #content table.sd-grid a { color: #2563eb; text-decoration: none; }
.sb-app #content table.sd-grid a:hover { color: #1d4ed8; text-decoration: underline; }
.sb-app #content table.sd-grid img { vertical-align: middle; max-height: 20px; }
.sb-app #content table.sd-grid del { color: #94a3b8; }
.sb-app #content table.sd-grid font[color="red"] { color: #ef4444 !important; }

/* ---- 액션 아이콘: 기존 gif 를 SVG 로 치환 (마크업/onClick 보존) ----
 * 트릭: img 콘텐츠 박스를 0x0 으로 만들어 원본 gif 를 숨기고,
 *       padding 영역에 배경 SVG 를 그려 클릭영역(onClick)은 그대로 유지. */
.sb-app #content img[src*="01_bu02.gif"],
.sb-app #content img[src*="01_bu03.gif"],
.sb-app #content img[src*="btn_7.gif"],
.sb-app #content img[src*="n_icon182.gif"],
.sb-app #content img[src*="n_icon152.gif"],
.sb-app #content img[src*="n_bu_l01.gif"],
.sb-app #content img[src*="btn_8.gif"],
.sb-app #content img[src*="01_bu13.gif"],
.sb-app #content img[src*="04_bu25.gif"],
.sb-app #content img[src*="btn_1.gif"] {
    box-sizing: content-box !important;
    width: 0 !important; height: 0 !important;
    padding: 9px !important; margin: 0 1px !important;
    max-height: none !important;
    background-repeat: no-repeat; background-position: center; background-size: 17px 17px;
    border-radius: 6px; vertical-align: middle; cursor: pointer;
    transition: background-color .15s, transform .1s;
}
.sb-app #content img[src*="01_bu02.gif"]:hover,
.sb-app #content img[src*="01_bu03.gif"]:hover,
.sb-app #content img[src*="btn_7.gif"]:hover,
.sb-app #content img[src*="n_icon182.gif"]:hover,
.sb-app #content img[src*="n_icon152.gif"]:hover,
.sb-app #content img[src*="n_bu_l01.gif"]:hover,
.sb-app #content img[src*="btn_8.gif"]:hover,
.sb-app #content img[src*="01_bu13.gif"]:hover,
.sb-app #content img[src*="04_bu25.gif"]:hover,
.sb-app #content img[src*="btn_1.gif"]:hover { background-color: #eef2f6; transform: translateY(-1px); }

/* 삭제 (휴지통, red) */
.sb-app #content img[src*="01_bu02.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E"); }
.sb-app #content img[src*="01_bu02.gif"]:hover { background-color: #fee2e2; }

/* 수정 (연필, blue) */
.sb-app #content img[src*="01_bu03.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E"); }

/* 복구/초기화 (되돌리기, green) */
.sb-app #content img[src*="btn_7.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E"); }
.sb-app #content img[src*="btn_7.gif"]:hover { background-color: #dcfce7; }

/* 상세보기 (눈, slate) */
.sb-app #content img[src*="n_icon182.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }

/* 로그 (문서, indigo) */
.sb-app #content img[src*="n_icon152.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E"); }

/* 다운로드 (blue) */
.sb-app #content img[src*="n_bu_l01.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E"); }

/* 중지 (정지표지, amber) */
.sb-app #content img[src*="btn_8.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E"); }
.sb-app #content img[src*="btn_8.gif"]:hover { background-color: #fef3c7; }

/* 재시작 (새로고침, green) */
.sb-app #content img[src*="01_bu13.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpath d='M20.49 15a9 9 0 1 1-2.12-9.36L23 10'/%3E%3C/svg%3E"); }

/* 미리보기 (확대, slate) */
.sb-app #content img[src*="04_bu25.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E"); }

/* 버전변경 (새로고침, blue) */
.sb-app #content img[src*="btn_1.gif"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'/%3E%3C/svg%3E"); }

/* ---- 페이지네이션 ---- */
.sb-app #content .sd-pagination {
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
    gap: 5px; margin: 18px 0 6px; padding: 0;
}
.sb-app #content .sd-pagination a,
.sb-app #content .sd-pagination .pg {
    min-width: 34px; height: 34px; padding: 0 11px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; color: #475569; text-decoration: none;
    border: 1px solid var(--card-border); background: #fff;
    transition: all .15s; cursor: pointer;
}
.sb-app #content .sd-pagination a:hover { border-color: var(--sb-accent); color: var(--sb-accent); background: #eff6ff; }
.sb-app #content .sd-pagination .cur {
    background: linear-gradient(135deg, var(--sb-accent) 0%, var(--sb-accent-2) 100%);
    border-color: var(--sb-accent-2); color: #fff; font-weight: 700;
    box-shadow: 0 3px 8px rgba(37,99,235,.35);
}
.sb-app #content .sd-pagination .nav-ic { font-size: 15px; line-height: 1; color: #64748b; }

/* ---- 하단 카피라이트 ---- */
.sb-app #content .sd-copyright { margin-top: 22px; text-align: center; font-size: 11.5px; color: #94a3b8; }

/* =========================================================================
   대시보드
   ========================================================================= */
.sb-app #content .dash-wrap { display: flex; flex-direction: column; gap: 18px; }

.sb-app #content .dash-head { display: flex; align-items: center; justify-content: space-between; }
.sb-app #content .dash-title { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.sb-app #content .dash-title svg { width: 21px; height: 21px; color: var(--sb-accent); }
.sb-app #content .dash-date { font-size: 12.5px; color: var(--sb-muted); margin: 4px 0 0 30px; }

/* 통계 카드 */
.sb-app #content .dash-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 13px; }
.sb-app #content .dash-card {
    position: relative; background: #fff; border: 1px solid var(--card-border);
    border-radius: 14px; padding: 16px 16px 14px;
    display: flex; flex-direction: column; gap: 3px; overflow: hidden;
    transition: transform .12s, box-shadow .15s;
}
.sb-app #content .dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.sb-app #content .dash-card .dc-ic {
    width: 38px; height: 38px; border-radius: 11px; margin-bottom: 8px;
    background: var(--sb-accent-soft); color: var(--sb-accent);
    display: flex; align-items: center; justify-content: center;
}
.sb-app #content .dash-card .dc-ic svg { width: 20px; height: 20px; }
.sb-app #content .dash-card .dc-label { font-size: 12.5px; color: var(--sb-muted); font-weight: 500; }
.sb-app #content .dash-card .dc-value { font-size: 27px; font-weight: 800; color: var(--ink); letter-spacing: -.6px; line-height: 1.1; }
.sb-app #content .dash-card .dc-sub { font-size: 11px; color: #94a3b8; }
.sb-app #content .dash-card.accent {
    background: linear-gradient(135deg, var(--sb-accent) 0%, var(--sb-accent-2) 100%);
    border-color: transparent;
}
.sb-app #content .dash-card.accent .dc-ic { background: rgba(255,255,255,.22); color: #fff; }
.sb-app #content .dash-card.accent .dc-label,
.sb-app #content .dash-card.accent .dc-value { color: #fff; }
.sb-app #content .dash-card.accent .dc-sub { color: rgba(255,255,255,.85); }

/* 패널 */
.sb-app #content .dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sb-app #content .dash-panel {
    background: #fff; border: 1px solid var(--card-border); border-radius: 14px;
    padding: 18px 20px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.sb-app #content .dash-panel h3 {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 18px;
}
.sb-app #content .dash-panel h3 svg { width: 17px; height: 17px; color: var(--sb-accent); }
.sb-app #content .dash-badge {
    font-size: 11.5px; font-weight: 600; color: var(--sb-accent-2);
    background: var(--sb-accent-soft); padding: 2px 9px; border-radius: 20px;
}
.sb-app #content .dash-legend { margin-left: auto; font-size: 11.5px; color: var(--sb-muted); font-weight: 500; display: flex; align-items: center; gap: 5px; }
.sb-app #content .dash-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sb-app #content .dash-legend .lg.s { background: #16a34a; margin-left: 6px; }
.sb-app #content .dash-legend .lg.f { background: #ef4444; margin-left: 6px; }
.sb-app #content .dash-empty { padding: 26px 0; text-align: center; color: #94a3b8; font-size: 13px; }

/* 막대 차트 (로그) */
.sb-app #content .bar-row { display: grid; grid-template-columns: 96px 1fr 60px; align-items: center; gap: 12px; margin-bottom: 13px; }
.sb-app #content .bar-row:last-child { margin-bottom: 0; }
.sb-app #content .bar-label { font-size: 12.5px; color: #475569; font-weight: 500; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sb-app #content .bar-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.sb-app #content .bar-track { height: 13px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.sb-app #content .bar-fill { display: block; height: 100%; border-radius: 7px; transition: width .5s ease; min-width: 3px; }
.sb-app #content .bar-val { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; }

/* 패치 성공/실패 */
.sb-app #content .patch-row { display: grid; grid-template-columns: 64px 1fr 74px; align-items: center; gap: 12px; margin-bottom: 14px; }
.sb-app #content .patch-row:last-child { margin-bottom: 0; }
.sb-app #content .patch-gubun { font-size: 12.5px; font-weight: 600; color: #475569; white-space: nowrap; }
.sb-app #content .stack { display: flex; height: 14px; background: #f1f5f9; border-radius: 7px; overflow: hidden; gap: 2px; }
.sb-app #content .stack .s { background: #16a34a; transition: width .5s ease; }
.sb-app #content .stack .f { background: #ef4444; transition: width .5s ease; }
.sb-app #content .stack .s:first-child { border-radius: 7px 0 0 7px; }
.sb-app #content .patch-cnt { font-size: 12px; text-align: right; color: #94a3b8; }
.sb-app #content .patch-cnt .cs { color: #16a34a; }
.sb-app #content .patch-cnt .cf { color: #ef4444; }

/* Client 현황 — 상단 통계 카드와 동일 디자인, 한 줄 4카드 */
.sb-app #content .dash-cards.client-cards { grid-template-columns: repeat(4, 1fr); }
.sb-app #content .dash-card.ok .dc-ic { background: #dcfce7; color: #16a34a; }
.sb-app #content .dash-card.danger .dc-ic { background: #fee2e2; color: #ef4444; }
@media (max-width: 1100px) { .sb-app #content .dash-cards.client-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .sb-app #content .dash-cards.client-cards { grid-template-columns: 1fr; } }

/* 차단선택 빈도 랭킹 리스트 */
.sb-app #content .dash-sub-t { font-size: 11.5px; color: var(--sb-muted); font-weight: 500; }
.sb-app #content .rank-row { display: grid; grid-template-columns: 26px 1fr 200px 60px; align-items: center; gap: 12px; margin-bottom: 10px; }
.sb-app #content .rank-row:last-child { margin-bottom: 0; }
.sb-app #content .rank-no {
    width: 24px; height: 24px; border-radius: 7px; flex: 0 0 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #64748b; background: #f1f5f9;
}
.sb-app #content .rank-no.rank-1 { background: #fef3c7; color: #d97706; }
.sb-app #content .rank-no.rank-2 { background: #e2e8f0; color: #475569; }
.sb-app #content .rank-no.rank-3 { background: #ffedd5; color: #c2410c; }
.sb-app #content .rank-name { font-size: 13px; color: #334155; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-app #content .rank-ext { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 600; color: #f59e0b; background: #fff7ed; border: 1px solid #fed7aa; padding: 1px 7px; border-radius: 20px; }
.sb-app #content .rank-track { height: 10px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.sb-app #content .rank-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #fbbf24, #f59e0b); transition: width .5s ease; min-width: 3px; }
.sb-app #content .rank-cnt { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; }

@media (max-width: 1100px) { .sb-app #content .dash-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .sb-app #content .dash-row { grid-template-columns: 1fr; } .sb-app #content .rank-row { grid-template-columns: 24px 1fr 90px 52px; } }
@media (max-width: 560px)  { .sb-app #content .dash-cards { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================================
   Tray 관리 콘텐츠 (도움말 / 공지사항) — #content 안에서만 적용 (Agent Tray 원본 무영향)
   ========================================================================= */
.sb-app #content #container { margin: 0; border: 0; box-shadow: none; background: transparent; }

/* 도움말 제목 */
.sb-app #content #container h1 {
    position: relative; font-size: 19px; font-weight: 800; color: var(--ink);
    letter-spacing: -.4px; margin: 2px 0 20px; padding: 0 0 14px 14px;
    border-bottom: 1px solid var(--card-border);
}
.sb-app #content #container h1::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 16px; width: 5px;
    border-radius: 3px; background: linear-gradient(180deg, var(--sb-accent), #7c3aed);
}
.sb-app #content #container #body { margin: 0; padding: 0 2px; }

/* li 를 섹션 소제목처럼 (원본이 <ul> 없이 <li> 사용) */
.sb-app #content #container #body li {
    list-style: none; position: relative;
    margin: 22px 0 10px; padding: 0 0 0 16px;
    font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.2px;
}
.sb-app #content #container #body li::before {
    content: ""; position: absolute; left: 0; top: 4px; width: 7px; height: 13px;
    border-radius: 3px; background: var(--sb-accent);
}
.sb-app #content #container p {
    font-size: 13.5px; line-height: 1.75; color: #475569; margin: 0 0 12px;
}
.sb-app #content #container img { max-width: 100%; height: auto; border: 1px solid var(--card-border); border-radius: 10px; margin: 6px 0; }
.sb-app #content #container a { color: var(--sb-accent-2); font-weight: 600; }
.sb-app #content #container a:hover { text-decoration: underline; }

/* 코드/메뉴 블록 (help 내부 pre, code) */
.sb-app #content #container code,
.sb-app #content #container #body pre {
    display: block; font-family: "SFMono-Regular", Consolas, "JetBrains Mono", Menlo, monospace;
    font-size: 12.5px; line-height: 1.6; color: #334155;
    background: #f8fafc; border: 1px solid var(--card-border); border-radius: 10px;
    padding: 14px 16px; margin: 12px 0; overflow-x: auto; white-space: pre;
}

/* 공지사항 (ann_contents) — container 직속 pre 를 공지 카드로 */
.sb-app #content #container > pre {
    position: relative; white-space: pre-wrap; word-break: break-word;
    font-family: inherit; font-size: 14px; line-height: 1.85; color: #334155;
    background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe; border-left: 4px solid var(--sb-accent);
    border-radius: 12px; padding: 46px 22px 22px; margin: 4px 0;
}
.sb-app #content #container > pre::before {
    content: "📢  공지사항"; position: absolute; left: 18px; top: 14px;
    font-family: "Pretendard", sans-serif; font-size: 12.5px; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, var(--sb-accent), var(--sb-accent-2));
    padding: 4px 12px; border-radius: 20px; letter-spacing: .2px;
    box-shadow: 0 3px 8px rgba(37,99,235,.3);
}
.sb-app #content #container > pre a {
    display: inline-block; margin-top: 4px; padding: 3px 12px; border-radius: 7px;
    background: #fff; border: 1px solid var(--sb-accent); color: var(--sb-accent-2);
    font-size: 12.5px; text-decoration: none;
}
.sb-app #content #container > pre a:hover { background: var(--sb-accent); color: #fff; text-decoration: none; }

/* =========================================================================
   로그인 모드 — 미로그인 시 셸 크롬을 숨기고 중앙 카드형 로그인 표시
   (admin/login.php 가 body 에 .sd-login-mode 를 부여)
   ========================================================================= */
.sd-login-mode .sb-sidebar,
.sd-login-mode .sb-topbar { display: none !important; }
.sd-login-mode .sb-main-wrap {
    margin-left: 0 !important;
    background: radial-gradient(1200px 600px at 20% -10%, #1e293b 0%, #0f172a 55%, #0b1120 100%);
}
.sd-login-mode .sb-main { padding: 0; display: flex; }
.sd-login-mode #content {
    background: transparent; border: 0; box-shadow: none;
    padding: 0; min-height: 100vh; width: 100%;
}

.sd-login {
    width: 100%; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.sd-login-card {
    width: 100%; max-width: 392px;
    background: #fff; border-radius: 18px;
    padding: 40px 36px 30px;
    box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.2);
    text-align: center;
    animation: sdLoginIn .35s ease;
}
@keyframes sdLoginIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.sd-login-logo {
    width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px;
    background: linear-gradient(135deg, var(--sb-accent) 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(59,130,246,.4);
}
.sd-login-logo svg { width: 30px; height: 30px; color: #fff; }

.sd-login-card h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 6px; letter-spacing: -.3px; }
.sd-login-sub { font-size: 13px; color: var(--sb-muted); margin: 0 0 28px; }

.sd-login form { text-align: left; }
.sd-login label { display: block; font-size: 12.5px; font-weight: 600; color: #475569; margin: 0 0 7px; }
.sd-field { position: relative; margin-bottom: 18px; }
.sd-field .sd-fic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; width: 18px; height: 18px; display: flex; }
.sd-field .sd-fic svg { width: 18px; height: 18px; }
.sd-field input {
    width: 100%; height: 46px; padding: 0 14px 0 42px;
    border: 1.5px solid var(--card-border); border-radius: 11px;
    font-size: 14px; color: var(--ink); background: #f8fafc;
    transition: border-color .15s, box-shadow .15s, background .15s; outline: none;
}
.sd-field input::placeholder { color: #a3aec0; }
.sd-field input:focus { border-color: var(--sb-accent); background: #fff; box-shadow: 0 0 0 4px var(--sb-accent-soft); }

.sd-login-btn {
    width: 100%; height: 48px; margin-top: 6px; border: 0; border-radius: 11px; cursor: pointer;
    background: linear-gradient(135deg, var(--sb-accent) 0%, var(--sb-accent-2) 100%);
    color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .3px;
    box-shadow: 0 8px 20px rgba(37,99,235,.4);
    transition: transform .1s, box-shadow .15s, filter .15s;
}
.sd-login-btn:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(37,99,235,.5); }
.sd-login-btn:active { transform: translateY(1px); }

.sd-login-foot { margin-top: 24px; font-size: 11.5px; color: #94a3b8; letter-spacing: .3px; }

@media (max-width: 560px) {
    .sd-login-card { padding: 32px 22px 24px; border-radius: 14px; }
}
