/* ═══════════════════════════════════════════════════════
   Redacto — Premium CSS
   ═══════════════════════════════════════════════════════ */

/* ─── Dark Theme (default) ──────────────────────────────── */
:root, [data-theme="dark"] {
    --bg-main: #0a0a0f;
    --bg-surface: #13131a;
    --bg-surface-hover: #1c1c27;
    --bg-elevated: #1a1a25;
    --text-primary: #ededf0;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --primary-color: #7c5cfc;
    --primary-hover: #9478ff;
    --primary-glow: rgba(124, 92, 252, 0.15);
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --danger-color: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.1);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --thumb-active: rgba(124, 92, 252, 0.25);
    --workspace-bg: #18181f;
    --card-bg: var(--bg-surface);
    --overlay-bg: rgba(0, 0, 0, 0.6);
}

/* ─── Light Theme ───────────────────────────────────────── */
[data-theme="light"] {
    --bg-main: #f4f4f8;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f0f0f5;
    --bg-elevated: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b8a;
    --text-muted: #9999b3;
    --primary-color: #6c47f0;
    --primary-hover: #7f5cf5;
    --primary-glow: rgba(108, 71, 240, 0.12);
    --success-color: #059669;
    --success-glow: rgba(5, 150, 105, 0.1);
    --danger-color: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.08);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --thumb-active: rgba(108, 71, 240, 0.15);
    --workspace-bg: #eaeaf0;
    --card-bg: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.4);
}

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.3);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */

.app-header {
    padding: 0.65rem 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    z-index: 50; transition: background 0.3s ease, border-color 0.3s ease;
}

.header-left { display: flex; flex-direction: column; gap: 2px; }

.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { display: flex; }
.logo h1 {
    font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary-color), #b794f6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tagline { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.4rem; }
.tagline-kbd { font-size: 0.55rem; padding: 1px 4px; background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-muted); }

.header-right { display: flex; align-items: center; gap: 0.4rem; }

.privacy-badge {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.65rem; font-weight: 600;
    color: var(--success-color);
    background: var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.2rem 0.55rem; border-radius: 99px;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════ */

.app-container { display: flex; flex: 1; overflow: hidden; }

/* ═══════════════════════════════════════════════════════
   TOOLBAR
   ═══════════════════════════════════════════════════════ */

.toolbar {
    width: 240px; min-width: 240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 0.75rem 0.85rem 0;
    display: flex; flex-direction: column; gap: 1rem;
    overflow-y: auto;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.tool-section { display: flex; flex-direction: column; gap: 0.4rem; }

.section-label {
    font-size: 0.58rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); padding-left: 2px;
}

.hint { font-size: 0.62rem; color: var(--text-muted); text-align: center; }
.mt-auto { margin-top: auto; }

/* ─── File Info Card ────────────────────────────────────── */

.file-info-card {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg-main); padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.file-info-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.file-name { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 0.58rem; color: var(--text-muted); }

/* ─── Tool Input ────────────────────────────────────────── */

.tool-input {
    width: 100%; padding: 0.4rem 0.6rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit; font-size: 0.72rem;
    outline: none; transition: border-color var(--transition);
}
.tool-input:focus { border-color: var(--primary-color); }
.tool-input::placeholder { color: var(--text-muted); }

/* ─── Template Chips ────────────────────────────────────── */

.template-chips { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.chip {
    padding: 0.2rem 0.5rem;
    font-family: inherit; font-size: 0.6rem; font-weight: 600;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-muted); cursor: pointer;
    transition: all var(--transition);
}
.chip:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); background: var(--primary-glow); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Toolbar Footer (Stats) ───────────────────────────── */

.toolbar-footer {
    padding: 0.6rem 0; margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.toolbar-footer span {
    font-size: 0.55rem; color: var(--text-muted); font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */

.pagination {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-main); padding: 0.3rem;
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
}

.page-badge {
    font-weight: 600; font-size: 0.75rem;
    font-variant-numeric: tabular-nums; color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════
   STYLE PICKER
   ═══════════════════════════════════════════════════════ */

.style-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; }

.style-btn {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit; font-size: 0.68rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
}
.style-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.style-btn.active { border-color: var(--primary-color); background: var(--primary-glow); color: var(--text-primary); }

.style-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.swatch-black { background: #000; }
.swatch-blur { background: linear-gradient(135deg, #888, #ccc); filter: blur(1px); }
.swatch-pixel { background: repeating-conic-gradient(#666 0% 25%, #999 0% 50%) 50%/6px 6px; }
.swatch-color { background: #ff6b6b; }

.color-picker-wrap { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.color-picker-wrap input[type="color"] {
    width: 28px; height: 22px;
    border: 1px solid var(--border-color); border-radius: 4px;
    background: none; cursor: pointer; padding: 0;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn {
    border: none; border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: inherit; font-size: 0.75rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    user-select: none; position: relative;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.btn-block { width: 100%; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.7rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6949e0);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-hover), var(--primary-color)); box-shadow: 0 4px 16px var(--primary-glow); }

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: #fff; box-shadow: 0 2px 8px var(--success-glow);
}
.btn-success:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 4px 16px var(--success-glow); }

.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { background: var(--bg-surface-hover); border-color: var(--border-hover); color: var(--text-primary); }
.btn-outline.active-toggle { border-color: var(--primary-color); background: var(--primary-glow); color: var(--primary-color); }

.btn-outline kbd {
    font-family: inherit; font-size: 0.55rem;
    background: var(--bg-main); padding: 1px 4px;
    border-radius: 3px; border: 1px solid var(--border-color);
    color: var(--text-muted); margin-left: auto;
}

.btn-danger { background: transparent; border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger-color); }
.btn-danger:hover:not(:disabled) { background: var(--danger-glow); border-color: var(--danger-color); }

.btn-icon {
    background: transparent; border: 1px solid var(--border-color);
    padding: 0.3rem 0.5rem; color: var(--text-secondary);
    border-radius: var(--radius-sm);
}
.btn-icon:hover:not(:disabled) { background: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--border-hover); }

.btn-ghost {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 0.3rem;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition); display: flex; align-items: center;
}
.btn-ghost:hover { background: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--border-hover); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* ═══════════════════════════════════════════════════════
   QUALITY SELECTOR
   ═══════════════════════════════════════════════════════ */

.quality-selector {
    display: flex; gap: 0; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border-color);
}
.quality-option {
    flex: 1; text-align: center;
    padding: 0.3rem 0; font-size: 0.65rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer;
    background: var(--bg-main); transition: all var(--transition);
    border-right: 1px solid var(--border-color);
}
.quality-option:last-child { border-right: none; }
.quality-option:hover { color: var(--text-secondary); background: var(--bg-surface-hover); }
.quality-option:has(input:checked) { background: var(--primary-glow); color: var(--primary-color); font-weight: 600; }
.quality-option input { display: none; }

/* ═══════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════ */

.progress-container { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.progress-bar { flex: 1; height: 4px; background: var(--bg-main); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary-color), var(--success-color)); border-radius: 99px; transition: width 0.3s ease; }
.progress-text { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════
   WORKSPACE AREA
   ═══════════════════════════════════════════════════════ */

.workspace-container {
    flex: 1; overflow: auto; padding: 2rem;
    display: flex; flex-direction: column; align-items: center;
    position: relative;
    background:
        radial-gradient(circle at 20% 50%, rgba(124, 92, 252, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        var(--bg-main);
    transition: background 0.3s ease;
}

.drop-zone {
    width: 100%; max-width: 500px; aspect-ratio: 4/3; margin: auto;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    transition: all 0.3s ease; cursor: pointer;
}
.drop-zone[hidden] { display: none !important; }
.drop-zone.drag-over { border-color: var(--primary-color); background: var(--primary-glow); transform: scale(1.02); box-shadow: 0 0 40px var(--primary-glow); }

.drop-zone-content {
    text-align: center; display: flex; flex-direction: column;
    align-items: center; gap: 0.75rem; color: var(--text-muted); pointer-events: none;
}
.drop-zone-content p { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.drop-zone-content span { font-size: 0.75rem; }

.workspace { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding-bottom: 4rem; }
.workspace[hidden] { display: none !important; }

/* ─── Page Wrapper ──────────────────────────────────────── */

.page-wrapper {
    position: relative;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
    flex-shrink: 0;
}
.page-wrapper.active-page { border-color: var(--primary-color); box-shadow: 0 0 20px var(--primary-glow), var(--shadow-lg); }
.page-wrapper canvas { display: block; }
.page-wrapper .page-overlay { position: absolute; top: 0; left: 0; cursor: crosshair; z-index: 10; }

.page-label {
    position: absolute; top: 0.5rem; left: 0.5rem;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    color: #fff; font-size: 0.6rem; font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 99px;
    z-index: 20; pointer-events: none;
    border: 1px solid rgba(255,255,255,0.08);
}
.page-rect-count {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: rgba(239, 68, 68, 0.85); backdrop-filter: blur(6px);
    color: #fff; font-size: 0.58rem; font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 99px;
    z-index: 20; pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   ZOOM CONTROLS
   ═══════════════════════════════════════════════════════ */

.zoom-controls {
    position: sticky; bottom: 1.25rem; left: 50%;
    transform: translateX(-50%); margin-top: -2.5rem;
    display: flex; align-items: center; gap: 0.3rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.5rem;
    border-radius: 99px; box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px); z-index: 30;
}
.zoom-badge { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); min-width: 3rem; text-align: center; font-variant-numeric: tabular-nums; }
.zoom-controls .btn-icon { padding: 0.25rem 0.45rem; border: none; }

/* ═══════════════════════════════════════════════════════
   THUMBNAILS PANEL
   ═══════════════════════════════════════════════════════ */

.thumbnails-panel {
    width: 130px; min-width: 130px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column; overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.thumbnails-panel[hidden] { display: none; }
.thumbnails-header { padding: 0.65rem 0.65rem 0.4rem; }

.thumbnails-list {
    flex: 1; overflow-y: auto;
    padding: 0 0.4rem 0.65rem;
    display: flex; flex-direction: column; gap: 0.4rem;
}

.thumb-item {
    position: relative; cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden; transition: all var(--transition); flex-shrink: 0;
}
.thumb-item:hover { border-color: var(--border-hover); }
.thumb-item.active { border-color: var(--primary-color); box-shadow: 0 0 12px var(--primary-glow); }
.thumb-item canvas { display: block; width: 100%; height: auto; border-radius: calc(var(--radius-sm) - 2px); }
.thumb-label { position: absolute; bottom: 3px; right: 3px; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.5rem; font-weight: 600; padding: 1px 4px; border-radius: 3px; }
.thumb-redaction-dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger-color); border: 1px solid rgba(0,0,0,0.3); }

/* ═══════════════════════════════════════════════════════
   COMMAND PALETTE
   ═══════════════════════════════════════════════════════ */

.cmd-palette {
    width: 90%; max-width: 480px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
    animation: fadeInUp 0.2s ease;
    margin-top: -10vh;
}

.cmd-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.cmd-header kbd { font-size: 0.55rem; margin-left: auto; flex-shrink: 0; }

.cmd-input {
    flex: 1; background: none; border: none;
    color: var(--text-primary);
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }

.cmd-list { max-height: 320px; overflow-y: auto; padding: 0.35rem; }

.cmd-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--transition);
    font-size: 0.8rem; color: var(--text-secondary);
}
.cmd-item:hover, .cmd-item.active { background: var(--primary-glow); color: var(--text-primary); }
.cmd-item kbd { font-size: 0.55rem; }
.cmd-item .cmd-cat {
    font-size: 0.55rem; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 0.05em;
    background: var(--bg-main); padding: 1px 5px; border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

.toast-container {
    position: fixed; bottom: 1.25rem; right: 1.25rem;
    z-index: 1000; display: flex; flex-direction: column; gap: 0.4rem;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.75rem; font-weight: 500;
    color: var(--text-primary);
    animation: toastIn 0.35s ease;
    backdrop-filter: blur(16px);
    max-width: 300px; pointer-events: auto;
}
.toast.toast-success { border-left: 3px solid var(--success-color); }
.toast.toast-error { border-left: 3px solid var(--danger-color); }
.toast.toast-info { border-left: 3px solid var(--primary-color); }
.toast.toast-exit { animation: toastOut 0.3s ease forwards; }

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: var(--overlay-bg); backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh;
    animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.25rem;
    width: 90%; max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.25s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-header h2 { font-size: 0.95rem; font-weight: 700; }
.modal-close { border: none !important; padding: 0.25rem !important; }
.modal-body { display: flex; flex-direction: column; gap: 0.5rem; }

.shortcut-row { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--text-secondary); }
.shortcut-row span { margin-left: auto; color: var(--text-muted); font-size: 0.7rem; }

kbd {
    font-family: 'Inter', monospace;
    font-size: 0.6rem; font-weight: 600;
    background: var(--bg-main); color: var(--text-secondary);
    padding: 2px 5px; border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 0 var(--border-color);
}

/* ═══════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════ */

.onboarding-overlay { position: fixed; inset: 0; z-index: 600; }
.onboarding-overlay[hidden] { display: none; }
.onboarding-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }

.onboarding-tooltip {
    position: absolute; z-index: 601;
    background: var(--bg-surface);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem; max-width: 280px;
    box-shadow: 0 0 30px var(--primary-glow), var(--shadow-lg);
    animation: fadeInUp 0.3s ease;
}
.onboarding-tooltip p { font-size: 0.78rem; line-height: 1.5; color: var(--text-primary); margin-bottom: 0.65rem; }
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; }
.onboarding-step { font-size: 0.62rem; color: var(--text-muted); font-weight: 500; }
.onboarding-actions { display: flex; gap: 0.35rem; }

/* ═══════════════════════════════════════════════════════
   CONFETTI
   ═══════════════════════════════════════════════════════ */

.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }

/* ═══════════════════════════════════════════════════════
   PLAN BADGE & UPGRADE MODAL
   ═══════════════════════════════════════════════════════ */

.plan-badge {
    font-family: inherit; font-size: 0.6rem; font-weight: 700;
    padding: 0.2rem 0.55rem; border-radius: 99px;
    cursor: pointer; transition: all var(--transition);
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-main); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.plan-badge:hover { border-color: var(--primary-color); color: var(--primary-color); }
.plan-badge.is-pro {
    background: linear-gradient(135deg, var(--primary-color), #6949e0);
    color: #fff; border-color: transparent;
}

.upgrade-modal { max-width: 420px; }
.upgrade-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.75rem; }

.upgrade-list {
    list-style: none; display: flex; flex-direction: column; gap: 0.4rem;
    margin-bottom: 1.25rem; padding: 0.75rem;
    background: var(--bg-main); border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.upgrade-list li {
    font-size: 0.8rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 0.4rem;
}

.upgrade-actions { margin-bottom: 1.25rem; }

.license-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.license-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.4rem; }
.license-input-group { display: flex; gap: 0.4rem; }
.license-input-group .tool-input { flex: 1; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
.license-msg { font-size: 0.68rem; margin-top: 0.35rem; min-height: 1rem; }
.license-msg.success { color: var(--success-color); }
.license-msg.error { color: var(--danger-color); }

.pro-badge-inline {
    display: inline-flex; align-items: center;
    font-size: 0.5rem; font-weight: 700;
    padding: 1px 4px; border-radius: 3px;
    background: linear-gradient(135deg, var(--primary-color), #6949e0);
    color: #fff; vertical-align: middle;
    margin-left: 0.3rem; letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════
   AUDIT PANEL
   ═══════════════════════════════════════════════════════ */

.audit-panel {
    width: 260px; min-width: 260px;
    background: var(--panel-bg); border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.audit-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-color);
}
.audit-actions { display: flex; gap: 0.25rem; }
.audit-list {
    flex: 1; overflow-y: auto; padding: 0.4rem;
}
.audit-item {
    display: flex; flex-direction: column;
    padding: 0.35rem 0.5rem; border-radius: 6px;
    margin-bottom: 0.25rem; font-size: 0.7rem;
    background: var(--bg-color); border: 1px solid var(--border-color);
}
.audit-item-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem;
}
.audit-item-action { font-weight: 600; color: var(--text-color); }
.audit-item-time { font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; }
.audit-item-detail { font-size: 0.62rem; color: var(--text-secondary); margin-top: 2px; }
.audit-item[data-type="create"] { border-left: 2px solid #22c55e; }
.audit-item[data-type="delete"] { border-left: 2px solid #ef4444; }
.audit-item[data-type="search"] { border-left: 2px solid #3b82f6; }
.audit-item[data-type="export"] { border-left: 2px solid #a855f7; }
.audit-item[data-type="load"] { border-left: 2px solid #f59e0b; }
.audit-item[data-type="template"] { border-left: 2px solid #06b6d4; }
.audit-item[data-type="ocr"] { border-left: 2px solid #ec4899; }
.audit-item[data-type="batch"] { border-left: 2px solid #f97316; }
.audit-footer {
    padding: 0.4rem 0.75rem; border-top: 1px solid var(--border-color);
    font-size: 0.65rem; color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
