@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Dark Theme (Default) */
    --bg: #0f111a;
    --card: #181b2a;
    --input-bg: #141622;
    --border: rgba(255, 255, 255, 0.05);
    --border-strong: rgba(255, 255, 255, 0.12);
    --accent: #ffffff;
    --text-high: #f1f5f9;
    --text-mid: #94a3b8;
    --text-low: #64748b;
    --sidebar-bg: #0b0d14;
    --sidebar-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --success: #10b981;
    --error: #ef4444;
    --sidebar-w: 240px;
}

body.light {
    /* Light Theme */
    --bg: #f8fafc;
    --card: #ffffff;
    --input-bg: #ebedf2;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --accent: #0f172a;
    --text-high: #1e293b;
    --text-mid: #475569;
    --text-low: #94a3b8;
    --sidebar-bg: #ffffff;
    --sidebar-border: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-high);
    font-size: 13px;
    line-height: 1.5;
}

/* Subtle Light Leak */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.3), transparent);
    z-index: 999;
}

/* Sophisticated Background Mesh */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 가장 뒤로 이동 */
    overflow: hidden;
    pointer-events: none;
}

.bg-blobs::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--primary-rgb), 0.03) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%);
    filter: blur(100px);
    animation: meshRotate 120s infinite linear;
    opacity: 1;
}

body.light .bg-blobs::before {
    opacity: 0.4;
    background-image:
        radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%);
}

/* Subtle Grain Overlay */
.bg-blobs::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    mix-blend-mode: overlay;
}

#app {
    position: relative;
    z-index: 1;
    /* 콘텐츠가 위로 오도록 */
}

@keyframes meshRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* Layout Structure */
.screen {
    display: none;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* Login - Hyper Minimal */
#login-screen {
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 400px;
    padding: 2.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card.setup-mode {
    width: 800px;
}

.login-flex-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.login-main-pane {
    flex: 1;
}

.otp-side-pane {
    flex: 1;
    text-align: center;
    padding-left: 2rem;
    border-left: 1px solid var(--border);
    animation: fadeIn 0.5s ease-out;
}

.qr-wrapper {
    background: white;
    padding: 12px;
    display: inline-block;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-wrapper img {
    width: 160px;
    height: 160px;
    display: block;
}

@media (min-width: 768px) {
    .login-card.setup-mode .login-flex-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

@media (max-width: 767px) {
    .login-card.setup-mode {
        width: 100%;
        max-width: 400px;
        margin: 1rem;
    }

    .otp-side-pane {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: 2rem;
    }
}

.switch-auth {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 13px;
    color: var(--text-mid);
}

.switch-auth a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: filter 0.2s;
}

.switch-auth a:hover {
    filter: brightness(1.2);
    text-decoration: underline;
}

.copyright {
    margin-top: 3rem;
    text-align: center;
    font-size: 11px;
    color: var(--text-low);
    opacity: 0.5;
    letter-spacing: 0.02em;
}

.login-card h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* Forms */
.input-field-group {
    margin-bottom: 1.5rem;
}

.otp-inputs-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.otp-input {
    flex: 1;
    max-width: 48px;
    min-width: 0;
    height: 52px;
    border: 1.5px solid var(--border);
    background: var(--input-bg);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .otp-inputs-container {
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .otp-inputs-container {
        gap: 4px;
    }
}

.otp-input:focus {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
    outline: none;
    transform: translateY(-2px);
}

.input-field-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-mid);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

input,
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    color: var(--text-high);
    font-family: inherit;
    font-size: 13.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 2.2rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px !important;
    background-color: var(--input-bg) !important;
}

body.light select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233a3a3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

#auto-topic {
    min-height: 320px;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-mid);
    opacity: 0.5;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--input-bg);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

/* Browser Autofill Overrides - 눈부심 방지 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-high) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.otp-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.otp-digit {
    flex: 1;
    max-width: 48px;
    min-width: 0;
    height: 52px;
    padding: 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 6px;
}

@media (max-width: 480px) {
    .otp-inputs {
        gap: 0.5rem;
    }
}

@media (max-width: 360px) {
    .otp-inputs {
        gap: 4px;
    }
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.65rem;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary.btn-success {
    background: #059669 !important;
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.3);
}

.login-submit-btn {
    margin-top: 1rem;
}

.btn-secondary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
}

/* Main Screen */
.sidebar {
    width: var(--sidebar-w);
    border-right: 1px solid var(--sidebar-border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
}

.nav-header {
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.03em;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 0.75rem;
    border-radius: 4px;
    color: var(--text-mid);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.nav-item i {
    font-size: 16px;
}

.nav-item:hover {
    color: var(--text-high);
    background: rgba(var(--primary-rgb), 0.05);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: 700;
}

body.light .nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.light .nav-item.active {
    background: rgba(var(--primary-rgb), 0.08);
}

/* Content Area */
/* Content Management */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.glass-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 64px;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    /* 이 영역이 스크롤되므로 스크롤바가 화면 우측 끝에 붙습니다. */
    padding: 3rem 0;
}

.inner-content-area {
    max-width: 1200px;
    /* 기존보다 약간 넓게 조정 가능 */
    margin: 0 auto;
    padding: 0 4rem;
}

.page-header {
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--text-mid);
    font-size: 13px;
    margin-top: 0.25rem;
}

/* Stats Tiles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(165deg, var(--card), #131726);
    /* Default Dark Gradient */
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light .stat-card {
    background: var(--card);
    /* Pure white in light mode */
    border-color: rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 13px;
    /* 11px -> 13px 상향 */
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    /* 가시성 향상을 위해 불투명도 조절 */
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-high);
    letter-spacing: -0.03em;
    line-height: 1;
}

#stat-status {
    font-size: 1.35rem;
}

.stat-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.stat-unit {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.stat-sub {
    display: flex;
    gap: 1.5rem;
    font-size: 13px;
    font-weight: 600;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Dashboard Actions */
.action-box {
    padding: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

body.dark .action-box {
    background: linear-gradient(165deg, var(--card), #131726);
}

.action-box:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2);
}

.action-box::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 160px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14.71L12.73 3 11 9.41 20 9.29 11.27 21 13 14.59 4 14.71z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.05;
    pointer-events: none;
    filter: blur(1px);
}

.action-box::before {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.btn-group .btn-primary {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Data Table - Clean Minimal */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

/* Responsive Table Wrapper */
.list-container, .table-container {
    width: 100%;
    position: relative;
    border-radius: 8px;
}

@media (max-width: 1024px) {
    .list-container, .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
        margin-bottom: 0;
    }

    .data-table {
        min-width: 850px; /* Ensure all columns are readable */
        table-layout: auto !important;
    }
    
    .data-table th, .data-table td {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
}

/* Custom Scrollbar for Table Wrappers */
.list-container::-webkit-scrollbar, 
.table-container::-webkit-scrollbar {
    height: 6px;
}

.list-container::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.list-container::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 10px;
}

.list-container::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.4);
}

.data-table th {
    text-align: left;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--text-mid);
    text-transform: uppercase;
    font-weight: 700;
}

.data-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-mid);
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 0;
}

.data-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.03);
    color: var(--text-high);
}


.pagination-info {
    white-space: pre !important;
    /* 연속된 공백 유지 */
}

/* Indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    /* 표준 크기로 통일 */
    white-space: nowrap;
    /* 배지 줄바꿈 방지 */
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-success {
    color: var(--success);
}

.status-success::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-failed {
    color: var(--error);
}

.status-failed::before {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

/* Switch Style */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #262626;
    transition: .2s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Toggle Card Layout */
.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-strong);
    transition: all 0.3s ease;
    margin-bottom: 0;
    gap: 1.5rem;
}

.toggle-card-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.toggle-card-icon {
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05); /* Default */
    color: var(--text-high);
    flex-shrink: 0;
}

.toggle-card-info {
    flex: 1;
    min-width: 0;
}

.toggle-card-info label {
    margin-bottom: 0.2rem !important;
    display: block;
    font-weight: 700;
    text-transform: none !important;
    font-size: 13px;
    color: var(--text-high);
}

.toggle-card-info span {
    font-size: 0.75rem;
    color: var(--text-mid);
    line-height: 1.4;
    display: block;
}

@media (max-width: 768px) {
    .toggle-card {
        padding: 1.25rem;
        gap: 1rem;
        align-items: flex-start; /* Switch stays at top with title on mobile */
    }
    
    .toggle-card-body {
        gap: 0.75rem;
    }
    
    .toggle-card-icon {
        padding: 0.6rem;
    }
    
    .toggle-card-icon i {
        width: 18px !important;
        height: 18px !important;
    }
    
    .toggle-card .switch {
        margin-top: 4px; /* Sync switch vertical position with title text */
    }
}

/* Automation Activation States */
.auto-card-active {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.05) !important;
}

.auto-card-inactive {
    border-color: var(--error) !important;
    background: rgba(239, 68, 68, 0.04) !important;
}

.auto-icon-active {
    color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.1) !important;
}

.auto-icon-inactive {
    color: var(--error) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #fff;
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* Pagination */
.paging {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* 우측 정렬 */
    gap: 1rem;
    margin-top: 2rem;
}

.paging-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-mid);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.paging-btn:hover:not(:disabled) {
    border-color: var(--text-high);
    color: var(--text-high);
}

/* Utility */
#otp-qr-container img {
    display: block;
    mix-blend-mode: multiply;
}

body.light #otp-qr-container {
    background: #f0f0f0;
}

.text-error {
    color: var(--error) !important;
}

.text-center {
    text-align: center;
}

.text-truncate {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-error {
    color: var(--error) !important;
}

.t-success {
    color: var(--success) !important;
}

.btn-icon {
    background: none;
    border: none;
    outline: none;
    color: var(--text-mid);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--text-high);
    opacity: 0.8;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    color: var(--text-high);
    border: 1px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Sidebar & Layout --- */
@media (max-width: 1024px) {
    #hamburger-btn {
        display: flex !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1001;
        /* Layer above overlay */
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--sidebar-bg);
        width: var(--sidebar-w);
        border-right: 1px solid var(--sidebar-border);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 80px rgba(0, 0, 0, 0.6);
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .inner-content-area {
        padding: 0 1.25rem;
    }

    .top-bar {
        padding: 0 1.25rem;
    }
}

/* Mobile: Grid Stack */
@media (max-width: 1024px) {
    .settings-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .settings-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .page-header {
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .glass-card {
        padding: 1rem !important;
    }

    .inner-content-area {
        padding: 0 1rem;
    }
}

/* Settings Grid Default */
.settings-layout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}