:root {
    --bg-main: #0a0a0c;
    --bg-side: #121214;
    --card-bg: #1c1c1e;
    --accent: #3d8bff;
    --accent-hover: #5a9dff;
    --accent-soft: rgba(61, 139, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --border: rgba(255, 255, 255, 0.08);
    --input-bg: #222224;
    --error: #ff453a;
    --success: #32d74b;
    --sidebar-width: 300px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --glass: blur(15px) saturate(180%);
}

[data-theme='light'] {
    --bg-main: #f5f5f7;
    --bg-side: #ffffff;
    --card-bg: #ffffff;
    --accent: #007aff;
    --accent-hover: #268fff;
    --accent-soft: rgba(0, 122, 255, 0.08);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border: rgba(0, 0, 0, 0.08);
    --input-bg: #e5e5ea;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100dvh;
    width: 100vw;
    display: flex;
    overflow-x: hidden;
    overflow-y: hidden; /* 메인 앱 내부 스크롤 컨테이너가 처리 */
    touch-action: pan-x pan-y; /* 터치 스크롤 허용 */
}

body.admin-body {
    overflow-y: auto;
}

#ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.app-outer-wrapper {
    flex: 1;
    width: 100%;
    min-width: 100%;
    min-height: 100vh;
    display: flex;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    z-index: 1;
}

/* --- 사이드바 프리미엄 리모델링 --- */
.sidebar {
    width: var(--sidebar-width);
    background:
        radial-gradient(circle at top, rgba(61, 139, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(18, 18, 20, 0.96), rgba(12, 12, 15, 0.98));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh; /* 사이드바는 화면 높이 유지 */
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1000;
}


.chat-header {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
}

.logo-container img {
    width: 42px !important;
    height: 42px !important;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(61, 139, 255, 0.28));
}

.logo-container h2 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.04em !important;
}

.admin-easter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #ffd673;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-6px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.admin-easter-link.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#sidebar-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.4rem;
    font-weight: 900;
    text-align: center;
    color: var(--accent);
    margin: 15px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--accent-soft), 0 0 40px rgba(61, 139, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.btn-new-chat {
    width: calc(100% - 40px);
    margin: 10px 20px;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px var(--accent-soft);
}
.btn-new-chat:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* --- 최근 대화 목록 (Recent) 전문가 디자인 --- */
.thread-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    width: 100%;
}
.thread-list-header {
    padding: 12px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.thread-item {
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    margin-bottom: 6px;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}
.thread-item:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border); }
.thread-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-color: var(--accent-soft); }

.thread-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }

.thread-more-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
}
.thread-item:hover .thread-more-btn { opacity: 1; }
.thread-more-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }

.thread-dropdown {
    position: absolute;
    right: 16px;
    top: 50px;
    background: var(--card-bg);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    z-index: 1100;
    display: none;
    width: 160px;
    padding: 8px;
    animation: dropdownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.thread-dropdown.show { display: block; }

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
    font-weight: 600;
}
.dropdown-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent); }
.dropdown-item.delete { color: var(--error); }
.dropdown-item.delete:hover { background: rgba(255, 69, 58, 0.1); }

/* --- 사이드바 푸터 & ADMIN 버튼 격상 --- */
.sidebar-footer {
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    border-top: 1px solid var(--border);
}

.user-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-theme {
    margin-left: auto;
    flex-shrink: 0;
    background: var(--input-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#avatar-initial {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 12px var(--accent-soft);
}

#user-display {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-footer-link {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 9px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffd973, #ffb347);
    color: #241402;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 8px 22px rgba(255, 191, 72, 0.26);
    transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

.admin-footer-link.is-visible {
    display: inline-flex;
}

.admin-footer-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 191, 72, 0.34);
    filter: brightness(1.05);
}

.btn-logout {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-logout:hover { background: var(--error); color: white; border-color: var(--error); }

/* --- 관리자 페이지 고도화 --- */
.admin-body {
    justify-content: center;
    align-items: flex-start;
    background:
        radial-gradient(circle at top, rgba(61, 139, 255, 0.16), transparent 30%),
        linear-gradient(180deg, #090b10 0%, #0c1017 100%);
    padding: 36px 20px;
    min-height: 100vh;
}

.admin-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 28px;
}

.admin-card {
    width: min(1180px, 100%);
    background: rgba(16, 19, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    padding: clamp(24px, 4vw, 42px);
    backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.admin-dashboard-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.admin-dashboard-main {
    display: grid;
    gap: 22px;
}

.admin-side-panel {
    position: sticky;
    top: 24px;
}

.admin-presence-panel {
    align-items: stretch;
}

.presence-list {
    max-height: min(70vh, 780px);
    overflow: auto;
    display: grid;
    gap: 10px;
    padding-right: 6px;
}

.presence-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.presence-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.presence-item.is-online .presence-dot {
    background: #6ce7ad;
    box-shadow: 0 0 0 6px rgba(108, 231, 173, 0.14);
}

.presence-item.is-offline .presence-dot {
    background: rgba(255,255,255,0.24);
}

.presence-copy {
    display: grid;
    gap: 4px;
}

.presence-copy strong {
    font-size: 0.94rem;
}

.presence-copy span {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-header,
.admin-toolbar,
.admin-panel,
.panel-title-wrap {
    width: 100%;
}

.admin-header {
    text-align: center;
}

.admin-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    margin-bottom: 14px;
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.admin-header p,
.panel-title-wrap p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: center;
}

.admin-toolbar {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.admin-panel-highlight {
    background:
        radial-gradient(circle at top, rgba(61, 139, 255, 0.18), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
}

.panel-title-wrap h2 {
    margin: 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.admin-inline-form {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.admin-inline-form input,
.admin-row-actions input {
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 0 18px;
    font-size: 0.98rem;
    font-weight: 600;
    outline: none;
    transition: 0.25s ease;
}

.admin-inline-form input:focus,
.admin-row-actions input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(61, 139, 255, 0.14);
}

.btn-premium {
    height: 56px;
    padding: 0 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #73abff);
    color: #fff;
    font-weight: 800;
    font-size: 0.96rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 32px -16px rgba(61, 139, 255, 0.75);
    transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
}

.btn-premium:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 24px 40px -18px rgba(61, 139, 255, 0.8);
}

.btn-premium-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-premium-danger {
    background: linear-gradient(135deg, #ff5e57, #ff2d55);
    box-shadow: 0 16px 32px -16px rgba(255, 45, 85, 0.65);
}

.btn-premium-small {
    height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 0.88rem;
}

.admin-status {
    min-height: 24px;
    font-weight: 700;
    text-align: center;
}

.admin-status.is-success { color: #6ce7ad; }
.admin-status.is-error { color: #ff8f87; }

.admin-panel-table {
    align-items: stretch;
}

.admin-table-scroll {
    max-height: none;
    overflow: visible;
    border-radius: 22px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    scroll-behavior: smooth;
}

.admin-card.admin-drag-scroll {
    cursor: grab;
}

.admin-card.admin-drag-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.admin-table-scroll::-webkit-scrollbar,
.thread-list-container::-webkit-scrollbar,
body.admin-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.admin-table-scroll::-webkit-scrollbar-thumb,
.thread-list-container::-webkit-scrollbar-thumb,
body.admin-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(61,139,255,0.7), rgba(61,139,255,0.3));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(11, 14, 22, 0.95);
    backdrop-filter: blur(12px);
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    padding: 18px 16px;
}

.admin-table tbody tr {
    transition: transform 0.25s ease, background 0.25s ease;
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.admin-table tbody tr:hover {
    background: rgba(61, 139, 255, 0.09);
    transform: translateY(-1px);
}

.admin-table td {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    vertical-align: middle;
}

.cell-index {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.student-id {
    font-weight: 800;
    color: var(--text-primary);
}

.pw-display {
    display: inline-flex;
    justify-content: center;
    min-width: 100px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #9fd0ff;
    font-family: 'JetBrains Mono', monospace;
}

.admin-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

/* --- AI 대화창 전용 프리미엄 스크롤바 (macOS Style) --- */
#chat-messages::-webkit-scrollbar {
    width: 4px; /* 극도로 얇게 */
}
#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0); /* 평소에는 투명 */
    border-radius: 10px;
    transition: background 0.3s ease;
}
#chat-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); /* 호버 시에만 은은하게 */
}

/* --- 메인 레이아웃 1920x1080 및 전 해상도 반응형 최적화 --- */
.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100dvh;
    background:
        radial-gradient(circle at top right, rgba(61, 139, 255, 0.08), transparent 28%),
        linear-gradient(180deg, #08090d 0%, #05060a 100%);
    overflow: hidden;
    touch-action: pan-y; /* 터치 세로 스크롤 허용 */
}

.conversation-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    margin: 0 auto;
    min-height: 0;
    padding: 12px clamp(18px, 3vw, 28px) 22px;
}

.conversation-topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 18px;
    flex-shrink: 0;
}

.conversation-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.chip-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #32d74b;
    flex-shrink: 0;
    animation: status-pulse 2.4s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(50, 215, 75, 0); }
}

.chip-label {
    font-family: 'JetBrains Mono', 'Pretendard', monospace;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.chip-model-badge {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(61, 139, 255, 0.18);
    border-radius: 6px;
    padding: 2px 7px;
}

.logo-burst {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1200;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(122, 186, 255, 0.45), transparent 72%);
    animation: logo-burst 0.95s ease-out forwards;
    mix-blend-mode: screen;
}

#chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background:
        radial-gradient(circle at top left, rgba(61, 139, 255, 0.06), transparent 24%),
        linear-gradient(180deg, rgba(8, 9, 13, 0.98), rgba(6, 7, 10, 1));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS 관성 스크롤 */
    touch-action: pan-y; /* 터치 세로 스크롤 허용 */
    padding: 12px clamp(8px, 1.4vw, 22px) 28px;
    gap: 24px;
    min-width: 0;
    min-height: 0;
    scrollbar-width: thin;
}

.chat-empty-state {
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    min-height: 100%;
    padding: clamp(32px, 6vw, 64px);
    gap: 18px;
}

.chat-empty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #8ebdff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.22em;
}

.chat-empty-state h3 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.chat-empty-state p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.8;
}

.empty-state-orbit {
    position: relative;
    width: 108px;
    height: 108px;
}

.empty-state-orbit span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: orbit-spin 7s linear infinite;
}

.empty-state-orbit span:nth-child(2) {
    inset: 14px;
    border-color: rgba(61, 139, 255, 0.24);
    animation-direction: reverse;
    animation-duration: 5.5s;
}

.empty-state-orbit span:nth-child(3) {
    inset: 32px;
    background: radial-gradient(circle, rgba(61, 139, 255, 0.45), rgba(61, 139, 255, 0.04));
    border: none;
    animation: pulse-core 2.6s ease-in-out infinite;
}

.empty-state-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 720px;
}

.suggestion-chip {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 13px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.suggestion-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(61, 139, 255, 0.35);
    background: rgba(61, 139, 255, 0.1);
}

.message {
    width: fit-content;
    max-width: min(78%, 760px);
    padding: 18px 22px;
    border-radius: 24px;
    line-height: 1.72;
    font-size: 1rem;
    font-weight: 600;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: anywhere;
    border: 1px solid transparent;
    box-shadow: 0 22px 40px -30px rgba(0, 0, 0, 0.8);
    animation: message-rise 0.28s ease;
}

.ai-msg {
    align-self: flex-start;
    margin-right: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)),
        rgba(255, 255, 255, 0.02);
    border-color: var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 10px;
    max-width: min(72%, 780px);
}

.user-msg {
    align-self: flex-end;
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent), #78aeff);
    color: #fff;
    border-bottom-right-radius: 10px;
    box-shadow: 0 20px 36px -24px rgba(61, 139, 255, 0.95);
    max-width: min(54%, 560px);
}

.ai-thinking {
    min-width: 320px;
    max-width: min(70%, 520px);
}

.thinking-copy {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.thinking-dots {
    display: flex;
    gap: 8px;
}

.thinking-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(143, 190, 255, 0.9);
    animation: thinking-bounce 1.2s infinite ease-in-out;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes message-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-core {
    0%, 100% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes logo-burst {
    from {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.2);
    }
    to {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(2.4);
    }
}

/* --- 디지털 시계 조형미 및 애니메이션 고도화 --- */
.digital-clock-main {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 6px; /* 숫자 간격 확보 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.blink {
    animation: colon-blink 1s steps(1, end) infinite;
    margin: 0 15px; /* : 주변 공간 정밀 확보 */
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-soft);
    display: inline-block;
}

@keyframes colon-blink {
    0%, 49.9% { opacity: 1; text-shadow: 0 0 18px var(--accent-soft), 0 0 30px rgba(61,139,255,0.4); }
    50%, 100% { opacity: 0; text-shadow: none; }
}

/* --- 프리미엄 AI 텍스트 입력 영역 --- */
.chat-input-wrapper {
    padding: 14px clamp(8px, 1.4vw, 22px) 0;
    background: transparent;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.prompt-box {
    background:
        linear-gradient(180deg, rgba(34, 34, 36, 0.92), rgba(25, 25, 28, 0.94));
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.34);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 25px 70px var(--accent-soft);
    transform: translateY(-2px);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans KR', 'Pretendard', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    outline: none;
    resize: none;
    padding: 8px 0;
    line-height: 1.65;
    overflow-y: hidden;
    max-height: 160px;
    scrollbar-width: none;
    text-rendering: optimizeLegibility;
}
#chat-input::-webkit-scrollbar { width: 0; height: 0; }

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.36);
    font-family: 'IBM Plex Sans KR', 'Pretendard', sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

#send-chat-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--accent-soft);
}

#send-chat-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
}

/* --- 전 해상도 반응형 미디어 쿼리 --- */
@media (max-width: 1440px) {
    .conversation-shell { width: min(960px, 100%); }
}

@media (max-width: 1200px) {
    .conversation-shell { width: 100%; }
    .admin-dashboard-grid { grid-template-columns: 1fr; }
    .admin-side-panel {
        position: static;
        width: 100%;
    }
    .admin-presence-panel {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .admin-body {
        padding: 24px 16px;
    }
    .admin-card {
        width: 100%;
        border-radius: 28px;
        padding: 24px;
    }
    .admin-toolbar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .admin-toolbar .btn-premium {
        width: 100%;
    }
    .admin-inline-form {
        width: 100%;
    }
    .presence-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================================
   APIECE FUTURISTIC LAYER — 메인 앱 미래 효과 (26-03-17)
   ============================================================ */

/* 사이드바 시계 강화 글로우 */
#sidebar-clock {
    animation: sidebar-clock-glow 3.5s ease-in-out infinite;
}
@keyframes sidebar-clock-glow {
    0%, 100% {
        text-shadow:
            0 0 20px var(--accent-soft),
            0 0 40px rgba(61, 139, 255, 0.20);
    }
    50% {
        text-shadow:
            0 0 32px rgba(61, 139, 255, 0.55),
            0 0 70px rgba(61, 139, 255, 0.32),
            0 0 110px rgba(61, 139, 255, 0.12);
    }
}

/* 빈 상태 타이틀 그라데이션 shimmer */
.chat-empty-state h3 {
    background: linear-gradient(135deg, #ffffff 0%, #9bc8ff 40%, #ffffff 75%);
    background-size: 220%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: empty-title-shimmer 5s ease-in-out infinite;
}
@keyframes empty-title-shimmer {
    0%, 100% { background-position: 0%   50%; }
    50%       { background-position: 100% 50%; }
}

/* READY 뱃지 펄스 */
.chat-empty-badge {
    animation: badge-pulse 3s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(142, 189, 255, 0);  border-color: rgba(255,255,255,0.10); }
    50%       { box-shadow: 0 0 18px 4px rgba(61,139,255,0.14); border-color: rgba(61,139,255,0.30); }
}

/* 오비트 링 강화 글로우 */
.empty-state-orbit span:nth-child(1) {
    box-shadow: 0 0 16px rgba(61, 139, 255, 0.06) inset;
}
.empty-state-orbit span:nth-child(2) {
    box-shadow: 0 0 14px rgba(61, 139, 255, 0.12) inset;
}
.empty-state-orbit span:nth-child(3) {
    box-shadow: 0 0 24px rgba(61, 139, 255, 0.5);
}

/* 새 대화 버튼 idle pulse */
.btn-new-chat {
    animation: new-chat-glow 4s ease-in-out infinite 2s;
}
@keyframes new-chat-glow {
    0%, 100% { box-shadow: 0 8px 20px var(--accent-soft); }
    50%       { box-shadow: 0 8px 30px rgba(61, 139, 255, 0.35), 0 0 50px rgba(61, 139, 255, 0.12); }
}

/* 전송 버튼 idle pulse */
#send-chat-btn {
    animation: send-btn-pulse 3s ease-in-out infinite;
}
@keyframes send-btn-pulse {
    0%, 100% { box-shadow: 0 4px 15px var(--accent-soft); }
    50%       { box-shadow: 0 4px 28px rgba(61, 139, 255, 0.50), 0 0 50px rgba(61, 139, 255, 0.18); }
}

/* 전송 버튼 hover 시 애니메이션 일시 정지 */
#send-chat-btn:hover {
    animation-play-state: paused;
}

/* 메시지 입력창 포커스 시 강화 */
.prompt-box:focus-within {
    box-shadow:
        0 25px 70px rgba(61, 139, 255, 0.18),
        0 0 0 1px rgba(61, 139, 255, 0.35),
        0 0 60px rgba(61, 139, 255, 0.08);
}

/* AI 메시지 등장 — 좌에서 슬라이드 */
.ai-msg {
    animation: ai-msg-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ai-msg-in {
    from { opacity: 0; transform: translateX(-14px) translateY(6px); }
    to   { opacity: 1; transform: translateX(0)     translateY(0);   }
}

/* 유저 메시지 등장 — 우에서 슬라이드 */
.user-msg {
    animation: user-msg-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes user-msg-in {
    from { opacity: 0; transform: translateX(14px) translateY(6px); }
    to   { opacity: 1; transform: translateX(0)    translateY(0);   }
}

/* 사이드바 상단 로고 미세 float */
.logo-container img {
    animation: logo-float-side 5s ease-in-out infinite;
}
@keyframes logo-float-side {
    0%, 100% { filter: drop-shadow(0 8px 18px rgba(61, 139, 255, 0.28)); transform: translateY(0); }
    50%       { filter: drop-shadow(0 14px 26px rgba(61, 139, 255, 0.48)); transform: translateY(-4px); }
}

/* 대화 칩 hover glow */
.conversation-chip {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
.conversation-chip:hover {
    border-color: rgba(61, 139, 255, 0.3);
    box-shadow: 0 0 20px rgba(61, 139, 255, 0.10);
    color: #aacfff;
}

/* 스레드 아이템 active 글로우 */
.thread-item.active {
    box-shadow: 0 0 18px rgba(61, 139, 255, 0.12) inset;
}

/* 제안 칩 hover 강화 */
.suggestion-chip:hover {
    box-shadow: 0 8px 24px rgba(61, 139, 255, 0.18);
}

/* 씽킹 dots 색상 강화 */
.thinking-dots span {
    background: linear-gradient(135deg, rgba(143, 190, 255, 0.95), rgba(61, 139, 255, 0.7));
}

/* 아바타 아이덴티티 pulse */
#avatar-initial {
    animation: avatar-glow 5s ease-in-out infinite 1s;
}
@keyframes avatar-glow {
    0%, 100% { box-shadow: 0 4px 12px var(--accent-soft); }
    50%       { box-shadow: 0 4px 22px rgba(61, 139, 255, 0.40), 0 0 35px rgba(61, 139, 255, 0.16); }
}

/* 사이드바 백드롭 — 기본 숨김, 모바일에서만 활성 */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    touch-action: none;
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -300px; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1150; }
    .sidebar.active { left: 0; }
    .sidebar-backdrop.active { display: block; }
    .conversation-shell { padding: 12px 14px 16px; }
    #chat-messages { padding: 8px 4px 22px; }
    .chat-input-wrapper { padding: 10px 4px 0; }
    .chat-empty-state { padding: 28px 18px 40px; }
    .conversation-topbar { padding: 10px 0 18px; }
    .btn-back-home { left: 0; font-size: 0.78rem; padding: 7px 12px; }
    .chat-empty-state h3 { font-size: 2rem; }
    .ai-thinking { min-width: 0; max-width: 100%; }
    .message, .ai-msg, .user-msg { max-width: 100%; }
    .digital-clock-main { font-size: 3rem; letter-spacing: 2px; }
    .blink { margin: 0 8px; }
    .admin-inline-form,
    .admin-row-actions { grid-template-columns: 1fr; }
    .admin-card { padding: 20px; border-radius: 24px; }
    .admin-panel { padding: 20px; border-radius: 22px; }
    .presence-list {
        max-height: none;
        grid-template-columns: 1fr;
    }
    .admin-toolbar {
        grid-template-columns: 1fr;
    }
    .admin-table thead { display: none; }
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td { display: block; width: 100%; }
    .admin-table tbody tr {
        margin: 14px;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 18px;
        overflow: hidden;
        background: rgba(255,255,255,0.03);
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        text-align: left;
    }
    .admin-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-weight: 700;
    }
}

/* ============================================================
   일괄 비밀번호 변경 확인 모달 (Issue 7)
   ============================================================ */
.bulk-confirm-modal {
    display: none; /* hidden 속성 기본 상태 */
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
}

.bulk-confirm-modal:not([hidden]) {
    display: flex;
    animation: modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bulk-confirm-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 44px 48px;
    max-width: 460px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 48px 96px -16px rgba(0, 0, 0, 0.7);
    animation: modal-box-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-box-in {
    from { opacity: 0; transform: scale(0.9) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.bulk-confirm-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

.bulk-confirm-title {
    font-size: 1.35rem;
    font-weight: 900;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.bulk-confirm-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.bulk-confirm-desc strong {
    color: var(--error);
}

.bulk-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 어드민 페이지 마우스 휠 스크롤 커서 힌트 */
.admin-body {
    cursor: default;
}

/* ============================================================
   메인으로 돌아가기 버튼 — topbar & sidebar footer
   ============================================================ */

/* 상단 topbar 메인 버튼 */
.btn-back-home {
    position: absolute;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-family: 'Pretendard', sans-serif;
}
.btn-back-home:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateX(-3px);
}

/* 사이드바 푸터 홈 아이콘 버튼 */
.btn-home-icon {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-home-icon:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ============================================================
   라이트모드 — 하드코딩 다크값 전체 오버라이드
   ============================================================ */

/* 사이드바 배경 */
[data-theme='light'] .sidebar {
    background:
        radial-gradient(circle at top, rgba(0, 122, 255, 0.07), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 245, 247, 0.99));
}

/* 사이드바 푸터 배경 */
[data-theme='light'] .sidebar-footer {
    background: linear-gradient(to top, rgba(230, 230, 235, 0.9), transparent);
}

/* 메인 스테이지 배경 */
[data-theme='light'] .main-stage {
    background:
        radial-gradient(circle at top right, rgba(0, 122, 255, 0.05), transparent 28%),
        linear-gradient(180deg, #f5f5f7 0%, #ebebed 100%);
}

/* 채팅 메시지 영역 배경 */
[data-theme='light'] #chat-messages {
    background:
        radial-gradient(circle at top left, rgba(0, 122, 255, 0.04), transparent 24%),
        linear-gradient(180deg, rgba(248, 248, 250, 0.99), rgba(242, 242, 245, 1));
}

/* 메시지 입력창 */
[data-theme='light'] .prompt-box {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.98));
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
}

/* 입력창 placeholder */
[data-theme='light'] #chat-input::placeholder {
    color: rgba(0, 0, 0, 0.30);
}

/* AI 메시지 버블 */
[data-theme='light'] .ai-msg {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* 빈 상태 READY 뱃지 */
[data-theme='light'] .chat-empty-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 122, 255, 0.2);
    color: #0055cc;
}

/* 빈 상태 제목 shimmer — 라이트모드용 */
[data-theme='light'] .chat-empty-state h3 {
    background: linear-gradient(135deg, #1d1d1f 0%, #007aff 45%, #1d1d1f 85%);
    background-size: 220%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 제안 칩 */
[data-theme='light'] .suggestion-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme='light'] .suggestion-chip:hover {
    background: rgba(0, 122, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.12);
}

/* 대화 칩 (중앙 상단) */
[data-theme='light'] .conversation-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme='light'] .conversation-chip:hover {
    border-color: rgba(0, 122, 255, 0.3);
    color: #0055cc;
}

/* 스레드 아이템 hover */
[data-theme='light'] .thread-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme='light'] .thread-more-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

/* 스레드 드롭다운 */
[data-theme='light'] .thread-dropdown {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}
[data-theme='light'] .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* 로그아웃 버튼 */
[data-theme='light'] .btn-logout {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme='light'] .btn-logout:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* 사이드바 토글 버튼 (인라인 스타일 오버라이드) */
[data-theme='light'] #sidebar-toggle-btn {
    background: rgba(0, 0, 0, 0.06) !important;
}

/* 메인으로 버튼 라이트모드 */
[data-theme='light'] .btn-back-home {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
}

/* 사이드바 홈 아이콘 버튼 라이트모드 */
[data-theme='light'] .btn-home-icon {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.40);
}
[data-theme='light'] .btn-home-icon:hover {
    background: rgba(0, 122, 255, 0.10);
    color: #007aff;
    border-color: #007aff;
}

/* 오비트 링 라이트모드 */
[data-theme='light'] .empty-state-orbit span {
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme='light'] .empty-state-orbit span:nth-child(2) {
    border-color: rgba(0, 122, 255, 0.20);
}
[data-theme='light'] .empty-state-orbit span:nth-child(3) {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.35), rgba(0, 122, 255, 0.04));
    box-shadow: 0 0 24px rgba(0, 122, 255, 0.35);
}

/* 씽킹 dots 라이트모드 */
[data-theme='light'] .thinking-dots span {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.85), rgba(0, 80, 200, 0.6));
}

/* 사이드바 배경 백드롭 라이트모드 */
[data-theme='light'] .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.3);
}

/* AI 메시지 스크롤바 라이트모드 */
[data-theme='light'] #chat-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* ── 관리자 페이지 라이트모드 ─────────────────────────── */
[data-theme='light'] .admin-body {
    background:
        radial-gradient(circle at top, rgba(0, 122, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #f0f2f8 0%, #e8eaf2 100%);
}
[data-theme='light'] .admin-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10);
}
[data-theme='light'] .admin-panel {
    background: linear-gradient(180deg, rgba(0,0,0,0.025), rgba(0,0,0,0.015));
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] .admin-panel-highlight {
    background:
        radial-gradient(circle at top, rgba(0, 122, 255, 0.08), transparent 55%),
        linear-gradient(180deg, rgba(0,0,0,0.03), rgba(0,0,0,0.015));
}
[data-theme='light'] .admin-kicker {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme='light'] .admin-inline-form input,
[data-theme='light'] .admin-row-actions input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}
[data-theme='light'] .presence-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme='light'] .presence-item.is-offline .presence-dot {
    background: rgba(0, 0, 0, 0.20);
}

/* 테마 버튼 라이트모드 */
[data-theme='light'] .btn-theme {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
}

/* ── 사이드바 하단 위젯 ─────────────────────────── */

/* 오늘의 명언 카드 */
.sidebar-quote-card {
    position: relative;
    margin: 0 20px 10px;
    padding: 11px 36px 11px 13px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.76rem;
    line-height: 1.55;
}
.sidebar-quote-card .quote-text {
    margin: 0 0 5px;
    color: var(--text-primary);
    font-style: italic;
    opacity: 0.88;
    word-break: keep-all;
}
.sidebar-quote-card .quote-author {
    display: block;
    font-size: 0.70rem;
    color: var(--text-secondary);
    opacity: 0.65;
}
.quote-refresh-btn {
    position: absolute;
    top: 9px;
    right: 9px;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 7px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quote-refresh-btn:hover {
    background: var(--accent-soft);
    transform: rotate(180deg);
}

/* 날씨 위젯 */
.sidebar-weather {
    margin: 0 20px 10px;
    padding: 9px 13px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-weather .weather-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.sidebar-weather .weather-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.sidebar-weather .weather-temp {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
}
.sidebar-weather .weather-desc {
    font-size: 0.70rem;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 빠른 앱 실행 바 */
.sidebar-quick-apps {
    margin: 0 20px 12px;
    display: flex;
    gap: 7px;
}
.quick-app-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    min-width: 0;
}
.quick-app-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-2px);
}
[data-theme='light'] .sidebar-quote-card,
[data-theme='light'] .sidebar-weather,
[data-theme='light'] .quick-app-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}
