/* ==================== Local Fonts ==================== */
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat,Roboto/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat,Roboto/Montserrat/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
}
@font-face {
    font-family: 'Roboto';
    src: url('fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}
@font-face {
    font-family: 'Roboto';
    src: url('fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
}
@font-face {
    font-family: 'Arial Local';
    src: url('fonts/arial/ARIAL.TTF') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Arial Local';
    src: url('fonts/arial/ARIALBD.TTF') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Arial Local';
    src: url('fonts/arial/ARIALI.TTF') format('truetype');
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: 'Arial Local';
    src: url('fonts/arial/ARIALBI.TTF') format('truetype');
    font-weight: 700;
    font-style: italic;
}

/* ==================== Theme Variables ==================== */
:root {
    --bg-primary: #f0f0f2;
    --bg-secondary: #f8f8fa;
    --bg-tertiary: #e8e8ec;
    --bg-hover: #e2e2e7;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a6e;
    --text-muted: #8a8a9a;
    --border: #e0e0e5;
    --border-light: #ebebef;
    --accent: #b4a7d6;
    --accent-hover: #a394c9;
    --accent-soft: #ece8f4;
    --accent-text: #1a1a2e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --thumb-bg: #ffffff;
    --page-action-bg: #ffffff;
    --page-action-border: #ddd;
    --overlay-bg: rgba(0,0,0,0.5);
    --preview-bar-bg: #2d2b3d;
    --input-bg: #ffffff;
    --input-border: #ddd;
    --scrollbar-thumb: #c8c8d4;
    --scrollbar-hover: #a8a8b8;
    --source-panel-bg: #ffffff;
    --drop-highlight: rgba(180, 167, 214, 0.25);
}

[data-theme="dark"] {
    --bg-primary: #1e1c2e;
    --bg-secondary: #2d2b3d;
    --bg-tertiary: #3a3750;
    --bg-hover: #474462;
    --text-primary: #e8e6f0;
    --text-secondary: #b0adc0;
    --text-muted: #7a7890;
    --border: #3e3c52;
    --border-light: #343248;
    --accent: #b4a7d6;
    --accent-hover: #c5bae0;
    --accent-soft: #3a3558;
    --accent-text: #1a1a2e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);
    --thumb-bg: #2d2b3d;
    --page-action-bg: #3a3750;
    --page-action-border: #4a4860;
    --overlay-bg: rgba(0,0,0,0.7);
    --preview-bar-bg: #2d2b3d;
    --input-bg: #3a3750;
    --input-border: #4a4860;
    --scrollbar-thumb: #4a4862;
    --scrollbar-hover: #5a5878;
    --source-panel-bg: #2d2b3d;
    --drop-highlight: rgba(180, 167, 214, 0.15);
}

/* ==================== Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.25s, color 0.25s;
}

/* ==================== Sidebar ==================== */
.sidebar {
    width: 60px;
    background: #2d2b3d;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    z-index: 100;
    flex-shrink: 0;
    justify-content: space-between;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: 8px;
}

.sidebar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: #8a88a0;
    cursor: pointer;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    width: 52px;
    transition: all 0.15s;
    letter-spacing: 0.02em;
}

.sidebar-btn:hover,
.sidebar-btn.active {
    background: rgba(180, 167, 214, 0.15);
    color: #b4a7d6;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: #8a88a0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.theme-toggle:hover {
    background: rgba(180, 167, 214, 0.15);
    color: #b4a7d6;
}

/* ==================== Tool Menu ==================== */
.tool-menu {
    display: none;
    position: absolute;
    left: 68px;
    top: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    min-width: 200px;
    border: 1px solid var(--border);
}

.tool-menu.visible {
    display: block;
}

.tool-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.1s;
}

.tool-menu-item:hover {
    background: var(--bg-hover);
}

.tool-menu-item svg {
    stroke: var(--accent);
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ==================== Landing Page ==================== */
.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
}

.landing-page h1 {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.landing-page > p {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 15px;
    font-weight: 400;
}

.landing-tools {
    display: flex;
    gap: 20px;
}

.landing-tool-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    width: 200px;
    border: 1px solid var(--border-light);
}

.landing-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.landing-tool-card svg {
    stroke: var(--accent);
}

.landing-tool-card h3 {
    margin: 14px 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.landing-tool-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==================== Tool Views ==================== */
.tool-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.merge-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.merge-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ==================== Tool Header ==================== */
.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tool-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: all 0.1s;
}

.back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.done-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 8px 24px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.01em;
}

.done-btn:hover {
    background: var(--accent-hover);
}

/* ==================== Toolbar ==================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 3px;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.view-toggle-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.view-toggle-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.view-toggle-btn:nth-child(2) {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

.toolbar-separator {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 8px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.1s;
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.add-btn {
    border: 1px solid var(--border);
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ==================== Pages Container ==================== */
.pages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
}

/* ==================== Page Card ==================== */
.page-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 155px;
    cursor: grab;
    user-select: none;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background 0.1s;
}

.page-card:hover {
    background: var(--bg-hover);
}

.page-card.dragging {
    opacity: 0.35;
}

.page-card.drag-over-left::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 4px;
    bottom: 34px;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.page-card.drag-over-right::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 4px;
    bottom: 34px;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.page-card.drop-target .page-thumb-wrapper {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    background: var(--drop-highlight);
}

.page-thumb-wrapper {
    position: relative;
    width: 135px;
    height: 185px;
    background: var(--thumb-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.page-card.selected .page-thumb-wrapper {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(180, 167, 214, 0.35);
}

.page-thumb-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

.page-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.page-actions {
    position: absolute;
    top: 4px;
    left: 28px;
    right: 4px;
    display: none;
    justify-content: flex-end;
    gap: 2px;
    z-index: 5;
}

.page-card:hover .page-actions {
    display: flex;
}

.page-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-action-bg);
    border: 1px solid var(--page-action-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-secondary);
}

.page-action-btn:hover {
    background: var(--bg-hover);
}

.page-action-btn svg {
    width: 13px;
    height: 13px;
}

.page-preview-corner {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: none;
    z-index: 5;
}

.page-card:hover .page-preview-corner {
    display: flex;
}

.page-label {
    margin-top: 5px;
    text-align: center;
    max-width: 135px;
}

.page-label-name {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: white;
}

.page-label-num {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-edit-badge {
    font-size: 10px;
    line-height: 1;
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 700;
    flex-shrink: 0;
}
.page-edit-badge.unsaved {
    color: #e8a020;
    background: transparent;
}
.page-edit-badge.saved {
    color: #fff;
    background: #3a9e60;
    padding: 1px 3px;
}

/* ==================== Add Between ==================== */
.page-add-between {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    align-self: center;
    flex-shrink: 0;
}

.page-add-between button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 300;
    transition: transform 0.15s, opacity 0.15s;
    opacity: 0.6;
}

.page-add-between button:hover {
    transform: scale(1.15);
    opacity: 1;
}

/* ==================== Add File Placeholder ==================== */
.add-file-placeholder {
    width: 160px;
    height: 230px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    margin: 4px;
}

.add-file-placeholder:hover,
.add-file-placeholder.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ==================== File Card ==================== */
.file-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 175px;
    cursor: grab;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background 0.1s;
}

.file-card:hover {
    background: var(--bg-hover);
}

.file-thumb-wrapper {
    width: 155px;
    height: 205px;
    background: var(--thumb-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-label {
    margin-top: 5px;
    text-align: center;
}

.file-label-name {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: white;
}

.file-label-pages {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================== Source Panel (right) ==================== */
.source-panel {
    width: 280px;
    background: var(--source-panel-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s;
}

.source-panel.collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}

.source-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.source-panel-header h3 {
    font-size: 13px;
    font-weight: 600;
}

.source-panel-actions {
    display: flex;
    gap: 4px;
}

.source-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.1s;
}

.source-panel-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.source-panel-upload {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.source-upload-box {
    width: 100%;
    height: 60px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
}

.source-upload-box:hover,
.source-upload-box.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.source-pages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-page-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: background 0.1s;
    border: 1px solid transparent;
}

.source-page-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.source-page-item canvas {
    border-radius: 3px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.source-page-info {
    flex: 1;
    min-width: 0;
}

.source-page-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-page-num {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.source-panel-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
}

/* Toggle button in toolbar */
.source-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.1s;
}

.source-toggle-btn:hover {
    background: var(--bg-hover);
}

.source-toggle-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* ==================== Split & Extract ==================== */
.split-upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.upload-box {
    width: 100%;
    max-width: 460px;
    height: 220px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
}

.upload-box svg {
    stroke: var(--accent);
}

.upload-box:hover,
.upload-box.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.split-config {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.split-options {
    width: 280px;
    padding: 20px;
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
}

.split-options h3 {
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.split-option {
    margin-bottom: 14px;
}

.split-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.split-option input[type="radio"] {
    accent-color: var(--accent);
}

.split-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-top: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.split-input-small {
    width: 80px;
    padding: 7px 10px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-top: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.split-preview {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

/* ==================== Extract ==================== */
.extract-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.extract-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== Result View ==================== */
.result-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.result-preview {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: var(--bg-tertiary);
}

.result-preview canvas {
    box-shadow: var(--shadow-md);
    max-width: 100%;
    border-radius: 2px;
}

.result-sidebar {
    width: 320px;
    padding: 28px 20px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-shrink: 0;
}

.result-status {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.result-status h2 {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 600;
}

.result-filename {
    font-size: 12px;
    color: var(--text-primary);
    margin-top: 8px;
    word-break: break-all;
}

.result-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.download-btn:hover {
    background: var(--accent-hover);
}

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.reset-btn:hover {
    background: var(--bg-hover);
}

/* ==================== Preview Modal ==================== */
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}

.preview-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.preview-canvas {
    max-width: 100%;
    max-height: calc(90vh - 56px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    background: white;
    border-radius: 2px;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--preview-bar-bg);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.preview-nav-btn {
    background: none;
    border: none;
    color: #b0adc0;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.preview-nav-btn:hover {
    background: rgba(180, 167, 214, 0.2);
    color: white;
}

.preview-page-info {
    color: #b0adc0;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.preview-page-input {
    width: 32px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 3px;
    border-radius: 4px;
    font-size: 13px;
}

.preview-page-input::-webkit-inner-spin-button {
    display: none;
}

.preview-separator {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
}

.preview-action-btn {
    background: none;
    border: none;
    color: #b0adc0;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.preview-action-btn:hover {
    background: rgba(180, 167, 214, 0.2);
    color: white;
}

/* ==================== Extract Dropdown ==================== */
.extract-dropdown-wrap {
    position: relative;
}

.extract-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 200;
    min-width: 210px;
    overflow: hidden;
}

.extract-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}

.extract-dropdown-item:hover {
    background: var(--bg-hover);
}

/* ==================== Reorder Modal ==================== */
.reorder-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reorder-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}

.reorder-dialog {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: min(96vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.reorder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.reorder-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.reorder-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.reorder-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.reorder-hint {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 8px 20px 0;
    margin: 0;
    flex-shrink: 0;
}

.reorder-pages-grid {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 20px 24px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-height: 380px;
}

.reorder-page-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    cursor: grab;
    border-radius: var(--radius-md);
    padding: 8px;
    border: 2px solid transparent;
    background: var(--bg-secondary);
    transition: opacity 0.15s, border-color 0.1s;
    user-select: none;
}

.reorder-page-card:active {
    cursor: grabbing;
}

.reorder-page-card:hover {
    border-color: var(--border);
}

.reorder-page-card.dragging {
    opacity: 0.35;
}

.reorder-page-card.drag-over-left {
    border-left: 3px solid var(--accent);
}

.reorder-page-card.drag-over-right {
    border-right: 3px solid var(--accent);
}

.reorder-page-canvas {
    max-width: 300px;
    max-height: 420px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: block;
}

.reorder-page-label {
    margin-top: 7px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reorder-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.reorder-filename-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    margin-right: 8px;
}

.reorder-filename-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.reorder-filename-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
}

.reorder-filename-input:focus {
    outline: none;
    border-color: var(--accent);
}

.reorder-filename-ext {
    font-size: 12px;
    color: var(--text-muted);
}

.rename-individual-dialog {
    max-width: 520px;
    width: min(92vw, 520px);
}

.rename-individual-list {
    padding: 12px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rename-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rename-row-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rename-row-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
}

.rename-row-input:focus {
    outline: none;
    border-color: var(--accent);
}

.rename-row-ext {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== Document Colors ==================== */
.doc-color-0 { background: #e8a0bf; }
.doc-color-1 { background: #c4b5fd; }
.doc-color-2 { background: #93c5fd; }
.doc-color-3 { background: #86efac; }
.doc-color-4 { background: #fcd34d; }
.doc-color-5 { background: #fdba74; }
.doc-color-6 { background: #a5b4fc; }
.doc-color-7 { background: #5eead4; }

/* ==================== Source Popover ==================== */
.source-popover {
    position: absolute;
    right: 290px;
    z-index: 300;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    width: 400px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.source-popover::after {
    content: '';
    position: absolute;
    right: -8px;
    top: var(--arrow-top, 40px);
    width: 14px;
    height: 14px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(-45deg);
    z-index: -1;
}

.source-popover canvas {
    max-width: 100%;
    max-height: 500px;
    border-radius: 4px;
}

.source-popover-info {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.source-page-item.active {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.source-page-loupe {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    color: var(--text-muted);
}

.source-page-item:hover .source-page-loupe {
    opacity: 1;
}

.source-page-loupe:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ==================== Split Visual Mode ==================== */
.split-visual-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.split-visual-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.split-visual-page canvas {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--thumb-bg);
}

.split-visual-page-num {
    font-size: 11px;
    color: var(--text-muted);
    margin: 4px 0;
}

.split-divider {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    cursor: pointer;
    position: relative;
    min-height: 28px;
}

.split-divider-line {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.15s, height 0.15s;
}

.split-divider:hover .split-divider-line {
    background: var(--accent);
    height: 3px;
}

.split-divider.active .split-divider-line {
    background: #ef4444;
    height: 3px;
}

.split-divider.active::after {
    content: '✂';
    position: absolute;
    right: -24px;
    font-size: 14px;
    color: #ef4444;
}

.split-divider:hover::before {
    content: 'Hier teilen';
    position: absolute;
    top: -16px;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.split-divider.active:hover::before {
    content: 'Teilung entfernen';
    color: #ef4444;
}

/* ==================== Extract Buttons ==================== */
.extract-buttons {
    display: flex;
    gap: 8px;
}

.done-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.done-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

/* ==================== Editor ==================== */
.editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.editor-overlay > .editor-topbar {
    position: relative;
    z-index: 11;
}

.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

.editor-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-tool-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
}

.editor-tool-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.12s;
}

.editor-tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.editor-tool-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.editor-color-input {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: none;
}

.editor-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.editor-color-input::-webkit-color-swatch { border: none; border-radius: 3px; }

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-zoom-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    user-select: none;
}

.editor-save-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-md);
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.editor-save-btn:hover { background: var(--accent-hover); }

.editor-cancel-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.12s;
}

.editor-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Shape menu */
.editor-shape-menu {
    position: absolute;
    top: 47px;
    left: 0;
    right: 0;
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.editor-shape-menu button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.12s;
}

.editor-shape-menu button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.editor-shape-menu button.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Text options bar */
.editor-text-options {
    position: absolute;
    top: 47px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.editor-text-select {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 110px;
}

.editor-text-num {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text-primary);
    width: 60px;
    text-align: center;
}

.editor-text-num::-webkit-inner-spin-button { opacity: 1; }

/* Workspace */
.editor-workspace {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: var(--bg-tertiary);
}

.editor-canvas-container {
    position: relative;
    box-shadow: var(--shadow-lg);
    cursor: default;
}

.editor-canvas-container.cursor-text { cursor: text; }
.editor-canvas-container.cursor-crosshair { cursor: crosshair; }
.editor-canvas-container.cursor-eyedropper { cursor: crosshair; }

.editor-canvas-container canvas {
    display: block;
}

.editor-elements-layer {
    position: absolute;
    top: 0;
    left: 0;
}

/* Editor Elements */
.editor-element {
    position: absolute;
    cursor: move;
    border-style: solid;
    border-color: transparent;
    border-width: calc(1px * var(--inv-zoom, 1));
    box-sizing: border-box;
}

.editor-element:hover {
    border-color: var(--accent);
}

.editor-element.selected {
    border-color: var(--accent);
    outline-style: dashed;
    outline-color: var(--accent);
    outline-width: calc(1px * var(--inv-zoom, 1));
    outline-offset: calc(2px * var(--inv-zoom, 1));
}

.editor-element img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    display: block;
}

.editor-text-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    line-height: 1.2;
    padding: 2px;
    margin: 0;
    box-sizing: border-box;
    cursor: text;
}

.editor-text-display {
    width: 100%;
    height: 100%;
    line-height: 1.2;
    padding: 2px;
    box-sizing: border-box;
    pointer-events: none;
    white-space: pre;
    overflow: visible;
    user-select: none;
}

.editor-element svg {
    pointer-events: none;
}

/* Resize handles */
.editor-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: 2px;
    box-sizing: border-box;
}

.editor-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.editor-handle.n  { top: -4px; left: calc(50% - 4px); cursor: n-resize; }
.editor-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.editor-handle.e  { top: calc(50% - 4px); right: -4px; cursor: e-resize; }
.editor-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.editor-handle.s  { bottom: -4px; left: calc(50% - 4px); cursor: s-resize; }
.editor-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.editor-handle.w  { top: calc(50% - 4px); left: -4px; cursor: w-resize; }

/* Draw preview */
.editor-draw-preview {
    position: absolute;
    pointer-events: none;
    box-sizing: border-box;
}

/* Screenshot selection */
.editor-screenshot-sel {
    position: absolute;
    background: rgba(180, 167, 214, 0.2);
    border: 2px dashed var(--accent);
    pointer-events: none;
    box-sizing: border-box;
}

/* ==================== Auth Overlay ==================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.auth-logo {
    margin-bottom: 8px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    margin: 4px 0 16px;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.google-signin-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.auth-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-icon-wrap.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
}

.auth-icon-wrap.denied {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.auth-signout-btn {
    margin-top: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 20px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.auth-signout-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.auth-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Admin Panel ==================== */
.sidebar-admin-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: all 0.15s;
}

.sidebar-admin-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.admin-badge-icon {
    position: absolute;
    bottom: 6px;
    right: 6px;
    color: var(--accent);
}

.admin-panel {
    position: fixed;
    left: 64px;
    bottom: 0;
    width: 360px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-panel.open {
    transform: translateY(0);
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.admin-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.admin-header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-header-email {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.admin-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-panel-title {
    padding: 12px 18px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.admin-user-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.admin-section-title {
    padding: 8px 18px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    transition: background 0.1s;
}

.admin-user-row:hover {
    background: var(--bg-hover);
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    flex-shrink: 0;
}

.admin-status-pending  { background: rgba(251,191,36,0.15); color: #f59e0b; }
.admin-status-approved { background: rgba(34,197,94,0.15);  color: #22c55e; }
.admin-status-denied   { background: rgba(239,68,68,0.15);  color: #ef4444; }

.admin-user-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.admin-action-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--text-muted);
}

.admin-action-btn.approve:hover { background: rgba(34,197,94,0.15);  border-color: #22c55e; color: #22c55e; }
.admin-action-btn.deny:hover    { background: rgba(239,68,68,0.15);  border-color: #ef4444; color: #ef4444; }

.admin-loading, .admin-empty {
    padding: 20px 18px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.admin-panel-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
}

.admin-signout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.admin-signout-btn:hover {
    background: rgba(239,68,68,0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}
