/* ============================================================
   LemonWeb 전역 스타일 — DESIGN.MD §1(테마)·§4(전역 CSS) 기준
   "종이와 잉크" 메타포: paper=밝은 면, ink=글자.
   빗금(repeating-linear-gradient)=오버레이/비활성/읽음 상태 언어.
   ============================================================ */

/* ---------- 폰트 ---------- */
@font-face {
    font-family: 'Hand';
    src: url('../fonts/LeeSeoyun.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Dotum';
    src: url('../fonts/GowunDodum-Regular.woff2') format('woff2');
    font-weight: 100;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-ExtraLight.woff2') format('woff2');
    font-weight: 200;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-Light.woff2') format('woff2');
    font-weight: 300;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-Text.woff2') format('woff2');
    font-weight: 400;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-Medium.woff2') format('woff2');
    font-weight: 500;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-SemiBold.woff2') format('woff2');
    font-weight: 600;
}

@font-face {
    font-family: 'Normal';
    src: url('../fonts/IBMPlexSansKR-Bold.woff2') format('woff2');
    font-weight: 700;
}

/* CSS content로 아이콘 쓸 때용 별칭 */
@font-face {
    font-family: 'Icon_Solid';
    src: url('../icons/webfonts/fa-solid-900.woff2') format('woff2');
}
@font-face {
    font-family: 'Icon_Regular';
    src: url('../icons/webfonts/fa-regular-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Icon_Light';
    src: url('../icons/webfonts/fa-light-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Icon_Thin';
    src: url('../icons/webfonts/fa-thin-100.woff2') format('woff2');
}
@font-face {
    font-family: 'Icon_Custom';
    src: url('../icons/webfonts/custom-icons.woff2') format('woff2');
}

/* ---------- 라이트 테마 ---------- */
html[data-theme="light"] body {
    /* 종이와 잉크 */
    --theme-overlay: repeating-linear-gradient(50deg, rgba(0, 0, 0, 0.6) 0px, rgba(0, 0, 0, 0.6) 1px, rgba(0, 0, 0, 0.7) 1px, rgba(0, 0, 0, 0.7) 5px);
    --theme-disabled: repeating-linear-gradient(55.5deg, rgba(255, 255, 255, 0.7) 0px, rgba(255, 255, 255, 0.7) 1px, rgba(0, 0, 0, 0.05) 1px, rgba(0, 0, 0, 0.05) 5px);
    --theme-read: repeating-linear-gradient(55.5deg, rgba(255, 255, 255, 0.4) 0px, rgba(255, 255, 255, 0.4) 1px, rgba(0, 0, 0, 0.03) 1px, rgba(0, 0, 0, 0.03) 5px);
    --theme-background: linear-gradient(to bottom, #EEE, #e0e0e0);
    --theme-background-popup: linear-gradient(to bottom, #EEE, #e0e0e0);
    --theme-background-popup-shadow-transperancy: 0.1;
    --theme-background-mean: #e7e7e7;
    --theme-icon-background: 255, 255, 255;
    --theme-paper: #FDFDFD;
    --theme-paper-rgb: 253, 253, 253;
    --theme-ink: #333;
    --theme-ink-ii: #666;
    --theme-ink-rgb: 51, 51, 51;
    --theme-shadow: rgba(0, 0, 0, 0.7);
    --theme-shadow-weak: rgba(0, 0, 0, 0.1);
    /* 비활성 */
    --theme-disabled-paper: #ccc;
    --theme-disabled-ink: #777;
    /* 브랜드 (노랑) — hover는 크리티컬처럼 약간 밝게 (변화폭은 절제) */
    --theme-color: #FBD230;
    --theme-color-light: #E6D9A8;
    --theme-color-hover: #FCD745;
    --theme-color-active: #CFAA19;
    /* hover 시 테두리 (눌림 배경과 분리) — active를 내부(hover)색 쪽으로 50% 당겨 대비 완화 */
    --theme-color-hover-border: #E6C02F;
    --theme-color-rgb: 251, 210, 48;
    --theme-color-hover-rgb: 252, 215, 69;
    /* 브랜드색 면 위 글자 (라이트는 기존 잉크와 동일 — 시각 변화 없음) */
    --theme-color-ink: #333;
    /* 중립 회색 */
    --theme-dark: #eee;
    --theme-dark-hover: #aaa;
    --theme-dark-active: #ccc;
    --theme-dark-ink: #fdfdfd;
    /* 위험 (주황) */
    --theme-color-critical-ink: #fdfdfd;
    --theme-color-critical: #DB5000;
    --theme-color-critical-hover: #E15F14;
    --theme-color-critical-active: #A83D00;
    --theme-color-critical-rgb: 219, 80, 0;
    /* 방향 쌍 (2026-07-11 신설·2계층 개편) — 플러스(입금·수입 = 파랑) / 마이너스(출금·차감 = 러스트).
       -bg = 면(칩·미터 세그먼트·범례 점, 흰 글자 얹는 중간톤) / 무접미 = 글자(금액·음수 차액) —
       라이트는 글자를 bg보다 어둡게 (밝은 종이 위 대비). critical(주황)은 오류·위험·삭제 "상태" 전용 분리 유지 */
    --theme-color-plus-bg: #3E78CC;
    --theme-color-plus-bg-hover: #4C86D8;
    --theme-color-plus-bg-active: #2F62AC;
    --theme-color-plus-bg-rgb: 62, 120, 204;
    --theme-color-plus-ink: #FDFDFD;
    --theme-color-plus: #1F5AB4;
    --theme-color-plus-hover: #2968C9;
    --theme-color-plus-active: #17458C;
    --theme-color-plus-rgb: 31, 90, 180;
    --theme-color-minus-bg: #C0552F;
    --theme-color-minus-bg-hover: #CD6340;
    --theme-color-minus-bg-active: #A04322;
    --theme-color-minus-bg-rgb: 192, 85, 47;
    --theme-color-minus-ink: #FDFDFD;
    --theme-color-minus: #A63E1C;
    --theme-color-minus-hover: #B54A26;
    --theme-color-minus-active: #8A3013;
    --theme-color-minus-rgb: 166, 62, 28;
    /* 플랫 */
    --theme-color-flat: #f8f8f8;
}

/* ---------- 다크 테마 ----------
   2026-07-03 미려화: 골드 브랜드(#CEAF5A)에 맞춘 웜 뉴트럴 팔레트.
   "밤의 종이" — 배경은 깊은 웜 그레이 그라데이션, 종이는 살짝 떠 보이는 웜 서피스,
   잉크는 따뜻한 오프화이트(대비 강화). 빗금·라운딩 등 시그니처 문법은 유지 */
html[data-theme="dark"] body {
    --theme-overlay: repeating-linear-gradient(50deg, rgba(0, 0, 0, 0.8) 0px, rgba(0, 0, 0, 0.8) 1px, rgba(0, 0, 0, 0.6) 1px, rgba(0, 0, 0, 0.6) 5px);
    --theme-disabled: repeating-linear-gradient(55.5deg, rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 5px);
    --theme-read: repeating-linear-gradient(55.5deg, rgba(255, 255, 255, 0.1) 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.00) 1px, rgba(255, 255, 255, 0.00) 5px);
    /* 배경·팝업·비활성·다크 계열 전부 무채색 (2026-07-03 — 밝기 유지, 채도 제거) */
    --theme-background: linear-gradient(to bottom, #2C2C2C, #151515);
    --theme-background-popup: #282828;
    --theme-background-popup-shadow-transperancy: 0.22;
    --theme-background-mean: #222222;
    --theme-icon-background: 0, 0, 0;
    /* 종이도 무채색에 가깝게 (2026-07-03 — 밝기 유지, 채도 제거) */
    --theme-paper: #373737;
    --theme-paper-rgb: 55, 55, 55;
    /* 잉크는 무채색에 가깝게 (2026-07-03 — 웜 틴트가 세피아처럼 보여 채도 제거, 밝기 유지) */
    --theme-ink: #E3E3E3;
    --theme-ink-ii: #9B9B9B;
    --theme-ink-rgb: 227, 227, 227;
    --theme-shadow: rgba(0, 0, 0, 0.85);
    --theme-shadow-weak: rgba(0, 0, 0, 0.4);
    --theme-disabled-paper: #474747;
    --theme-disabled-ink: #7C7C7C;
    /* 브랜드 (뮤트 블루) — 2026-07-03 골드 폐기, #5269B2로 확정. hover는 크리티컬처럼 약간 밝게 */
    --theme-color: #5269B2;
    --theme-color-light: #2D3444;
    --theme-color-hover: #6A81CA;
    --theme-color-active: #3C4E86;
    /* hover 시 테두리 — 다크는 기존 대비 유지 (active와 동일) */
    --theme-color-hover-border: #3C4E86;
    --theme-color-rgb: 82, 105, 178;
    --theme-color-hover-rgb: 106, 129, 202;
    /* 브랜드색 면 위 글자 — 어두운 블루 위 흰 글씨 */
    --theme-color-ink: #FDFDFD;
    --theme-dark: #3C3C3C;
    --theme-dark-hover: #696969;
    --theme-dark-active: #555555;
    --theme-dark-ink: #fdfdfd;
    --theme-color-critical-ink: #fdfdfd;
    --theme-color-critical: #97300E;
    --theme-color-critical-hover: #B23A11;
    --theme-color-critical-active: #CC4515;
    --theme-color-critical-rgb: 151, 48, 14;
    /* 방향 쌍 (2026-07-11 신설·2계층 개편) — 플러스(입금·수입 = 파랑) / 마이너스(출금·차감 = 러스트).
       -bg = 면(칩·미터 세그먼트·범례 점) / 무접미 = 글자(금액·음수 차액) — 다크는 글자를 bg보다 밝게
       (어두운 종이 위 대비). critical(브릭)은 오류·위험·삭제 "상태" 전용 분리 유지 */
    --theme-color-plus-bg: #548BDE;
    --theme-color-plus-bg-hover: #6699E5;
    --theme-color-plus-bg-active: #4374BF;
    --theme-color-plus-bg-rgb: 84, 139, 222;
    --theme-color-plus-ink: #1C1C1C;
    --theme-color-plus: #7EABEA;
    --theme-color-plus-hover: #92BAEF;
    --theme-color-plus-active: #6A9BE0;
    --theme-color-plus-rgb: 126, 171, 234;
    --theme-color-minus-bg: #A84D2F;
    --theme-color-minus-bg-hover: #B85936;
    --theme-color-minus-bg-active: #8F3F24;
    --theme-color-minus-bg-rgb: 168, 77, 47;
    --theme-color-minus-ink: #FDFDFD;
    --theme-color-minus: #E0764F;
    --theme-color-minus-hover: #E98963;
    --theme-color-minus-active: #C96540;
    --theme-color-minus-rgb: 224, 118, 79;
    --theme-color-flat: #424242;
}

:root {
    --theme-radius: 0.75rem;
    --theme-radius-small: 0.35rem;
}

/* ---------- 합성 테마 변수 ----------
   반복되던 rgba(var(--theme-*-rgb), 알파) 조합의 표준화 (2026-07-11).
   -rgb 변수를 참조하므로 라이트/다크 자동 추종 — 테마별로 알파를 달리하려면
   html[data-theme="…"] body 블록에서 재정의하면 됨.
   (:root가 아니라 body에 두는 이유: -rgb 변수가 body에 정의되어 있어
    :root에서는 var() 치환이 실패함) */
body {
    /* 면 */
    --theme-surface: rgba(var(--theme-paper-rgb), 0.4);        /* 반투명 패널·설정행 면 */
    --theme-surface-card: rgba(var(--theme-paper-rgb), 0.5);   /* 행 카드 면 */
    --theme-surface-hover: rgba(var(--theme-paper-rgb), 0.75); /* hover 배경 */
    --theme-surface-dim: rgba(var(--theme-paper-rgb), 0.25);   /* 지난·접힌 항목 면 */
    --theme-badge-bg: rgba(var(--theme-ink-rgb), 0.08);        /* 중립 배지 배경 */
    --theme-fill-weak: rgba(var(--theme-ink-rgb), 0.05);       /* 옅은 중립 면 */
    /* 선 */
    --theme-border-dash: rgba(var(--theme-ink-rgb), 0.25);     /* 점선(추가 버튼·카드)·옅은 테두리 */
    --theme-divider: rgba(var(--theme-ink-rgb), 0.15);         /* 구분선 */
    /* 그림자 */
    --theme-card-shadow: 0 0 1rem rgba(var(--theme-ink-rgb), 0.04); /* 카드 그림자 (통째) */
    /* 상태 */
    --theme-selected-bg: rgba(var(--theme-color-rgb), 0.5);          /* selected/active 배경 */
    --theme-selected-bg-strong: rgba(var(--theme-color-rgb), 0.2);    /* 강조 selected·게이지 */
    --theme-critical-surface: rgba(var(--theme-color-critical-rgb), 0.08); /* 오류 박스 배경 */
    /* 흐림 */
    --theme-opacity-disabled: 0.6; /* 비활성 요소 흐림 */
    --theme-opacity-dim: 0.55;     /* 지난·종료 항목 흐림 */
}

/* ---------- 기본 요소 ---------- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    margin: 0;
}

*::-webkit-scrollbar {
    width: 0.3rem;
}

#dotnet-compile-error {
    display: none !important;
}

body, html {
    font-family: 'Normal', 'Dotum', 'Hand';
    font-weight: 400;
    font-size: 1.02rem;
    line-height: 260%;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    background: var(--theme-background);
    background-attachment: fixed;
    color: var(--theme-ink);
    transition: background 0.3s ease, color 0.3s ease;
}

/* 세로 스크롤바 공간 상시 예약 — 내용 높이에 따라 스크롤바가 생겼다 사라지며
   가운데 정렬 콘텐츠가 좌우로 몇 px 밀리는 레이아웃 시프트 방지.
   (모달 열림 잠금(are.js)은 인라인 overflow:hidden + padding 보정이라 그대로 공존) */
html {
    overflow-y: scroll;
}

@supports (scrollbar-gutter: stable) {
    html {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }
}

/* ---------- 드래그 셀렉트 정책 (2026-07-03 확정) ----------
   전역 차단이 기본. 텍스트 선택이 필요한 곳만 .selectable을 명시적으로 부여한다.
   (카드번호·주소·거래 금액·채팅 본문 등 복사할 가치가 있는 것) */
body {
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

.selectable, .selectable * {
    user-select: text;
    -webkit-user-select: text;
}

/* 직함 서열 드래그 중 — 전역 커서를 잡는 손 모양으로 (arepositionsort.js가 토글) */
body.pos-dragging, body.pos-dragging * {
    cursor: grabbing !important;
}

/* ---------- 레이어 골격 (App.razor 커스텀 태그) ---------- */
background-ui {
    position: fixed;
    inset: 0;
    z-index: 0;
    text-align: right;
}

body-ui {
    position: relative;
    z-index: 1;
}

/* --scrollbar-comp: 모달 스크롤 잠금 중 사라진 스크롤바 폭 (are.js가 주입) — fixed 요소 밀림 방지 */
theme-switch {
    position: fixed;
    top: 0.5rem;
    right: calc(0.5rem + var(--scrollbar-comp, 0px));
    z-index: 2;
}

theme-scrolltotop {
    position: fixed;
    bottom: 0.5rem;
    right: calc(0.5rem + var(--scrollbar-comp, 0px));
    z-index: 2;
}

/* 플로팅 버튼 공통 */
.icon-browser {
    cursor: pointer;
    user-select: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20%;
    background-color: rgba(var(--theme-icon-background), 0.8);
    transition: background 0.2s ease;
}

.icon-browser:hover {
    background-color: var(--theme-color);
    color: var(--theme-color-ink);
}

.icon-browser:active {
    background-color: var(--theme-color-active);
}

/* ---------- 형광펜 링크 ---------- */
.highlight {
    background: none;
    box-shadow: inset 0 -0.7rem 0 var(--theme-color);
    display: inline;
    cursor: pointer;
}

.highlight:hover {
    box-shadow: inset 0 -0.7rem 0 var(--theme-color-active);
}

b {
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    background: none;
    box-shadow: inset 0 -0.7rem 0 var(--theme-color);
    display: inline;
    transition: box-shadow 0.2s ease;
    font-weight: 600;
}

a:hover {
    box-shadow: inset 0 -0.7rem 0 var(--theme-color-active);
}

/* ---------- 버튼 ---------- */
button {
    vertical-align: middle;
    font-family: 'Normal';
    font-weight: 500;
    font-size: 1.02rem;
    line-height: 220%;
    border-radius: var(--theme-radius);
    padding: 0rem 1rem;
    cursor: pointer;
    user-select: none;
    color: var(--theme-color-ink);
    background-color: var(--theme-color);
    background-clip: padding-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.05s ease;
    border: 2px solid var(--theme-color);
    white-space: nowrap;
    overflow: visible;
}

button:hover:not(:disabled) {
    background-color: var(--theme-color-hover);
    border: 2px solid var(--theme-color-hover-border);
}

button:active:not(:disabled) {
    background-color: var(--theme-color-active);
}

button:disabled {
    cursor: not-allowed !important;
    color: var(--theme-disabled-ink) !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px dashed var(--theme-disabled-paper) !important;
    opacity: var(--theme-opacity-disabled);
}

button.critical {
    color: var(--theme-color-critical-ink);
    border: 2px solid var(--theme-color-critical);
    background-color: var(--theme-color-critical);
}

button.critical:hover:not(:disabled) {
    background-color: var(--theme-color-critical-hover);
    border: 2px solid var(--theme-color-critical-active);
}

button.critical:active:not(:disabled) {
    background-color: var(--theme-color-critical-active);
}

button.critical:disabled {
    cursor: not-allowed !important;
    color: var(--theme-disabled-ink) !important;
    background-color: transparent !important;
    border: 2px dashed var(--theme-disabled-paper) !important;
    opacity: var(--theme-opacity-disabled);
}

/* ---------- 인풋 ---------- */
input {
    flex: 1 1 0;
    min-width: 1rem;
    width: 100%;
    box-sizing: border-box;
    vertical-align: middle;
    font-family: 'Normal';
    font-weight: 500;
    font-size: 1.02rem;
    line-height: 220%;
    background-clip: padding-box;
    border-radius: var(--theme-radius);
    padding: 0rem 1rem;
    user-select: none;
    color: var(--theme-ink);
    background-color: var(--theme-paper);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.05s ease;
    border: 2px solid var(--theme-paper);
    white-space: nowrap;
}

input:hover {
    background-color: var(--theme-paper);
    border: 2px solid var(--theme-color);
}

input:focus {
    background-color: var(--theme-paper);
    border: 2px solid var(--theme-color);
    outline: none;
}

input::placeholder {
    font-weight: 300;
    font-style: italic;
    opacity: 0.8;
    color: var(--theme-ink);
}

input:disabled {
    cursor: not-allowed;
    color: var(--theme-disabled-ink);
    background-color: transparent;
    border: 2px dashed var(--theme-disabled-paper);
}

input:disabled::placeholder {
    color: var(--theme-disabled-ink);
    opacity: 0;
}

/* ---------- 셀렉트 (AreDropDown) ---------- */
.input-select {
    vertical-align: middle;
    font-family: 'Normal';
    font-weight: 500;
    font-size: 1.02rem;
    line-height: 220%;
    background-clip: padding-box;
    border-radius: var(--theme-radius);
    padding: 0rem 1rem;
    padding-right: 2.2rem;
    user-select: none;
    color: var(--theme-color-ink);
    background-color: var(--theme-color);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.05s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23000" height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 2px center;
    background-size: 24px;
    border: 2px solid var(--theme-color);
}

.input-select:hover {
    background-color: var(--theme-color);
    border: 2px solid var(--theme-color-hover);
}

.input-select:active {
    background-color: var(--theme-color-active);
    border: 2px solid var(--theme-color);
}

.input-select:disabled {
    cursor: not-allowed;
    color: var(--theme-disabled-ink);
    background-color: transparent;
    border: 2px dashed var(--theme-disabled-paper);
}

.input-select option {
    color: var(--theme-ink);
    background-color: var(--theme-paper);
}

.input-select option:checked {
    background-color: var(--theme-color);
}

.input-select.critical {
    color: var(--theme-color-critical-ink);
    background-color: var(--theme-color-critical);
}

.input-select.critical:hover {
    background-color: var(--theme-color-critical-hover);
    border: 2px solid var(--theme-color-critical-active);
}

.input-select.critical option {
    color: var(--theme-ink);
    background-color: var(--theme-paper);
}

.input-select.critical option:checked {
    background-color: var(--theme-color-critical);
    color: var(--theme-color-critical-ink);
}

/* ---------- 모달 골격 (모든 모달 컴포넌트가 의존) ---------- */
.modal-overlay {
    z-index: 9998;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--theme-overlay);
}

.modal-box {
    z-index: 9999;
    border: none;
    border-radius: 1rem;
    background: var(--theme-background-popup);
    padding: 1rem;
    min-width: 15rem;
    box-shadow: 0rem 0rem 4rem var(--theme-shadow);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-box > .title {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.5;
}

.modal-box > .button-group {
    display: flex;
    justify-content: right;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- 페이지/유틸 ---------- */
.page {
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    max-width: 60rem;
    margin: 0 auto;
}

hr {
    border: none;
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        rgba(var(--theme-ink-rgb), 0.16) 0,
        rgba(var(--theme-ink-rgb), 0.16) 8px,
        transparent 8px,
        transparent 16px
    );
}

.halfline {
    height: 1rem;
}

.pr {
    padding-right: 0.5rem;
}

.pl {
    padding-left: 0.5rem;
}

.info {
    font-size: 0.9rem;
    line-height: 150%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info > div::before {
    content: '\f00c';
    font-family: 'Icon_Regular';
    padding-right: 0.5rem;
    color: rgba(var(--theme-ink-rgb), 0.3);
}

.loading-message, .no-records {
    text-align: center;
    padding: 2rem;
    color: rgba(var(--theme-ink-rgb), 0.5);
    font-size: 0.9rem;
}

.loading-indicator {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    padding-bottom: 3rem;
    color: rgba(var(--theme-ink-rgb), 0.6);
    font-size: 0.85rem;
    line-height: 1rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.loading-indicator > span {
    margin-left: 0.8rem;
    font-weight: 500;
    color: var(--theme-ink);
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--theme-divider);
    border-top: 2px solid var(--theme-ink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.disabled {
    cursor: not-allowed;
    color: var(--theme-disabled-ink);
    background: var(--theme-disabled);
}

.read {
    position: relative;
    color: var(--theme-ink);
    background: var(--theme-read);
    border: 1px solid rgba(var(--theme-ink-rgb), 0.4);
    padding: 1.2rem;
}

/* ---------- 카드형 테이블 (목록 표준) ---------- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.4rem;
    border: none;
    background: transparent;
}

table > thead {
    text-align: center;
    padding: 0.3rem 1rem;
}

table > tbody > tr {
    background: var(--theme-surface-card);
    border-radius: var(--theme-radius);
    box-shadow: var(--theme-card-shadow);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

table > tbody > tr:hover {
    background: var(--theme-surface-hover);
    box-shadow: 0 0 0 2px var(--theme-color), 0 0 1rem rgba(var(--theme-ink-rgb), 0.1);
    cursor: pointer;
}

table > tbody > tr > td {
    background: transparent;
    vertical-align: middle;
    padding: 0.2rem;
}

table > tbody > tr > td:first-child {
    border-top-left-radius: var(--theme-radius);
    border-bottom-left-radius: var(--theme-radius);
    padding-left: 1rem;
}

table > tbody > tr > td:last-child {
    border-top-right-radius: var(--theme-radius);
    border-bottom-right-radius: var(--theme-radius);
    padding-right: 1rem;
}

/* ---------- 아이콘 탭 (셸 탭 표준 — 설정 /org/manage·할당 /org/assign 등) ----------
   구조: .tab-icons > button.tab-icon(.active) > i + span (+ .tab-badge(.critical))
   2026-07-11 스코프드 CSS 중복(OrgManage/OrgAssign)에서 전역으로 승격 */
.tab-icons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tab-icon {
    position: relative;   /* 미결 배지(.tab-badge) 앵커 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--theme-radius);
    background: var(--theme-surface);
    border: 0.125rem solid transparent;
    cursor: pointer;
    user-select: none;
    min-width: 5.5rem;
    flex: 1;
    transition: all 0.15s;
}

.tab-icon:hover {
    background: var(--theme-surface-hover);
}

.tab-icon.active {
    border-color: var(--theme-color);
    background: var(--theme-selected-bg);
    font-weight: 600;
}

.tab-icon > i {
    font-size: 1.5rem;
}

.tab-icon > span {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* 탭 미결 배지 — AreIcon 배지와 같은 시각 문법 (우상단 원형, critical=빨강) */
.tab-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.35rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0.15rem;
    border-radius: 100%;
    background-color: var(--theme-color);
    color: var(--theme-ink);
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 0.5rem var(--theme-shadow-weak);
}

.tab-badge.critical {
    background-color: var(--theme-color-critical);
    color: var(--theme-dark-ink);
}

@media (max-width: 480px) {
    .tab-icon {
        min-width: 4.2rem;
        padding: 0.45rem 0.5rem;
    }
}

/* ---------- 반응형 ---------- */
@media (max-width: 480px) {
    .page {
        padding: 1rem 0rem 1rem 0rem;
        margin: 0 auto;
    }

    button {
        width: auto;
        white-space: wrap;
    }
}

/* 카드형 테이블 모바일 변신 — td에 data-label 필수 */
@media (max-width: 560px) {
    table,
    thead,
    tbody,
    th,
    tr,
    td {
        display: block;
        width: 100%;
        line-height: 1.3;
    }

    table > thead {
        display: none;
    }

    table > tbody > tr {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    table > tbody > tr > td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        border: none;
        text-align: left;
    }

    table > tbody > tr > td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(var(--theme-ink-rgb), 0.6);
        text-align: right;
        padding-right: 1rem;
        display: inline-block;
        width: 7rem;
    }

    table > tbody > tr > td:first-child {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        padding-left: 0rem;
    }

    table > tbody > tr > td:last-child {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        padding-right: 0rem;
    }
}

/* ---------- blazor 오류 바 ---------- */
#blazor-error-ui {
    background: var(--theme-color-critical);
    color: var(--theme-color-critical-ink);
    bottom: 0;
    box-shadow: 0 -1px 2px var(--theme-shadow-weak);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
