:root {
    /* Color Palette - Clear Modern */
    --r07-app-ui-font: 'Inter', sans-serif;
    --bg-main: #f3f6fb;
    --bg-sidebar: rgba(255, 255, 255, 0.9);
    --bg-card: #ffffff;
    --accent-primary: #3b82f6;
    --accent-primary-rgb: 59, 130, 246;
    --accent-glow: rgba(59, 130, 246, 0.18);
    --accent-secondary: #f59e0b;
    --accent-hover: #2563eb;
    --text-main: #425466;
    --text-bright: #102033;
    --text-dim: #7d8fa4;
    --text-secondary: #7d8fa4;
    --border-color: rgba(148, 163, 184, 0.18);
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(148, 163, 184, 0.18);
    --paper-preview-bg: #fffdf7;
    --preview-stage-bg: #dbe5f0;
    --editor-tool-panel-width: 360px;

    /* Spacing & Borders */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-main: 0 20px 40px rgba(148, 163, 184, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--r07-app-ui-font);
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

body[data-ui-theme-family="dark"],
body[data-ui-theme-family="wood"],
body[data-ui-theme-family="glass"] {
    color-scheme: dark;
}

body[data-ui-theme-family="light"] {
    color-scheme: light;
}

body[data-ui-theme-family="dark"] select,
body[data-ui-theme-family="wood"] select,
body[data-ui-theme-family="glass"] select,
body[data-ui-theme-family="dark"] .printer-quick-select,
body[data-ui-theme-family="wood"] .printer-quick-select,
body[data-ui-theme-family="glass"] .printer-quick-select {
    color-scheme: dark;
}

body[data-ui-theme-family="light"] select,
body[data-ui-theme-family="light"] .printer-quick-select {
    color-scheme: light;
}

body[data-ui-theme="classic"] .sidebar,
body[data-ui-theme="classic"] .glass,
body[data-ui-theme="classic"] .top-bar,
body[data-ui-theme="classic"] .toolset,
body[data-ui-theme="classic"] .properties-panel {
    backdrop-filter: blur(10px);
}

body[data-ui-theme="classic"] .logo-icon,
body[data-ui-theme="classic"] .pro-badge,
body[data-ui-theme="classic"] .btn-primary,
body[data-ui-theme="classic"] .btn-glow {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

body[data-ui-theme="light"] .sidebar,
body[data-ui-theme="light"] .toolset,
body[data-ui-theme="light"] .top-bar,
body[data-ui-theme="light"] .properties-panel,
body[data-ui-theme="light"] .glass,
body[data-ui-theme="paper"] .sidebar,
body[data-ui-theme="paper"] .toolset,
body[data-ui-theme="paper"] .top-bar,
body[data-ui-theme="paper"] .properties-panel,
body[data-ui-theme="paper"] .glass {
    background: color-mix(in srgb, var(--glass-bg) 92%, white 8%);
    border-color: rgba(var(--accent-primary-rgb), 0.12);
}

body[data-ui-theme="light"] .logo-icon,
body[data-ui-theme="paper"] .logo-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
}

body[data-ui-theme="paper"] .logo-icon,
body[data-ui-theme="paper"] .pro-badge,
body[data-ui-theme="paper"] .btn-primary,
body[data-ui-theme="paper"] .btn-glow {
    background: linear-gradient(135deg, #b7791f, #f6ad55);
}

body[data-ui-theme="light"] .logo-container,
body[data-ui-theme="paper"] .logo-container {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--bg-card) 92%, white 8%)),
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb), 0.1), transparent 55%);
    border-color: rgba(var(--accent-primary-rgb), 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body[data-ui-theme="light"] .logo-eyebrow,
body[data-ui-theme="light"] .logo-channel,
body[data-ui-theme="paper"] .logo-eyebrow,
body[data-ui-theme="paper"] .logo-channel {
    color: var(--text-dim);
}

body[data-ui-theme="light"] .logo-text h1,
body[data-ui-theme="paper"] .logo-text h1 {
    color: var(--text-bright);
}

body[data-ui-theme="light"] .logo-banner,
body[data-ui-theme="paper"] .logo-banner {
    filter: none;
}

body[data-ui-theme="light"] .nav-links a,
body[data-ui-theme="light"] .btn-icon,
body[data-ui-theme="light"] .btn-icon-sm,
body[data-ui-theme="light"] .toolset h3,
body[data-ui-theme="paper"] .nav-links a,
body[data-ui-theme="paper"] .btn-icon,
body[data-ui-theme="paper"] .btn-icon-sm,
body[data-ui-theme="paper"] .toolset h3 {
    color: var(--text-dim);
}

body[data-ui-theme="light"] .nav-links li.active a,
body[data-ui-theme="light"] .nav-links a:hover,
body[data-ui-theme="paper"] .nav-links li.active a,
body[data-ui-theme="paper"] .nav-links a:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.1);
    color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-bright) 28%);
}

body[data-ui-theme="light"] .nav-links li.active a,
body[data-ui-theme="paper"] .nav-links li.active a {
    color: var(--accent-primary);
}

body[data-ui-theme="light"] .tool-btn,
body[data-ui-theme="paper"] .tool-btn {
    background-color: rgba(var(--accent-primary-rgb), 0.06);
    border-color: rgba(var(--accent-primary-rgb), 0.14);
    color: var(--text-main);
}

body[data-ui-theme="light"] .tool-btn i,
body[data-ui-theme="paper"] .tool-btn i {
    color: var(--accent-primary);
}

body[data-ui-theme="light"] .tool-btn span,
body[data-ui-theme="paper"] .tool-btn span {
    color: var(--text-main);
    font-weight: 600;
}

body[data-ui-theme="light"] .tool-btn:hover,
body[data-ui-theme="paper"] .tool-btn:hover {
    background-color: rgba(var(--accent-primary-rgb), 0.12);
    color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-bright) 28%);
}

body[data-ui-theme="light"] .btn-icon:hover,
body[data-ui-theme="light"] .btn-icon-sm:hover,
body[data-ui-theme="paper"] .btn-icon:hover,
body[data-ui-theme="paper"] .btn-icon-sm:hover {
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-primary);
    border-color: rgba(var(--accent-primary-rgb), 0.2);
}

body[data-ui-theme="light"] .search-container,
body[data-ui-theme="paper"] .search-container {
    background-color: rgba(var(--accent-primary-rgb), 0.05);
    border-color: rgba(var(--accent-primary-rgb), 0.08);
}

body[data-ui-theme-family="light"] .setting-item,
body[data-ui-theme-family="light"] .company-logo-box,
body[data-ui-theme-family="light"] .company-mascot-box,
body[data-ui-theme-family="light"] .printer-status-chip,
body[data-ui-theme-family="light"] .printer-status-checklist-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.9)),
        rgba(255, 255, 255, 0.86);
    border-color: rgba(var(--accent-primary-rgb), 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        0 10px 22px rgba(100, 116, 139, 0.08);
}

body[data-ui-theme-family="light"] .setting-item label,
body[data-ui-theme-family="light"] .toolset h3 {
    color: var(--text-bright);
}

body[data-ui-theme-family="light"] .setting-item select,
body[data-ui-theme-family="light"] .setting-item input[type="text"],
body[data-ui-theme-family="light"] .setting-item input[type="password"],
body[data-ui-theme-family="light"] .setting-item input[type="number"],
body[data-ui-theme-family="light"] .setting-item textarea,
body[data-ui-theme-family="light"] .font-picker-inline select,
body[data-ui-theme-family="light"] .a4-controls .setting-item select,
body[data-ui-theme-family="light"] .a4-controls .setting-item input[type="number"],
body[data-ui-theme-family="light"] .a4-controls .setting-item input[type="range"],
body[data-ui-theme-family="light"] .printer-quick-select,
body[data-ui-theme-family="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(var(--accent-primary-rgb), 0.18);
    color: var(--text-bright);
}

body[data-ui-theme-family="light"] .setting-item input[type="text"]::placeholder,
body[data-ui-theme-family="light"] .setting-item input[type="password"]::placeholder,
body[data-ui-theme-family="light"] .setting-item input[type="number"]::placeholder,
body[data-ui-theme-family="light"] .setting-item textarea::placeholder,
body[data-ui-theme-family="light"] .search-container input::placeholder {
    color: rgba(82, 95, 110, 0.88);
}

body[data-ui-theme-family="light"] .setting-item select option,
body[data-ui-theme-family="light"] .font-picker-inline select option,
body[data-ui-theme-family="light"] .a4-controls .setting-item select option,
body[data-ui-theme-family="light"] .printer-quick-select option {
    background: #f8fafc;
    color: #1f2937;
}

body[data-ui-theme-family="light"] .setting-item select optgroup,
body[data-ui-theme-family="light"] .font-picker-inline select optgroup,
body[data-ui-theme-family="light"] .a4-controls .setting-item select optgroup,
body[data-ui-theme-family="light"] .printer-quick-select optgroup {
    background: #eef2f7;
    color: #334155;
    font-weight: 700;
}

body[data-ui-theme-family="dark"] .setting-item select,
body[data-ui-theme-family="wood"] .setting-item select,
body[data-ui-theme-family="glass"] .setting-item select,
body[data-ui-theme-family="dark"] .font-picker-inline select,
body[data-ui-theme-family="wood"] .font-picker-inline select,
body[data-ui-theme-family="glass"] .font-picker-inline select,
body[data-ui-theme-family="dark"] .a4-controls .setting-item select,
body[data-ui-theme-family="wood"] .a4-controls .setting-item select,
body[data-ui-theme-family="glass"] .a4-controls .setting-item select,
body[data-ui-theme-family="dark"] .printer-quick-select,
body[data-ui-theme-family="wood"] .printer-quick-select,
body[data-ui-theme-family="glass"] .printer-quick-select {
    background: rgba(16, 22, 34, 0.94);
    border-color: rgba(var(--accent-primary-rgb), 0.2);
    color: var(--text-main);
}

body[data-ui-theme-family="dark"] .setting-item select option,
body[data-ui-theme-family="wood"] .setting-item select option,
body[data-ui-theme-family="glass"] .setting-item select option,
body[data-ui-theme-family="dark"] .font-picker-inline select option,
body[data-ui-theme-family="wood"] .font-picker-inline select option,
body[data-ui-theme-family="glass"] .font-picker-inline select option,
body[data-ui-theme-family="dark"] .a4-controls .setting-item select option,
body[data-ui-theme-family="wood"] .a4-controls .setting-item select option,
body[data-ui-theme-family="glass"] .a4-controls .setting-item select option,
body[data-ui-theme-family="dark"] .printer-quick-select option,
body[data-ui-theme-family="wood"] .printer-quick-select option,
body[data-ui-theme-family="glass"] .printer-quick-select option {
    background: #161b26;
    color: #e6edf3;
}

body[data-ui-theme-family="dark"] .setting-item select optgroup,
body[data-ui-theme-family="wood"] .setting-item select optgroup,
body[data-ui-theme-family="glass"] .setting-item select optgroup,
body[data-ui-theme-family="dark"] .font-picker-inline select optgroup,
body[data-ui-theme-family="wood"] .font-picker-inline select optgroup,
body[data-ui-theme-family="glass"] .font-picker-inline select optgroup,
body[data-ui-theme-family="dark"] .a4-controls .setting-item select optgroup,
body[data-ui-theme-family="wood"] .a4-controls .setting-item select optgroup,
body[data-ui-theme-family="glass"] .a4-controls .setting-item select optgroup,
body[data-ui-theme-family="dark"] .printer-quick-select optgroup,
body[data-ui-theme-family="wood"] .printer-quick-select optgroup,
body[data-ui-theme-family="glass"] .printer-quick-select optgroup {
    background: #0f141f;
    color: #f4efe4;
    font-weight: 700;
}

body[data-ui-theme-family="light"] .company-logo-preview,
body[data-ui-theme-family="light"] .company-mascot-preview {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(var(--accent-primary-rgb), 0.16);
}

body[data-ui-theme-family="light"] .company-logo-preview span,
body[data-ui-theme-family="light"] .company-mascot-preview span,
body[data-ui-theme-family="light"] .setting-item p,
body[data-ui-theme-family="light"] .printer-assistant-copy {
    color: var(--text-main);
}

body[data-ui-theme-family="light"] .printer-status-chip span,
body[data-ui-theme-family="light"] .printer-status-checklist-item {
    color: var(--text-main);
}

body[data-ui-theme-family="light"] .printer-status-checklist-item i {
    color: var(--accent-primary);
}

body[data-ui-theme="wood"]::before,
body[data-ui-theme="walnut"]::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(6deg,
            rgba(255, 214, 160, 0.035) 0px,
            rgba(255, 214, 160, 0.035) 2px,
            rgba(66, 39, 19, 0.02) 2px,
            rgba(66, 39, 19, 0.02) 11px);
    opacity: 0.8;
    z-index: 0;
}

body[data-ui-theme="wood"] .app-container,
body[data-ui-theme="walnut"] .app-container {
    position: relative;
    z-index: 1;
}

body[data-ui-theme="wood"] .sidebar,
body[data-ui-theme="wood"] .top-bar,
body[data-ui-theme="wood"] .toolset,
body[data-ui-theme="wood"] .properties-panel,
body[data-ui-theme="wood"] .settings-card,
body[data-ui-theme="wood"] .ganging-sidebar,
body[data-ui-theme="walnut"] .sidebar,
body[data-ui-theme="walnut"] .top-bar,
body[data-ui-theme="walnut"] .toolset,
body[data-ui-theme="walnut"] .properties-panel,
body[data-ui-theme="walnut"] .settings-card,
body[data-ui-theme="walnut"] .ganging-sidebar {
    background: linear-gradient(180deg, rgba(74, 49, 31, 0.88), rgba(47, 32, 21, 0.92));
    border-color: rgba(255, 214, 160, 0.1);
}

body[data-ui-theme="wood"] .btn-secondary,
body[data-ui-theme="wood"] select,
body[data-ui-theme="wood"] input,
body[data-ui-theme="wood"] textarea,
body[data-ui-theme="walnut"] .btn-secondary,
body[data-ui-theme="walnut"] select,
body[data-ui-theme="walnut"] input,
body[data-ui-theme="walnut"] textarea {
    background: rgba(28, 17, 11, 0.5);
}

body[data-ui-theme="wood"] .btn-secondary,
body[data-ui-theme="wood"] .setting-item label,
body[data-ui-theme="wood"] .setting-item p,
body[data-ui-theme="wood"] .company-field-toggle,
body[data-ui-theme="wood"] .setting-item span,
body[data-ui-theme="wood"] .printer-status-chip span,
body[data-ui-theme="wood"] .printer-status-checklist-item span,
body[data-ui-theme="wood"] .printer-status-checklist-item p,
body[data-ui-theme="wood"] .printer-assistant-copy,
body[data-ui-theme="walnut"] .btn-secondary,
body[data-ui-theme="walnut"] .setting-item label,
body[data-ui-theme="walnut"] .setting-item p,
body[data-ui-theme="walnut"] .company-field-toggle,
body[data-ui-theme="walnut"] .setting-item span,
body[data-ui-theme="walnut"] .printer-status-chip span,
body[data-ui-theme="walnut"] .printer-status-checklist-item span,
body[data-ui-theme="walnut"] .printer-status-checklist-item p,
body[data-ui-theme="walnut"] .printer-assistant-copy {
    color: var(--text-main);
}

body[data-ui-theme="wood"] .setting-item input[type="text"]::placeholder,
body[data-ui-theme="wood"] .setting-item input[type="password"]::placeholder,
body[data-ui-theme="wood"] .setting-item input[type="number"]::placeholder,
body[data-ui-theme="wood"] .setting-item textarea::placeholder,
body[data-ui-theme="wood"] .search-container input::placeholder,
body[data-ui-theme="walnut"] .setting-item input[type="text"]::placeholder,
body[data-ui-theme="walnut"] .setting-item input[type="password"]::placeholder,
body[data-ui-theme="walnut"] .setting-item input[type="number"]::placeholder,
body[data-ui-theme="walnut"] .setting-item textarea::placeholder,
body[data-ui-theme="walnut"] .search-container input::placeholder {
    color: rgba(241, 225, 204, 0.6);
}

body[data-ui-theme="wood"] .setting-item select,
body[data-ui-theme="wood"] .setting-item input[type="text"],
body[data-ui-theme="wood"] .setting-item input[type="password"],
body[data-ui-theme="wood"] .setting-item input[type="number"],
body[data-ui-theme="wood"] .setting-item textarea,
body[data-ui-theme="wood"] .font-picker-inline select,
body[data-ui-theme="wood"] .btn-secondary,
body[data-ui-theme="walnut"] .setting-item select,
body[data-ui-theme="walnut"] .setting-item input[type="text"],
body[data-ui-theme="walnut"] .setting-item input[type="password"],
body[data-ui-theme="walnut"] .setting-item input[type="number"],
body[data-ui-theme="walnut"] .setting-item textarea,
body[data-ui-theme="walnut"] .font-picker-inline select,
body[data-ui-theme="walnut"] .btn-secondary {
    color: var(--text-bright);
    border-color: rgba(255, 214, 160, 0.15);
}

body[data-ui-theme="wood"] .setting-item select option,
body[data-ui-theme="wood"] .font-picker-inline select option,
body[data-ui-theme="walnut"] .setting-item select option,
body[data-ui-theme="walnut"] .font-picker-inline select option {
    background: #3a281c;
    color: #fff7eb;
}

body[data-ui-theme="wood"] .logo-icon,
body[data-ui-theme="wood"] .pro-badge,
body[data-ui-theme="wood"] .btn-primary,
body[data-ui-theme="wood"] .btn-glow,
body[data-ui-theme="walnut"] .logo-icon,
body[data-ui-theme="walnut"] .pro-badge,
body[data-ui-theme="walnut"] .btn-primary,
body[data-ui-theme="walnut"] .btn-glow {
    background: linear-gradient(135deg, #9b5f2c, #d19a58);
}

body[data-ui-theme="wood"] .logo-container,
body[data-ui-theme="walnut"] .logo-container {
    background:
        linear-gradient(180deg, rgba(86, 57, 36, 0.92), rgba(56, 35, 23, 0.84)),
        radial-gradient(circle at top right, rgba(209, 154, 88, 0.2), transparent 58%);
    border-color: rgba(255, 221, 180, 0.1);
}

body[data-ui-theme="wood-retro"]::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg,
            rgba(255, 218, 169, 0.025) 0px,
            rgba(255, 218, 169, 0.025) 3px,
            rgba(77, 46, 24, 0.015) 3px,
            rgba(77, 46, 24, 0.015) 16px),
        linear-gradient(180deg, rgba(255, 205, 142, 0.03), transparent 28%);
    opacity: 0.9;
    z-index: 0;
}

body[data-ui-theme="wood-retro"] .app-container {
    position: relative;
    z-index: 1;
}

body[data-ui-theme="wood-retro"] .sidebar,
body[data-ui-theme="wood-retro"] .top-bar,
body[data-ui-theme="wood-retro"] .toolset,
body[data-ui-theme="wood-retro"] .properties-panel,
body[data-ui-theme="wood-retro"] .settings-card,
body[data-ui-theme="wood-retro"] .ganging-sidebar {
    background:
        linear-gradient(180deg, rgba(96, 61, 39, 0.88), rgba(62, 39, 26, 0.94)),
        repeating-linear-gradient(0deg, rgba(255, 220, 170, 0.02) 0px, rgba(255, 220, 170, 0.02) 2px, transparent 2px, transparent 12px);
    border-color: rgba(255, 216, 163, 0.12);
}

body[data-ui-theme="wood-retro"] .btn-secondary,
body[data-ui-theme="wood-retro"] select,
body[data-ui-theme="wood-retro"] input,
body[data-ui-theme="wood-retro"] textarea {
    background: rgba(35, 22, 14, 0.56);
}

body[data-ui-theme="wood-retro"] .btn-secondary,
body[data-ui-theme="wood-retro"] .setting-item label,
body[data-ui-theme="wood-retro"] .setting-item p,
body[data-ui-theme="wood-retro"] .company-field-toggle,
body[data-ui-theme="wood-retro"] .setting-item span,
body[data-ui-theme="wood-retro"] .printer-status-chip span,
body[data-ui-theme="wood-retro"] .printer-status-checklist-item span,
body[data-ui-theme="wood-retro"] .printer-status-checklist-item p,
body[data-ui-theme="wood-retro"] .printer-assistant-copy {
    color: var(--text-main);
}

body[data-ui-theme="wood-retro"] .setting-item input[type="text"]::placeholder,
body[data-ui-theme="wood-retro"] .setting-item input[type="password"]::placeholder,
body[data-ui-theme="wood-retro"] .setting-item input[type="number"]::placeholder,
body[data-ui-theme="wood-retro"] .setting-item textarea::placeholder,
body[data-ui-theme="wood-retro"] .search-container input::placeholder {
    color: rgba(244, 227, 196, 0.62);
}

body[data-ui-theme="wood-retro"] .setting-item select,
body[data-ui-theme="wood-retro"] .setting-item input[type="text"],
body[data-ui-theme="wood-retro"] .setting-item input[type="password"],
body[data-ui-theme="wood-retro"] .setting-item input[type="number"],
body[data-ui-theme="wood-retro"] .setting-item textarea,
body[data-ui-theme="wood-retro"] .font-picker-inline select,
body[data-ui-theme="wood-retro"] .btn-secondary {
    color: var(--text-bright);
    border-color: rgba(255, 220, 172, 0.16);
}

body[data-ui-theme="wood-retro"] .setting-item select option,
body[data-ui-theme="wood-retro"] .font-picker-inline select option {
    background: #4a3021;
    color: #fff7e8;
}

body[data-ui-theme="classic"] .setting-item select option,
body[data-ui-theme="classic"] .font-picker-inline select option {
    background: #f7f1e6;
    color: #2f2a24;
}

body[data-ui-theme="light"] .setting-item select option,
body[data-ui-theme="light"] .font-picker-inline select option,
body[data-ui-theme="paper"] .setting-item select option,
body[data-ui-theme="paper"] .font-picker-inline select option {
    background: #f2f5f9;
    color: #1f2937;
}

body[data-ui-theme="glass"] .setting-item select option,
body[data-ui-theme="glass"] .font-picker-inline select option,
body[data-ui-theme="dark"] .setting-item select option,
body[data-ui-theme="dark"] .font-picker-inline select option,
body[data-ui-theme="graphite"] .setting-item select option,
body[data-ui-theme="graphite"] .font-picker-inline select option,
body[data-ui-theme="obsidian"] .setting-item select option,
body[data-ui-theme="obsidian"] .font-picker-inline select option,
body[data-ui-theme="aurora"] .setting-item select option,
body[data-ui-theme="aurora"] .font-picker-inline select option,
body:not([data-ui-theme]) .setting-item select option,
body:not([data-ui-theme]) .font-picker-inline select option {
    background: #161b26;
    color: #e6edf3;
}

body[data-ui-theme-family="dark"] .setting-item select option,
body[data-ui-theme-family="dark"] .font-picker-inline select option,
body[data-ui-theme-family="wood"] .setting-item select option,
body[data-ui-theme-family="wood"] .font-picker-inline select option,
body[data-ui-theme-family="glass"] .setting-item select option,
body[data-ui-theme-family="glass"] .font-picker-inline select option {
    background: #161b26;
    color: #e6edf3;
}

body[data-ui-theme-family="dark"] .setting-item select optgroup,
body[data-ui-theme-family="dark"] .font-picker-inline select optgroup,
body[data-ui-theme-family="wood"] .setting-item select optgroup,
body[data-ui-theme-family="wood"] .font-picker-inline select optgroup,
body[data-ui-theme-family="glass"] .setting-item select optgroup,
body[data-ui-theme-family="glass"] .font-picker-inline select optgroup {
    background: #0f141f;
    color: #f4efe4;
    font-weight: 700;
}

body[data-ui-theme-family="light"] .setting-item select option,
body[data-ui-theme-family="light"] .font-picker-inline select option {
    background: #f8fafc;
    color: #1f2937;
}

body[data-ui-theme-family="light"] .setting-item select optgroup,
body[data-ui-theme-family="light"] .font-picker-inline select optgroup {
    background: #eef2f7;
    color: #334155;
    font-weight: 700;
}

body[data-ui-theme="wood-retro"] .tool-btn,
body[data-ui-theme="wood-retro"] .btn-icon-sm,
body[data-ui-theme="wood-retro"] .btn-icon {
    border-color: rgba(255, 209, 148, 0.14);
}

body[data-ui-theme="wood-retro"] .logo-icon,
body[data-ui-theme="wood-retro"] .pro-badge,
body[data-ui-theme="wood-retro"] .btn-primary,
body[data-ui-theme="wood-retro"] .btn-glow,
body[data-ui-theme="wood-retro"] .tool-btn.active {
    background: linear-gradient(135deg, #9a5a27, #d8a15d);
}

body[data-ui-theme="wood-retro"] .logo-container {
    background:
        linear-gradient(180deg, rgba(93, 60, 38, 0.9), rgba(60, 38, 25, 0.88)),
        radial-gradient(circle at top right, rgba(216, 161, 93, 0.18), transparent 58%);
    border-color: rgba(255, 220, 172, 0.12);
}

/* Layout Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container {
    position: relative;
    display: block;
    margin-bottom: 22px;
    padding: 0;
    width: 100%;
    aspect-ratio: 1200 / 630;
    min-height: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.logo-banner {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

.profile-chip-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.product-image-upload-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.product-image-upload-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.product-image-upload-header label {
    display: block;
    font-size: 13px;
    color: var(--text-bright);
    margin-bottom: 4px;
    cursor: default;
}

.product-image-upload-header p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.product-image-upload-btn {
    flex-shrink: 0;
    cursor: pointer;
}

.product-image-preview {
    min-height: 124px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.product-image-preview img {
    display: none;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.product-image-preview-empty {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
}

.product-image-preview.has-image img {
    display: block;
}

.product-image-preview.has-image .product-image-preview-empty {
    display: none;
}

/* Navigation Links */
.nav-links {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
}

.nav-links li {
    margin-bottom: 0;
}

.nav-editor-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 13px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    border-radius: 16px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.01));
    transition: all 0.2s ease;
}

.nav-links li.active a,
.nav-links a:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at left center, rgba(var(--accent-primary-rgb), 0.12), transparent 56%);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(1px);
}

.nav-links li.active a {
    color: var(--text-bright);
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb), 0.18), rgba(var(--accent-primary-rgb), 0.08)),
        linear-gradient(90deg, rgba(0, 212, 255, 0.08), transparent 78%);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

.nav-links i {
    width: 22px;
    font-size: 18px;
    text-align: center;
    color: currentColor;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover i,
.nav-links li.active a i {
    color: var(--accent-secondary);
    transform: scale(1.04);
}

.editor-sidebar-tree-shell {
    display: none;
    padding: 12px 12px 8px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        radial-gradient(circle at top left, rgba(var(--accent-primary-rgb), 0.14), transparent 60%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-editor-item.active .editor-sidebar-tree-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-sidebar-tree-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.editor-sidebar-tree-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.editor-sidebar-tree-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-dim);
}

.editor-sidebar-tree-copy strong {
    color: var(--text-bright);
    font-size: 15px;
    line-height: 1.1;
}

.editor-sidebar-add {
    flex-shrink: 0;
}

/* Pro Badge */
.sidebar-footer {
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pro-badge {
    background:
        linear-gradient(135deg, #f59e0b, #d97706),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 226, 176, 0.18);
    box-shadow:
        0 10px 22px rgba(217, 119, 6, 0.22),
        inset 0 1px 0 rgba(255, 248, 220, 0.22);
}

.pro-badge i {
    font-size: 14px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: 72px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(10, 12, 16, 0.5);
    backdrop-filter: blur(10px);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    width: 400px;
    flex: 0 0 400px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-container:focus-within {
    border-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.search-container input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-size: 14px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

/* =========================================
   PERFIL FUNCIONÁRIO (RESTRIÇÕES)
========================================= */
body.employee-mode #nav-settings {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

body.employee-mode .canvas-actions button:not(#btnPrint):not([onclick="togglePreview()"]) {
    display: none !important;
}

body.employee-mode .tools-panel {
    opacity: 0.4;
    pointer-events: none;
}

body.employee-mode .properties-panel {
    position: relative;
}

body.employee-mode .properties-panel::after {
    content: "Edição Bloqueada (Modo Funcionário)";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    font-weight: 600;
    color: var(--accent-primary);
    z-index: 10;
}

body.employee-mode .thermal-paper-container {
    pointer-events: none;
    /* Impede arrastar elementos */
}

body.employee-mode .db-actions button:first-child {
    /* Oculta Importar CSV no BD */
    display: none;
}

body.employee-mode .db-table button.btn-danger {
    /* Oculta excluir produto */
    display: none;
}

.btn-icon:hover {
    color: var(--text-main);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    padding: 2px;
}

/* Editor Workspace Grid */
.editor-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px;
    gap: 24px;
    position: relative;
    overflow: visible;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(0, 123, 255, 0.05) 0%, transparent 50%);
}

.editor-workspace-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-workspace-node {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.028);
}

.editor-workspace-node.is-active {
    border-color: rgba(var(--accent-primary-rgb), 0.42);
    box-shadow:
        0 0 0 1px rgba(var(--accent-primary-rgb), 0.14) inset,
        0 12px 24px rgba(0, 0, 0, 0.16);
}

.editor-workspace-node-main {
    all: unset;
    cursor: pointer;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.editor-workspace-node-badge {
    display: inline-flex;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 123, 255, 0.12);
    color: var(--accent-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-workspace-node-main strong {
    color: var(--text-main);
    font-size: 14px;
}

.editor-workspace-node-main span {
    color: var(--text-dim);
    font-size: 11px;
}

.editor-workspace-node-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-workspace-node-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: 4px;
}

.editor-workspace-tree-sidebar {
    max-height: min(56vh, 520px);
    overflow: auto;
    padding-right: 2px;
    min-width: 0;
}

.editor-workspace-tree-sidebar .editor-workspace-node {
    gap: 7px;
    padding: 9px 9px 9px 10px;
    border-radius: 12px;
}

.editor-workspace-tree-sidebar .editor-workspace-node-main strong {
    font-size: 13px;
    line-height: 1.15;
}

.editor-workspace-tree-sidebar .editor-workspace-node-main span {
    font-size: 10px;
    line-height: 1.1;
}

.editor-workspace-tree-sidebar .editor-workspace-node-badge {
    font-size: 9px;
    padding: 2px 7px;
}

.editor-workspace-tree-sidebar .editor-workspace-node-actions {
    gap: 6px;
}

.editor-workspace-tree-sidebar .editor-workspace-node.is-root {
    gap: 8px;
    padding: 10px 10px 10px 11px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(var(--accent-primary-rgb), 0.12), transparent 64%);
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="1"] {
    gap: 6px;
    padding: 8px 8px 8px 9px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.022);
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"],
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"],
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] {
    gap: 5px;
    padding: 7px 7px 7px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.016);
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="1"] .editor-workspace-node-main strong {
    font-size: 12px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .editor-workspace-node-main strong,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .editor-workspace-node-main strong,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .editor-workspace-node-main strong {
    font-size: 11px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .editor-workspace-node-main span,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .editor-workspace-node-main span,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .editor-workspace-node-main span {
    font-size: 9px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="1"] .editor-workspace-node-badge {
    font-size: 8px;
    padding: 2px 6px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .editor-workspace-node-badge,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .editor-workspace-node-badge,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .editor-workspace-node-badge {
    font-size: 7px;
    padding: 1px 6px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="1"] .btn-icon-sm {
    width: 28px;
    height: 28px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .btn-icon-sm,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .btn-icon-sm,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .btn-icon-sm {
    width: 26px;
    height: 26px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .editor-workspace-node-actions,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .editor-workspace-node-actions,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .editor-workspace-node-actions {
    gap: 4px;
}

.editor-workspace-tree-sidebar .editor-workspace-node-children {
    gap: 6px;
    padding-left: 8px;
    margin-left: 2px;
}

.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="2"] .editor-workspace-node-children,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="3"] .editor-workspace-node-children,
.editor-workspace-tree-sidebar .editor-workspace-node[data-depth="4"] .editor-workspace-node-children {
    gap: 5px;
    padding-left: 6px;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
}

/* Toolset Styling */
.toolset {
    width: var(--editor-tool-panel-width);
    min-width: var(--editor-tool-panel-width);
    height: min(calc(100vh - 250px), 620px);
    max-height: min(calc(100vh - 250px), 620px);
    padding: 0;
    position: fixed;
    /* Encaixa a janela de ferramentas mais para dentro da área do editor */
    left: calc(260px + 50px);
    top: 210px;
    z-index: 40;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    overflow: visible;
    transition: box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.toolset:not(.is-open) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
}

.toolset-toggle {
    position: absolute;
    top: 84px;
    left: -22px;
    width: 46px;
    height: 54px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        color-mix(in srgb, var(--bg-sidebar) 92%, white 8%);
    color: color-mix(in srgb, var(--accent-secondary) 92%, white 8%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 30px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, background 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, left 0.24s ease, top 0.24s ease;
    pointer-events: auto;
}

.toolset-toggle i {
    font-size: 18px;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.toolset-toggle:hover,
.toolset-toggle:focus-visible {
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb), 0.18), rgba(var(--accent-primary-rgb), 0.08)),
        color-mix(in srgb, var(--bg-sidebar) 90%, white 10%);
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    color: var(--accent-primary);
    box-shadow: 0 14px 28px rgba(var(--accent-primary-rgb), 0.2);
    outline: none;
}

.toolset.is-open {
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--accent-primary-rgb), 0.18);
}

.toolset.is-open .toolset-toggle i {
    transform: rotate(180deg);
}

.toolset-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100%;
    transition: opacity 0.2s ease, transform 0.24s ease;
}

.toolset:not(.is-open) .toolset-body {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-14px);
    pointer-events: none;
}

.toolset h3 {
    font-size: 14px;
    color: var(--text-bright);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag-assistant-dock {
    width: var(--editor-tool-panel-width);
    min-width: var(--editor-tool-panel-width);
    max-height: 360px;
    position: fixed;
    left: calc(260px + 50px);
    top: calc(210px + min(calc(100vh - 250px), 620px) + 18px);
    z-index: 38;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        var(--bg-sidebar);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease, max-height 0.24s ease;
}

.tag-assistant-dock.is-text-active {
    border-color: rgba(var(--accent-primary-rgb), 0.28);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(var(--accent-primary-rgb), 0.08);
}

.tag-assistant-dock.is-collapsed {
    max-height: 72px;
}

.tag-assistant-dock__body {
    max-height: 360px;
    overflow: hidden;
    padding: 12px;
}

.tag-assistant-dock__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.tag-assistant-dock__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tag-assistant-dock__pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tag-assistant-dock__pill.is-active {
    color: var(--text-main);
    border-color: rgba(var(--accent-primary-rgb), 0.22);
    background: rgba(var(--accent-primary-rgb), 0.12);
}

.tag-assistant-dock__toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.tag-assistant-dock__toggle:hover {
    background: rgba(var(--accent-primary-rgb), 0.14);
    border-color: rgba(var(--accent-primary-rgb), 0.26);
}

.tag-assistant-dock__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tag-assistant-dock.is-collapsed .tag-assistant-dock__content {
    display: none;
}

.canvas-area {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.toolset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    padding-right: 52px;
    position: relative;
    z-index: 4;
}

.toolset-header h3 {
    margin-bottom: 0;
}

.toolset-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: -4px 0 16px;
    padding-right: 52px;
}

.toolset-meta__pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quick-icon-tool {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.quick-icon-tool-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.22);
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-icon-tool-delete {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    border: 1px solid rgba(255, 120, 120, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #f0b5a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 6;
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.quick-icon-tool-delete i {
    font-size: 14px;
}

.quick-icon-tool-delete:hover:not(:disabled) {
    border-color: rgba(255, 120, 120, 0.4);
    background: rgba(201, 74, 74, 0.14);
    color: #ffd0c7;
    transform: translateY(-1px);
}

.quick-icon-tool-delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quick-icon-tool-btn i {
    font-size: 18px;
}

.quick-icon-tool-btn:hover,
.quick-icon-tool.is-open .quick-icon-tool-btn {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.12);
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb), 0.16), 0 10px 22px rgba(var(--accent-primary-rgb), 0.14);
    transform: translateY(-1px);
}

.quick-icon-picker {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 124px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.16);
    background: rgba(26, 16, 10, 0.96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    z-index: 40;
}

.quick-icon-tool.is-open .quick-icon-picker {
    display: grid;
}

.quick-icon-picker button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.quick-icon-picker button i {
    font-size: 17px;
}

.quick-icon-picker button:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-secondary);
    transform: translateY(-1px);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.tool-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 84px;
    padding: 14px 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn i {
    font-size: 22px;
    transition: transform 0.2s;
}

.tool-btn span {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--text-bright);
}

.tool-btn:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.tool-btn:hover i {
    transform: translateY(-2px);
}

/* Canvas Area Central */
.tool-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 340px;
    /* Buffer para o painel flutuante */
}

.canvas-actions {
    display: flex;
    gap: 12px;
}

.history-controls {
    display: flex;
    gap: 5px;
    margin-right: 15px;
}

.btn-icon-sm {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: var(--accent-primary);
    color: white;
}

.zoom-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.zoom-controls button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    min-width: 36px;
    padding: 0 6px;
    font-weight: 700;
}

/* Thermal Paper Simulation */
.thermal-paper-container {
    flex: 1;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-lg);
    padding: 60px;
    transition: all 0.3s ease;
    cursor: grab;
    user-select: none;
}

.thermal-paper-container[data-editor-view-mode="infinite"] {
    justify-content: flex-start;
    padding-top: clamp(120px, 16vh, 190px);
    padding-bottom: clamp(140px, 18vh, 240px);
}

.thermal-paper-container.is-panning {
    cursor: grabbing;
}

.canvas-stage-resizer {
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    margin-top: -8px;
    user-select: none;
}

.canvas-stage-resizer span {
    width: 140px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.canvas-stage-resizer:hover span,
.canvas-stage-resizer.is-resizing span {
    background: rgba(var(--accent-primary-rgb), 0.5);
    transform: scaleY(1.15);
}

.thermal-paper {
    width: 80mm;
    /* Aumentado para melhor visualização */
    min-height: 110mm;
    background-color: var(--paper-preview-bg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    padding: 6mm;
    color: black;
    transform: scale(1.8);
    /* Zoom inicial maior */
    transform-origin: top center;
    transition: box-shadow 0.2s ease;
}

.thermal-paper[data-editor-view-mode="infinite"] {
    transition: min-height 0.24s ease, height 0.24s ease, box-shadow 0.2s ease;
}

/* Modo Preview de Impressão */
/* Modo Preview de Impressão - RESTRITO ao Editor */
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .sidebar,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .top-bar,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .toolset,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .tag-assistant-dock,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .properties-panel,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .canvas-header,
body.preview-mode:not(.section-history-active):not(.section-ganging-active) .paper-edge {
    display: none !important;
}

body.preview-mode .editor-workspace,
body.preview-mode .canvas-area,
body.preview-mode .thermal-paper-container {
    padding: 0 !important;
    background: var(--preview-stage-bg) !important;
}

/* Garante que o conteúdo principal não seja afetado por background preto se não estivermos no editor */
body:not(.section-editor-active) .main-content {
    background: var(--bg-main) !important;
}

body.preview-mode .thermal-paper {
    transform: scale(1);
    box-shadow: 0 0 100px rgba(255, 255, 255, 0.1);
}

.preview-exit-btn {
    display: none !important;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

body.preview-mode .preview-exit-btn {
    display: flex !important;
}

/* Grade Magnética Visual */
#labelContent.show-grid {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.15) 1px, transparent 1px);
    background-size: 10px 10px;
}

:root[data-theme="dark"] #labelContent.show-grid,
body.dark-theme #labelContent.show-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.label-shadow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.label-inner {
    width: 100%;
    height: 100%;
    border: 1px dashed #ddd;
    /* Grid invisível na impressão */
    position: relative;
    overflow: hidden;
}

.element {
    position: absolute;
    padding: 2px 4px;
    border: 1px solid transparent;
    transition: border 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    user-select: none;
    white-space: nowrap;
    overflow: visible;
}

.label-barcode {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.label-barcode svg {
    display: block;
    margin: 0;
    padding: 0;
}

.label-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    min-width: 24px;
    min-height: 18px;
    box-sizing: border-box;
}

.label-text.selected,
.label-text.multi-selected {
    overflow: visible;
}

.element:hover {
    outline: 1px dashed rgba(var(--accent-primary-rgb), 0.5);
    outline-offset: 3px;
}

.element.selected,
.element.multi-selected {
    border-color: transparent;
    background-color: rgba(var(--accent-primary-rgb), 0.03);
    box-shadow: 0 12px 28px rgba(var(--accent-primary-rgb), 0.10);
    z-index: 100;
}

/* Borda de seleção: linha fina, cantos redondos, halo suave */
.element.selected::before,
.element.multi-selected::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1.5px solid rgba(var(--accent-primary-rgb), 0.85);
    border-radius: 4px;
    box-shadow:
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.08),
        inset 0 0 0 1px rgba(var(--accent-primary-rgb), 0.06);
    pointer-events: none;
    animation: selection-aura 2s ease-in-out infinite;
}

@keyframes selection-aura {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.08), inset 0 0 0 1px rgba(var(--accent-primary-rgb), 0.06);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(var(--accent-primary-rgb), 0.13), inset 0 0 0 1px rgba(var(--accent-primary-rgb), 0.10);
    }
}

.element.selected::after,
.element.multi-selected::after {
    content: '⤢';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 12px rgba(var(--accent-primary-rgb), 0.2);
    pointer-events: none;
}

.element.is-dragging {
    border-style: solid;
    background-color: rgba(0, 123, 255, 0.12);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 123, 255, 0.28);
    transform: scale(1.01);
    z-index: 140;
}

.element.selected::after,
.element.multi-selected::after {
    content: none !important;
    display: none !important;
}

.element.is-dragging::after {
    content: '✥';
    background: #0f172a;
}

.element.is-resizing {
    border-style: solid;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 123, 255, 0.24);
    z-index: 145;
}

/* ── Resize Handles: design moderno ── */
.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 1.5px solid var(--accent-primary);
    border-radius: 999px;
    box-shadow:
        0 0 0 2px rgba(var(--accent-primary-rgb), 0.15),
        0 2px 8px rgba(var(--accent-primary-rgb), 0.30);
    z-index: 220;
    pointer-events: auto;
    touch-action: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.resize-handle:hover {
    transform: scale(1.5) !important;
    box-shadow:
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.22),
        0 4px 14px rgba(var(--accent-primary-rgb), 0.45);
    background: var(--accent-primary);
}

/* Cantos — circulares maiores */
.resize-handle-se,
.resize-handle-sw,
.resize-handle-ne,
.resize-handle-nw {
    width: 9px;
    height: 9px;
}

.resize-handle-se {
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
}

.resize-handle-sw {
    left: -6px;
    bottom: -6px;
    cursor: nesw-resize;
}

.resize-handle-ne {
    right: -6px;
    top: -6px;
    cursor: nesw-resize;
}

.resize-handle-nw {
    left: -6px;
    top: -6px;
    cursor: nwse-resize;
}

/* Meios — handles em losango (menores) */
.resize-handle-n {
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
    cursor: ns-resize;
    border-radius: 3px;
    width: 14px;
    height: 6px;
}

.resize-handle-s {
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    cursor: ns-resize;
    border-radius: 3px;
    width: 14px;
    height: 6px;
}

.resize-handle-e {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
    border-radius: 3px;
    width: 6px;
    height: 14px;
}

.resize-handle-w {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
    border-radius: 3px;
    width: 6px;
    height: 14px;
}

#labelContent.is-dragging-elements .element:not(.is-dragging):not(.selected):not(.multi-selected) {
    opacity: 0.92;
}

body.editor-element-dragging,
body.editor-element-dragging * {
    user-select: none !important;
}

.selection-box {
    position: absolute;
    border: 1px solid var(--accent-primary);
    background-color: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    z-index: 200;
}

.manual-cut-guide {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 240;
    --manual-cut-y: 0px;
}

.manual-cut-guide__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(8, 15, 30, 0.02) 0,
            rgba(8, 15, 30, 0.02) var(--manual-cut-y),
            rgba(255, 107, 53, 0.10) var(--manual-cut-y),
            rgba(255, 107, 53, 0.05) 100%);
    backdrop-filter: blur(0.5px);
}

.manual-cut-guide__line {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--manual-cut-y);
    border-top: 2px dashed #ff6b35;
    box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.12);
}

.manual-cut-guide__handle {
    position: absolute;
    left: 50%;
    top: -9px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: radial-gradient(circle at 35% 35%, #fff, #ffd1bc 45%, #ff6b35 100%);
    border: 2px solid #fff;
    box-shadow: 0 8px 18px rgba(255, 107, 53, 0.28);
}

.manual-cut-guide__label {
    position: absolute;
    left: 14px;
    top: -46px;
    display: grid;
    gap: 2px;
    min-width: 170px;
    max-width: calc(100% - 28px);
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(11, 17, 32, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.manual-cut-guide__label strong {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.manual-cut-guide__label span {
    font-size: 11px;
    color: rgba(226, 232, 240, 0.88);
    line-height: 1.35;
}

.manual-cut-guide__label::after {
    content: '';
    position: absolute;
    left: 18px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: rgba(11, 17, 32, 0.92);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(-45deg);
}

body.manual-cut-mode .thermal-paper-container,
body.manual-cut-mode .thermal-paper,
body.manual-cut-mode #labelContent {
    cursor: crosshair !important;
}

.dimension-label {
    --measure-gap: 10px;
    position: absolute;
    /* Glassmorphism azul premium */
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 11px;
    pointer-events: none;
    z-index: 260;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(59, 130, 246, 0.10);
}

.measurement-overlay {
    pointer-events: none;
    overflow: visible;
}

.measurement-overlay__width,
.measurement-overlay__height {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 2px;
    border-radius: 4px;
    background: transparent;
    color: rgba(51, 65, 85, 0.78);
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    opacity: 0.72;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 340;
}

.measurement-overlay__width {
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
}

.measurement-overlay__height {
    top: 50%;
    right: calc(100% + 2px);
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: top center;
}

.measurement-summary-group {
    gap: 10px;
}

.measurement-summary-group label {
    margin-bottom: 0;
}

.measurement-summary-card,
.measurement-summary-empty {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 24, 33, 0.72);
    color: #e2e8f0;
    display: grid;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.measurement-summary-card strong {
    color: #fff;
    font-size: 13px;
}

.measurement-summary-card span {
    color: #cbd5e1;
    font-size: 12px;
}

.measurement-summary-empty {
    color: #94a3b8;
    font-size: 12px;
}

.dimension-width {
    left: 50%;
    top: calc(100% + var(--measure-gap));
    transform: translateX(-50%);
}

.dimension-height {
    top: 50%;
    right: calc(100% + var(--measure-gap));
    left: auto;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
}

.placeholder-text {
    color: #ccc;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
}

.paper-edge {
    display: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-dim);
    justify-content: flex-start;
    padding: 8px 12px;
}

.btn-text:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-text i {
    font-size: 18px;
    width: 24px;
}

/* Profile Dropdown Custom */
.profile-dropdown {
    position: relative;
    z-index: 9999;
}

.profile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 110%;
    right: 0;
    width: 220px;
    background: #161b26;
    /* Cor sólida do card */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 6px;
    z-index: 100000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.profile-menu.active {
    display: flex;
}

.profile-menu .btn-text {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
}

.profile-menu .btn-text:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-secondary);
}

.profile-menu .btn-text i {
    font-size: 20px;
    color: var(--text-dim);
}

.profile-menu .btn-text:hover i {
    color: var(--accent-secondary);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-glow:hover::after {
    opacity: 1;
}

.properties-panel {
    position: absolute;
    top: 96px;
    /* Um pouco mais para cima que o meio */
    right: 24px;
    width: 420px;
    min-width: 380px;
    max-width: 600px;
    min-height: 280px;
    resize: none;
    z-index: 50;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 156px);
    overflow: auto;
    overscroll-behavior: contain;
    isolation: isolate;
    /* Para o handle não cortar */
}

.properties-panel .tab-content.active {
    display: grid;
    gap: 8px;
}

.properties-panel .property-group {
    margin-bottom: 0;
}

.properties-panel .property-group label {
    font-size: 11px;
    margin-bottom: 4px;
}

.properties-panel .property-group select,
.properties-panel .property-group input[type="text"],
.properties-panel .property-group input[type="range"] {
    padding: 7px 8px;
}

.properties-panel .btn.btn-secondary.btn-sm,
.properties-panel .btn.btn-primary.btn-sm {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.properties-panel .setting-item {
    gap: 5px;
}

.panel-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: -20px -20px 8px -20px;
    color: var(--text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
    touch-action: none;
    cursor: grab;
}

.panel-drag-handle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.properties-panel.is-dragging .panel-drag-handle {
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--text-main);
    cursor: grabbing;
}

.panel-drag-frame {
    position: absolute;
    inset: -6px;
    pointer-events: none;
    z-index: 3;
    border-radius: inherit;
}

.panel-drag-grip {
    position: absolute;
    pointer-events: auto;
}

.panel-drag-grip::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.panel-drag-grip:hover::before,
.properties-panel.is-dragging .panel-drag-grip::before {
    border-color: rgba(var(--accent-primary-rgb), 0.5);
    background: rgba(var(--accent-primary-rgb), 0.08);
}

.panel-drag-grip-top,
.panel-drag-grip-bottom {
    left: 12px;
    right: 12px;
    height: 12px;
    cursor: grab;
}

.panel-drag-grip-top {
    top: 0;
}

.panel-drag-grip-bottom {
    bottom: 0;
}

.panel-drag-grip-left,
.panel-drag-grip-right {
    top: 12px;
    bottom: 12px;
    width: 12px;
    cursor: grab;
}

.panel-drag-grip-left {
    left: 0;
}

.panel-drag-grip-right {
    right: 0;
}

.properties-panel.is-dragging .panel-drag-grip {
    cursor: grabbing;
}

body.panel-dragging {
    user-select: none;
}

.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.panel-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tab {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

.editor-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.editor-view-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.editor-view-toggle__btn i {
    font-size: 15px;
}

.editor-view-toggle__btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.editor-view-toggle__btn.active {
    color: #1a1022;
    background: linear-gradient(135deg, #ff77c8 0%, #7ce8ff 100%);
    box-shadow: 0 10px 24px rgba(255, 118, 200, 0.18);
}

.property-group {
    margin-bottom: 8px;
}

.property-group label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.property-group select,
.property-group input[type="text"],
.property-group input[type="range"] {
    width: 100%;
}

.btn-group-row {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.btn-group-row .btn {
    flex: 1;
    padding: 8px 4px;
}

.property-disclosure-group {
    margin-top: 2px;
}

.property-disclosure {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.property-disclosure[open] {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(var(--accent-primary-rgb), 0.2);
}

.property-disclosure__toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.property-disclosure__toggle::-webkit-details-marker {
    display: none;
}

.property-disclosure__toggle span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.property-disclosure__caret {
    transition: transform 0.18s ease;
}

.property-disclosure[open] .property-disclosure__caret {
    transform: rotate(180deg);
}

.property-disclosure__content {
    padding: 0 12px 12px;
}

.property-disclosure__content .property-group:last-child {
    margin-bottom: 0;
}

.property-group select,
.property-group input[type="range"] {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 8px;
    outline: none;
}

.editor-view-mode-control {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-view-mode-control label {
    margin-bottom: 6px;
}

.editor-view-mode-hint {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.align-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.align-pad__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.09), transparent 55%),
        rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.align-pad__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.42);
    background:
        radial-gradient(circle at top, rgba(var(--accent-primary-rgb), 0.18), transparent 58%),
        rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.align-pad__btn i {
    font-size: 22px;
}

.align-pad__btn--corner {
    border-radius: 16px;
}

.align-pad__btn--center {
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.18), transparent 62%),
        rgba(255, 255, 255, 0.05);
}

.text-align-pad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.text-align-pad__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.text-align-pad__btn i {
    font-size: 16px;
}

.text-align-pad__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.text-align-pad__btn.active {
    color: #1a1022;
    border-color: transparent;
    background: linear-gradient(135deg, #ff77c8 0%, #7ce8ff 100%);
    box-shadow: 0 8px 18px rgba(255, 118, 200, 0.18);
}

.text-box-align-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.text-box-align-pad__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.text-box-align-pad__btn i {
    font-size: 16px;
}

.text-box-align-pad__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.text-box-align-pad__btn.active {
    color: #1a1022;
    border-color: transparent;
    background: linear-gradient(135deg, #ff77c8 0%, #7ce8ff 100%);
    box-shadow: 0 8px 18px rgba(255, 118, 200, 0.18);
}

.text-box-align-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.text-box-align-footer__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.text-box-align-footer__btn i {
    font-size: 14px;
}

.text-box-align-footer__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.text-box-align-footer__btn.active {
    color: #1a1022;
    border-color: transparent;
    background: linear-gradient(135deg, #ff77c8 0%, #7ce8ff 100%);
    box-shadow: 0 8px 18px rgba(255, 118, 200, 0.18);
}

@media (max-width: 900px) {
    .panel-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-tabs,
    .editor-view-toggle {
        width: 100%;
    }

    .editor-view-toggle {
        justify-content: space-between;
    }

    .editor-view-toggle__btn {
        flex: 1;
        justify-content: center;
    }
}

.panel-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.empty-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
}

.empty-selection i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.2;
}

.empty-selection p {
    font-size: 13px;
}

/* Estilos para Impressão */
@media print {
    body {
        background: white !important;
        color: black !important;
        height: auto;
    }

    .sidebar,
    .top-bar,
    .toolset,
    .tag-assistant-dock,
    .properties-panel,
    .canvas-header,
    .paper-edge,
    .label-shadow,
    .zoom-controls,
    .btn,
    .search-container,
    .dimension-label,
    .measurement-overlay,
    .selection-box,
    .ruler-x,
    .ruler-y,
    .canvas-stage-resizer {
        display: none !important;
    }

    .app-container,
    .main-content,
    .editor-workspace,
    .canvas-area,
    .thermal-paper-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .thermal-paper {
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 58mm !important;
        /* Força o tamanho do papel */
        padding: 0 !important;
        page-break-after: always;
    }

    .label-inner {
        border: none !important;
    }

    .element.selected {
        border: 1px solid transparent !important;
        background: none !important;
    }

    .element.selected::before,
    .element.selected::after,
    .element.multi-selected::before,
    .element.multi-selected::after {
        content: none !important;
        display: none !important;
    }
}

/* Modais e Ícones Rápidos */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    /* Inicia oculto */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 32px;
}

body.terms-acceptance-pending {
    overflow: hidden;
}

.terms-acceptance-modal {
    width: min(92vw, 840px);
    max-width: 840px;
    max-height: 88vh;
    overflow: auto;
}

.terms-acceptance-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-dim);
    line-height: 1.75;
}

.terms-acceptance-body p {
    margin: 0;
}

.terms-acceptance-body ul {
    margin: 0;
    padding-left: 18px;
}

.terms-acceptance-body li+li {
    margin-top: 8px;
}

.terms-acceptance-note {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-bright);
}

.terms-acceptance-linkbox {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.terms-acceptance-linkbox .btn {
    width: fit-content;
}

.terms-acceptance-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
    cursor: pointer;
}

.terms-acceptance-checkbox input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--accent-primary);
}

.terms-acceptance-checkbox span {
    flex: 1;
}

.terms-acceptance-footer .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.3);
}

.quick-generator-modal {
    max-width: 1120px;
    width: min(96vw, 1120px);
    max-height: 92vh;
    overflow: auto;
}

.quick-generator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 360px);
    gap: 20px;
}

.quick-generator-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-generator-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-generator-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
}

.quick-generator-section-title h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.quick-generator-section-title p {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.5;
}

.quick-generator-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-generator-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-generator-field-set {
    display: none;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.quick-generator-field-set.is-visible {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-generator-inline-check {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.quick-generator-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    font-size: 13px;
    color: var(--text-main);
}

.quick-generator-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.quick-generator-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-generator-preview-panel {
    position: relative;
}

.quick-generator-preview-card {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.quick-generator-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.quick-generator-preview-header h4 {
    font-size: 16px;
}

.quick-generator-preview-header span {
    font-size: 12px;
    color: var(--text-dim);
}

.quick-generator-preview {
    width: 190px;
    height: 190px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-generator-preview svg,
.quick-generator-preview canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.quick-generator-preview-text {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
    padding: 0 4px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
}

.quick-icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-icon-btn i {
    font-size: 32px;
}

.quick-icon-btn span {
    font-size: 10px;
}

.quick-icon-btn:hover {
    background: var(--accent-primary);
    transform: translateY(-2px);
    border-color: white;
}

.quick-icon-btn img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.icon-library-searchbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.icon-library-searchbar input[type="search"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    outline: none;
}

.icon-library-searchbar input[type="search"]::placeholder {
    color: var(--text-dim);
}

.icon-library-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-library-tab {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
}

.icon-library-tab.is-active,
.icon-library-tab:hover {
    background: var(--accent-primary);
    border-color: transparent;
    color: #fff;
}

.icon-library-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.icon-library-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.icon-library-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.icon-library-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.icon-library-section-header h4 {
    margin: 0;
    font-size: 15px;
}

.icon-library-section-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-dim);
}

.icon-library-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.icon-library-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.custom-icon-grid {
    align-items: stretch;
}

.custom-icons-empty {
    grid-column: 1 / -1;
    min-height: 92px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    color: var(--text-dim);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.icon-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qr-editor-modal {
    max-width: 980px;
    width: 96%;
}

.qr-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 360px);
    gap: 22px;
}

.qr-editor-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-editor-controls textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 12px 14px;
}

.qr-editor-dimension-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.qr-editor-dimension-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.qr-editor-dimension-field span {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 12px;
}

.qr-editor-dimension-field input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
}

.qr-editor-dimension-multiplier {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 700;
}

.qr-editor-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qr-editor-logo-box {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-editor-logo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.qr-editor-logo-header p {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-dim);
}

.qr-editor-logo-preview {
    width: 110px;
    height: 110px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qr-editor-logo-preview img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-editor-logo-preview span {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    padding: 10px;
}

.qr-editor-logo-preview.has-image img {
    display: block;
}

.qr-editor-logo-preview.has-image span {
    display: none;
}

.qr-editor-logo-actions {
    display: flex;
    gap: 10px;
}

.qr-editor-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
}

.qr-editor-preview-panel {
    display: flex;
}

.qr-editor-preview-card {
    width: 100%;
    min-height: 100%;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.qr-editor-preview {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.label-qrcode {
    padding: 0;
    border: none;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
}

.label-qrcode.qr-style-classic,
.qr-editor-preview.qr-style-classic {
    background: #ffffff;
    border-radius: 18px;
    padding: 6px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.label-qrcode.qr-style-rounded,
.qr-editor-preview.qr-style-rounded {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.label-qrcode.qr-style-classy,
.qr-editor-preview.qr-style-classy {
    background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
    border-radius: 26px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.label-qrcode.qr-style-soft,
.qr-editor-preview.qr-style-soft {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: 28px;
    padding: 10px;
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.16);
}

.label-qrcode.qr-style-circle,
.qr-editor-preview.qr-style-circle {
    background: radial-gradient(circle at top, #ffffff 0%, #eff6ff 100%);
    border-radius: 999px;
    padding: 12px;
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.18);
}

.label-qrcode.qr-style-minimal,
.qr-editor-preview.qr-style-minimal {
    background: #ffffff;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.26);
}

.label-qrcode.qr-style-pixel,
.qr-editor-preview.qr-style-pixel {
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
        #ffffff;
    background-size: 10px 10px;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
}

.label-qrcode.qr-style-dots,
.qr-editor-preview.qr-style-dots {
    background: radial-gradient(circle at top, #ffffff 0%, #f1f5f9 100%);
    border-radius: 22px;
    padding: 10px;
    box-shadow: 0 18px 34px rgba(30, 41, 59, 0.14);
}

.label-qrcode.qr-style-sticker,
.qr-editor-preview.qr-style-sticker {
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    border-radius: 30px;
    padding: 12px;
    box-shadow:
        0 24px 44px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(251, 146, 60, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.label-qrcode.qr-style-ticket,
.qr-editor-preview.qr-style-ticket {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 18px;
    padding: 10px;
    box-shadow:
        0 20px 36px rgba(15, 23, 42, 0.16),
        inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.label-qrcode.qr-style-poster,
.qr-editor-preview.qr-style-poster {
    background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    border-radius: 8px;
    padding: 12px;
    box-shadow:
        0 28px 48px rgba(15, 23, 42, 0.24),
        0 0 0 1px rgba(99, 102, 241, 0.16);
}

.label-qrcode.qr-style-neo,
.qr-editor-preview.qr-style-neo {
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 52%, #eef2ff 100%);
    border-radius: 26px;
    padding: 10px;
    box-shadow:
        0 24px 46px rgba(76, 29, 149, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.label-qrcode.qr-style-neon,
.qr-editor-preview.qr-style-neon {
    background: linear-gradient(135deg, #020617 0%, #0f172a 55%, #111827 100%);
    border-radius: 24px;
    padding: 12px;
    box-shadow:
        0 0 0 1px rgba(34, 211, 238, 0.18),
        0 0 24px rgba(34, 211, 238, 0.18),
        0 26px 50px rgba(2, 6, 23, 0.42);
}

.label-qrcode svg,
.label-qrcode canvas,
.qr-editor-preview svg,
.qr-editor-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.qr-logo-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    border-radius: 18px;
    z-index: 2;
    pointer-events: none;
}

.qr-logo-overlay.has-background {
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.qr-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.label-icon {
    font-size: 32px;
    color: black;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    overflow: visible;
}

.label-icon i {
    display: block;
    line-height: 1;
    pointer-events: none;
}

.processed-img {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    /* Mantém a nitidez do filtro térmico */
}

/* Gerenciamento de Seções */
.main-section {
    display: none;
    height: calc(100vh - 72px);
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(var(--accent-primary-rgb), 0.08), transparent 34%),
        radial-gradient(circle at top right, rgba(244, 162, 89, 0.06), transparent 28%);
}

.main-section.active {
    display: flex !important;
    position: relative;
    width: 100%;
}

#section-history.active {
    display: block !important;
    padding: 40px;
}

#section-ganging.active {
    display: flex !important;
}

#section-stats.active {
    display: block !important;
}

.editor-workspace {
    display: flex;
    width: 100%;
    position: relative;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

body.editor-access-locked #section-editor .editor-workspace> :not(.editor-access-gate) {
    filter: blur(9px) saturate(0.72) brightness(0.78);
    opacity: 0.34;
    pointer-events: none;
    user-select: none;
}

body.editor-access-locked #section-editor .editor-access-gate {
    pointer-events: auto;
}

.editor-access-gate {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3vw, 40px);
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 198, 132, 0.24), transparent 28%),
        radial-gradient(circle at 82% 72%, rgba(123, 208, 255, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(18, 11, 7, 0.84), rgba(11, 8, 10, 0.7));
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.editor-access-gate[hidden] {
    display: none !important;
}

.editor-access-gate-card {
    position: relative;
    width: min(560px, 100%);
    padding: clamp(22px, 3vw, 32px);
    border-radius: 28px;
    border: 1px solid rgba(255, 214, 160, 0.18);
    background:
        linear-gradient(180deg, rgba(66, 41, 22, 0.96), rgba(29, 16, 10, 0.96));
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
}

.editor-access-gate-card::before {
    content: "";
    position: absolute;
    inset: -20% auto auto -12%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 162, 89, 0.34), transparent 66%);
    pointer-events: none;
}

.editor-access-gate-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -38px;
    width: 180px;
    height: 180px;
    border-radius: 48px;
    background: linear-gradient(135deg, rgba(123, 208, 255, 0.16), rgba(244, 162, 89, 0.04));
    transform: rotate(18deg);
    pointer-events: none;
}

.editor-access-gate-kicker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 214, 160, 0.14);
    color: #f7d7ae;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.editor-access-gate-card h3 {
    position: relative;
    margin: 16px 0 10px;
    font-size: clamp(24px, 2.8vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #fff7ed;
}

.editor-access-gate-card p {
    position: relative;
    max-width: 44ch;
    margin: 0;
    color: rgba(255, 241, 228, 0.78);
    line-height: 1.6;
    font-size: 14px;
}

.editor-access-gate-actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.editor-access-gate-actions .btn {
    min-width: 0;
}

@media (max-width: 760px) {
    .editor-access-gate {
        align-items: flex-end;
    }

    .editor-access-gate-card {
        border-radius: 24px;
    }

    .editor-access-gate-actions {
        flex-direction: column;
    }
}

#section-history.active {
    display: block;
    padding: 40px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.dynamic-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.database-container {
    padding: 30px;
}

.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 30px;
}

.db-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.db-sort-select {
    min-width: 170px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 12px;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
}

.db-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dim);
    font-size: 13px;
    text-transform: uppercase;
}

.db-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.db-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.product-qr-empty {
    color: var(--text-dim);
    font-size: 12px;
}

.product-qr-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.product-qr-thumb,
.product-qr-modal-item-preview,
.product-qr-modal-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.product-qr-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
}

.product-qr-thumb.is-loading,
.product-qr-modal-item-preview.is-loading,
.product-qr-modal-preview.is-loading {
    opacity: 0.7;
}

.product-qr-render {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-qr-thumb-empty {
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-qr-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-qr-text strong {
    font-size: 12px;
    color: var(--text-main);
}

.product-qr-text span {
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.35;
}

.product-qr-open-btn {
    width: fit-content;
}

.product-qr-modal {
    width: min(780px, 94vw);
    max-width: 780px;
}

.product-qr-modal-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
}

.product-qr-modal-preview-card,
.product-qr-modal-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-qr-modal-preview-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.product-qr-modal-preview {
    width: 100%;
    min-height: 230px;
    border-radius: 20px;
}

.product-qr-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-qr-modal-meta strong {
    font-size: 16px;
    color: var(--text-bright);
}

.product-qr-modal-meta span {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
}

.product-qr-modal-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-qr-modal-list-head span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.product-qr-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow: auto;
    padding-right: 4px;
}

.product-qr-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.product-qr-modal-item:hover,
.product-qr-modal-item.is-active {
    border-color: rgba(var(--accent-primary-rgb), 0.36);
    background: rgba(var(--accent-primary-rgb), 0.08);
    transform: translateY(-1px);
}

.product-qr-modal-item-preview {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    flex-shrink: 0;
}

.product-qr-modal-item-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-qr-modal-item-copy strong {
    font-size: 13px;
    color: var(--text-main);
}

.product-qr-modal-item-copy span {
    font-size: 11px;
    color: var(--text-dim);
}

.product-qr-empty-state {
    margin: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
}

.list-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.list-results-info {
    font-size: 12px;
    color: var(--text-dim);
}

.list-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.list-pagination button {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.list-pagination button:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(var(--accent-primary-rgb), 0.12);
}

.list-pagination button.active {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.18);
    color: var(--accent-secondary);
}

.list-pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Lista de Camadas */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-item.active {
    border-color: var(--accent-primary);
    background: rgba(0, 123, 255, 0.1);
}

/* --- ESTATÍSTICAS --- */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px;
}

.section-title-with-help {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-header .section-title-with-help,
.ganging-toolbar .section-title-with-help,
.settings-card .section-title-with-help {
    flex: 1;
}

.help-btn {
    flex-shrink: 0;
}

.stats-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-header .section-title-with-help {
    order: 1;
}

.stats-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-bright);
}

.stats-header p {
    color: var(--text-dim);
    order: 2;
}

.stats-filters {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stats-filters .setting-item {
    min-width: 180px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
}

.stat-card i {
    font-size: 36px;
    color: var(--accent-primary);
    background: rgba(0, 123, 255, 0.1);
    padding: 14px;
    border-radius: 14px;
}

.stat-card h2 {
    font-size: 32px;
    color: var(--text-bright);
}

.stat-label {
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-visuals {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

.chart-card,
.ranking-card {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.ad-analytics-card {
    grid-column: 1 / -1;
}

.chart-card h3,
.ranking-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card,
.ranking-card,
.settings-card,
.stat-card,
.upgrade-cta-card,
.subscription-plan-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
}

/* Simulação de Gráfico */
.bar-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding-top: 20px;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary));
    border-radius: 5px 5px 0 0;
    transition: height 1s ease;
    position: relative;
}

.bar:hover::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-bright);
    font-weight: bold;
}

.bar-label {
    font-size: 10px;
    color: var(--text-dim);
}

.layer-item i {
    font-size: 18px;
    color: var(--text-dim);
}

.layer-item span {
    font-size: 13px;
    flex: 1;
}

.layer-controls {
    display: flex;
    gap: 8px;
}

.layer-controls i:hover {
    color: var(--text-main);
}

/* --- CONFIGURAÇÕES --- */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.014)),
        radial-gradient(circle at top left, rgba(var(--accent-primary-rgb), 0.10), transparent 34%),
        rgba(27, 16, 9, 0.72);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.settings-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb), 0.06), transparent 30%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.02), transparent 36%);
}

.settings-container>* {
    position: relative;
    z-index: 1;
}

.settings-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
        rgba(41, 24, 14, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.settings-header h2 {
    font-size: 24px;
    margin-bottom: 0;
    color: var(--text-bright);
}

.settings-header p {
    color: var(--text-dim);
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

.settings-card {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 22px;
    border-radius: var(--radius-lg);
    flex-direction: column;
    gap: 14px;
    break-inside: avoid;
    page-break-inside: avoid;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
        rgba(39, 23, 13, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
}

.settings-card h3 {
    font-size: 16px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018)),
        rgba(24, 15, 9, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 10px 22px rgba(0, 0, 0, 0.06);
}

.setting-item label {
    font-size: 13px;
    color: var(--text-bright);
}

.company-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.company-field-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px !important;
    color: var(--text-main) !important;
    white-space: nowrap;
}

.company-field-toggle input {
    accent-color: var(--accent-primary);
}

.company-logo-box,
.company-mascot-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
        rgba(24, 15, 9, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 10px 24px rgba(0, 0, 0, 0.05);
}

.company-logo-preview,
.company-mascot-preview {
    width: 100%;
    min-height: 100px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.company-logo-preview img,
.company-mascot-preview img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
}

.company-logo-preview span,
.company-mascot-preview span {
    font-size: 11px;
    color: var(--text-main);
    text-align: center;
    padding: 10px;
}

.company-logo-preview.has-image img,
.company-mascot-preview.has-image img {
    display: block;
}

.company-logo-preview.has-image span,
.company-mascot-preview.has-image span {
    display: none;
}

.company-logo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.company-logo-actions .btn {
    width: 100%;
    justify-content: center;
    padding-inline: 10px;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .company-logo-actions {
        grid-template-columns: 1fr;
    }
}

.company-profile-block.company-profile-has-logo {
    gap: 6px;
}

.company-profile-assets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.company-profile-logo {
    display: block;
    max-width: 92px;
    max-height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.company-profile-mascot {
    display: block;
    max-width: 76px;
    max-height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.company-profile-text {
    width: 100%;
}

.setting-item select,
.setting-item input[type="range"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-main);
}

.setting-item input[type="text"],
.setting-item input[type="password"],
.setting-item input[type="number"],
.setting-item textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-main);
}

.setting-item input[type="text"]::placeholder,
.setting-item input[type="password"]::placeholder,
.setting-item input[type="number"]::placeholder,
.setting-item textarea::placeholder,
.search-container input::placeholder {
    color: color-mix(in srgb, var(--text-main) 78%, var(--text-bright) 22%);
    opacity: 1;
}

.setting-item p {
    margin: 0;
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
}

.font-picker-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.font-picker-inline select {
    flex: 1;
    min-width: 0;
}

.font-picker-inline .btn {
    flex: 0 0 auto;
    width: 42px;
    min-width: 42px;
    justify-content: center;
}

@media (max-width: 640px) {
    .font-picker-inline {
        align-items: stretch;
    }

    .font-picker-inline select {
        flex-basis: 100%;
    }
}

.font-picker-group {
    gap: 10px;
}

.font-picker-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.font-picker-select {
    flex: 1;
    min-width: 0;
}

.font-download-btn {
    width: 42px;
    min-width: 42px;
    justify-content: center;
}

.font-picker-note {
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.4;
}

.btn-group-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.printer-status-card {
    gap: 16px;
}

.printer-status-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.printer-status-chip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.printer-status-chip span {
    font-size: 11px;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.printer-status-chip strong {
    color: var(--text-main);
    font-size: 14px;
}

.printer-status-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.printer-status-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.2s ease;
}

.printer-status-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.printer-status-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.45;
}

.printer-status-checklist-item.is-done {
    border-color: rgba(0, 123, 255, 0.22);
    background: rgba(0, 123, 255, 0.08);
}

.printer-status-checklist-item i {
    color: var(--accent-secondary);
    font-size: 18px;
    margin-top: 1px;
}

.driver-center-modal {
    max-width: 860px;
    width: 100%;
}

.driver-center-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.driver-center-summary-chip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.driver-center-summary-chip span {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.driver-center-summary-chip strong {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.45;
}

.driver-center-intro {
    margin: 0 0 14px;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.5;
}

.driver-center-visual-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.driver-center-states {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.driver-center-state-card {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 198px;
}

.driver-center-state-card.is-active {
    border-color: rgba(0, 123, 255, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.08) inset;
}

.driver-center-state-figure {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 4px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(95, 211, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.driver-center-state-figure svg {
    display: block;
}

.driver-center-state-card i {
    font-size: 22px;
}

.driver-center-state-card strong {
    color: var(--text-main);
    font-size: 13px;
}

.driver-center-state-card span {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.45;
}

.driver-center-actions-palette {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.driver-center-action-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    min-height: 86px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}

.driver-center-action-chip i {
    font-size: 20px;
    color: var(--accent-secondary);
}

.driver-center-action-chip span {
    font-size: 10px;
    line-height: 1.3;
    color: var(--text-main);
}

.driver-center-grid {
    display: grid;
    gap: 14px;
}

.driver-center-empty {
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    text-align: center;
}

.driver-center-card {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.driver-center-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.driver-center-kicker {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.driver-center-card h4 {
    margin: 0;
    font-size: 18px;
    color: var(--text-bright);
}

.driver-center-badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 123, 255, 0.12);
    color: var(--accent-secondary);
    font-size: 11px;
    white-space: nowrap;
}

.driver-center-copy {
    margin: 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.5;
}

.driver-center-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.driver-center-note {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 11px;
}

.driver-center-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.driver-download-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-download-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.driver-download-row strong {
    display: block;
    font-size: 13px;
    color: var(--text-main);
}

.driver-download-row span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-dim);
    word-break: break-word;
}

@media (max-width: 720px) {
    .driver-center-summary {
        grid-template-columns: 1fr;
    }

    .driver-center-state-card {
        min-height: 170px;
    }

    .driver-center-states {
        grid-template-columns: 1fr 1fr;
    }

    .driver-center-actions-palette {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .driver-download-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .driver-download-row .btn {
        width: 100%;
    }
}

.printer-status-checklist-item strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    margin-bottom: 3px;
}

.printer-status-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.info-content {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
}

.badge-pro {
    display: inline-block;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
    }

    .sidebar {
        width: 100%;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        gap: 14px;
    }

    .logo-container,
    .sidebar-footer,
    .editor-sidebar-tree-shell {
        display: none;
    }

    .nav-links {
        flex: none;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .nav-links li,
    .nav-editor-item {
        flex: 0 0 auto;
    }

    .nav-links a {
        min-height: 46px;
        padding: 10px 14px;
        white-space: nowrap;
    }

    .main-content {
        min-width: 0;
        overflow: visible;
    }

    .top-bar {
        height: auto;
        padding: 14px 16px;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .search-container {
        width: 100%;
        flex: 1 1 100%;
    }

    #section-editor {
        height: auto;
        overflow: visible;
    }

    #section-editor.active {
        display: block !important;
    }

    .editor-workspace {
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 16px;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .toolset,
    .tag-assistant-dock,
    .editor-family-panel,
    .canvas-area,
    .properties-panel {
        width: 100%;
        min-width: 0;
    }

    .toolset {
        height: auto;
        max-height: none;
        min-width: 0;
        position: static;
        min-height: 0;
        top: auto;
        margin-left: 0;
        z-index: auto;
        transform: none;
        border-radius: var(--radius-lg);
        border-right: none;
        overflow: visible;
        box-shadow: var(--shadow-main);
        pointer-events: auto;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
            var(--bg-sidebar);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .toolset-toggle {
        display: inline-flex;
        top: 18px;
        left: auto;
        right: 18px;
        z-index: 12;
    }

    .toolset-header,
    .toolset-meta {
        padding-right: 72px;
    }

    .tag-assistant-dock {
        position: static;
        left: auto;
        top: auto;
        bottom: auto;
        max-height: none;
        min-width: 0;
        margin-top: 14px;
    }

    .tag-assistant-dock__body,
    .tag-assistant-box__scroll {
        max-height: none;
    }

    .toolset:not(.is-open) {
        pointer-events: auto;
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        min-height: 0;
        height: 0;
        max-height: 0;
        margin-bottom: 12px;
        overflow: visible;
    }

    .toolset-body {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .toolset:not(.is-open) .toolset-body {
        opacity: 0;
        visibility: hidden;
        min-height: 0;
        height: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .tool-btn span {
        display: none;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .canvas-area {
        flex: none;
        min-height: 0;
        padding: 0;
        overflow: visible;
    }

    .canvas-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-right: 0;
    }

    .history-controls {
        margin-right: 0;
        justify-content: flex-start;
    }

    .zoom-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .canvas-actions {
        width: 100%;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .canvas-actions>.btn,
    .canvas-actions>.print-group {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .properties-panel {
        position: static;
        width: 100%;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .thermal-paper-container {
        min-height: 420px;
        padding: 28px 16px;
    }

    .thermal-paper-container[data-editor-view-mode="infinite"] {
        padding-top: 48px;
        padding-bottom: 72px;
    }

    .thermal-paper {
        transform: scale(1.15);
    }

    .subscription-plans-grid {
        grid-template-columns: 1fr;
    }

    .stats-visuals {
        grid-template-columns: 1fr;
    }

    .ad-analytics-columns {
        grid-template-columns: 1fr;
    }

    .card-strategy-grid {
        grid-template-columns: 1fr;
    }
}

/* --- TEMPLATES MODAL --- */
.templates-modal {
    max-width: 800px;
    width: 90%;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.template-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.template-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.template-preview {
    width: 100%;
    aspect-ratio: 1;
    background: white;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    padding: 10px;
}

@media (max-width: 980px) {
    .canvas-actions>.btn,
    .canvas-actions>.print-group {
        flex-basis: 100%;
    }

    .print-group {
        width: 100%;
    }

    .print-group .printer-quick-select,
    .print-group .btn-primary {
        flex: 1 1 0;
    }

    .thermal-paper {
        transform: scale(1);
    }

    .qr-editor-layout {
        grid-template-columns: 1fr;
    }

    .qr-editor-preview-panel {
        order: -1;
    }

    .quick-generator-layout {
        grid-template-columns: 1fr;
    }

    .quick-generator-preview-card {
        position: static;
    }

    .product-qr-modal-layout {
        grid-template-columns: 1fr;
    }

    .product-qr-modal-preview {
        min-height: 190px;
    }
}

@media (max-width: 640px) {
    .sidebar,
    .top-bar,
    .editor-workspace {
        padding-left: 12px;
        padding-right: 12px;
    }

    .toolset-body,
    .properties-panel {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-btn {
        min-height: 76px;
    }

    .thermal-paper-container {
        padding: 20px 10px;
        min-height: 340px;
    }

    .quick-generator-actions,
    .quick-generator-grid {
        grid-template-columns: 1fr;
    }

    .quick-generator-modal {
        width: 96vw;
        padding: 22px;
    }
}

.save-model-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.save-model-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 10px 14px;
    outline: none;
}

.save-model-btn {
    width: 100%;
    justify-content: center;
}

.model-card-cover {
    width: 100%;
    height: 88px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.model-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.ganging-project-cover {
    width: 100%;
    height: 72px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ganging-project-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.ganging-project-code {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-main);
}

/* Previews Esquemáticos */
.price-tag::after {
    content: 'R$ 0,00';
    position: absolute;
    bottom: 10%;
    right: 10%;
    color: #000;
    font-weight: bold;
    font-size: 10px;
}

.price-tag::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 40%;
    height: 5px;
    background: #000;
    box-shadow: 0 10px 0 #000;
}

.validity-tag::before {
    content: 'VALIDADE';
    position: absolute;
    top: 10%;
    left: 10%;
    color: #000;
    font-size: 8px;
    font-weight: bold;
}

.validity-tag::after {
    content: '00/00/00';
    position: absolute;
    bottom: 10%;
    left: 10%;
    color: #000;
    font-size: 10px;
}

.shipping-tag::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 1px solid #000;
}

.shipping-tag::after {
    content: 'DESTINATÁRIO';
    position: absolute;
    top: 20%;
    left: 20%;
    color: #000;
    font-size: 7px;
}

.clothing-tag::after {
    content: 'SIZE: L';
    position: absolute;
    bottom: 10%;
    right: 10%;
    color: #000;
    font-size: 8px;
    border: 1px solid #000;
    padding: 2px;
}

.clothing-tag::before {
    content: 'BRAND';
    position: absolute;
    top: 10%;
    left: 10%;
    color: #000;
    font-weight: bold;
    font-size: 8px;
}

.event-tag::after {
    content: '[QR]';
    position: absolute;
    bottom: 10%;
    right: 10%;
    color: #000;
    font-size: 8px;
}

.event-tag::before {
    content: 'GUEST';
    position: absolute;
    top: 40%;
    left: 10%;
    color: #000;
    font-weight: bold;
    font-size: 10px;
}

.inventory-tag::before {
    content: 'CODE: 12345';
    position: absolute;
    top: 10%;
    left: 10%;
    color: #000;
    font-size: 7px;
}

.discount-tag::after {
    content: '50% OFF';
    position: absolute;
    top: 25%;
    left: 15%;
    background: #000;
    color: #fff;
    padding: 2px 5px;
    font-weight: bold;
    font-size: 10px;
}

.template-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

/* LICENÇA */
.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
}

.license-card {
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.license-card.activated {
    border-color: var(--accent-primary);
    background: rgba(0, 255, 140, 0.05);
}

.license-card h3 i {
    color: #ffd700;
}

/* --- CAMADAS (LAYERS) --- */
#layersList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-secondary);
}

.layer-item.active {
    background: rgba(0, 255, 140, 0.05);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(0, 255, 140, 0.1);
}

.layer-item i {
    font-size: 18px;
    color: var(--text-dim);
}

.layer-item.active i {
    color: var(--accent-secondary);
}

.layer-item span {
    flex: 1;
    font-size: 13px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-controls {
    display: flex;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-controls {
    opacity: 1;
}

.layer-controls i {
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.layer-controls i:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-bright);
}

.layer-controls .ph-trash:hover {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

.layer-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-secondary);
}

/* --- IMPRESSÃO A4 PRO --- */
body.layer-dragging,
body.layer-dragging * {
    cursor: grabbing !important;
}

#labelContent.is-layer-drop-target {
    outline: 2px dashed var(--accent-secondary);
    outline-offset: -8px;
    box-shadow: inset 0 0 0 1px rgba(0, 255, 140, 0.18);
}

.a4-paper {
    width: 210mm;
    height: 297mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 10mm;
    /* Margem de segurança de impressora */
    box-sizing: border-box;
    transform-origin: top center;
}

.a4-item {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Marcas de Corte */
.a4-item.crop-marks::before,
.a4-item.crop-marks::after {
    content: '';
    position: absolute;
    background: #ccc;
    z-index: 10;
}

/* Cantos */
.crop-marks .crop-tl {
    position: absolute;
    top: -5mm;
    left: 0;
    width: 1px;
    height: 4mm;
    background: #ccc;
}

.crop-marks .crop-tl-h {
    position: absolute;
    top: 0;
    left: -5mm;
    width: 4mm;
    height: 1px;
    background: #ccc;
}

.crop-marks .crop-tr {
    position: absolute;
    top: -5mm;
    right: 0;
    width: 1px;
    height: 4mm;
    background: #ccc;
}

.crop-marks .crop-tr-h {
    position: absolute;
    top: 0;
    right: -5mm;
    width: 4mm;
    height: 1px;
    background: #ccc;
}

.crop-marks .crop-bl {
    position: absolute;
    bottom: -5mm;
    left: 0;
    width: 1px;
    height: 4mm;
    background: #ccc;
}

.crop-marks .crop-bl-h {
    position: absolute;
    bottom: 0;
    left: -5mm;
    width: 4mm;
    height: 1px;
    background: #ccc;
}

.crop-marks .crop-br {
    position: absolute;
    bottom: -5mm;
    right: 0;
    width: 1px;
    height: 4mm;
    background: #ccc;
}

.crop-marks .crop-br-h {
    position: absolute;
    bottom: 0;
    right: -5mm;
    width: 4mm;
    height: 1px;
    background: #ccc;
}

/* Media Query de Impressão */
@media print {

    /* Oculta tudo... */
    body * {
        visibility: hidden;
    }

    /* Força background branco de fato no root (alguns navegadores requerem no html/body) */
    html,
    body {
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ...exceto a folha e seus filhos */
    #layoutA4Modal,
    #layoutA4Modal *,
    .a4-paper,
    .a4-paper * {
        visibility: visible;
    }

    /* Posiciona a folha no topo/esquerda realocando todo o layout do modal pro cantinho */
    #layoutA4Modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: transparent !important;
        display: block !important;
        /* Desfaz o flex do modal no print */
    }

    .a4-preview-container {
        /* Tira fundo escuro, padding, etc */
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: visible !important;
        border: none !important;
    }

    .a4-paper {
        margin: 0 !important;
        box-shadow: none !important;
        transform: scale(1) !important;
        /* Sem zoom! */
        /* Deixe que o flex cuide dos itens */
    }
}

/* ============================================================
   SLIDERS (input range) personalização
   ============================================================ */
.slider-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-hover);
}

.slider-group input[type="number"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    padding: 2px;
    font-size: 13px;
    font-weight: 500;
}

.slider-group input[type="number"]:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* --- ALINHAMENTO E GRUPOS --- */
.align-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.align-grid .btn {
    padding: 8px !important;
    justify-content: center;
}

.align-grid .btn span {
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
}

.align-grid .btn i {
    font-size: 18px;
}

.align-grid-3x3 .btn {
    min-height: 42px;
    padding: 6px !important;
}

.btn-group-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-danger {
    background: rgba(255, 77, 77, 0.1) !important;
    color: #ff4d4d !important;
    border: 1px solid rgba(255, 77, 77, 0.2) !important;
}

.btn-danger:hover {
    background: #ff4d4d !important;
    color: white !important;
}

.align-grid .btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* ============================================================ 
   SISTEMA DE AJUDA E ASSISTENTE
   ============================================================ */

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    border-radius: 50%;
    font-size: 10px;
    cursor: help;
    margin-left: 6px;
    transition: all 0.2s;
}

.help-icon:hover {
    background: var(--accent-primary);
    color: white;
}

/* Tooltip Customizado */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: pre-wrap;
    width: 180px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
}

/* Menu de Auto-complete (Tags) */
.autocomplete-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    min-width: 200px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(0, 123, 255, 0.2);
}

.autocomplete-item strong {
    color: var(--accent-primary);
}

.autocomplete-item span {
    font-size: 11px;
    color: var(--text-dim);
}

/* Caixa de Assistente de Tags */
.tag-assistant-box {
    margin-top: 10px;
    background: rgba(0, 123, 255, 0.05);
    border: 1px dashed var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.tag-assistant-box h4 {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-assistant-subtitle {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.35;
}

.tag-assistant-footer {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 10px;
    line-height: 1.35;
}

.tag-assistant-footer code,
.tag-assistant-subtitle code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-primary);
}

.tag-assistant-box--dock {
    margin-top: 0;
    min-height: 0;
    background: transparent;
    border: none;
    padding: 0;
}

.tag-assistant-box--dock h4 {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}

.tag-assistant-status {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.4;
}

.tag-assistant-status.is-active {
    color: var(--text-main);
    border-color: rgba(var(--accent-primary-rgb), 0.26);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.tag-assistant-box__scroll {
    max-height: 190px;
    overflow: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.tag-assistant-box__scroll::-webkit-scrollbar {
    width: 8px;
}

.tag-assistant-box__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tag-assistant-box__scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.tag-group {
    margin-top: 10px;
}

.tag-group-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.tag-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 1 100%;
    min-width: 0;
    padding: 10px 11px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    color: var(--text-main);
    appearance: none;
}

.tag-card:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

.tag-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.tag-card-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.35;
}

.tag-card-code {
    font-size: 10px;
    color: var(--accent-primary);
    background: rgba(0, 123, 255, 0.08);
    border: 1px solid rgba(0, 123, 255, 0.14);
    border-radius: 999px;
    padding: 2px 6px;
}

/* Guia Geral Modal */
.guide-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.guide-section {
    margin-bottom: 24px;
}

.guide-section h4 {
    color: var(--accent-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.guide-item i {
    font-size: 20px;
    color: var(--accent-secondary);
    margin-top: 2px;
}

.guide-item div b {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.guide-item div p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.printer-assistant-steps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.printer-assistant-step {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.printer-assistant-step.is-active {
    border-color: var(--accent-primary);
    color: var(--text-main);
    background: rgba(0, 123, 255, 0.12);
}

.printer-assistant-body {
    min-height: 360px;
}

.printer-assistant-panel {
    display: none;
}

.printer-assistant-panel.is-active {
    display: block;
}

.printer-assistant-panel h4 {
    margin: 0 0 10px;
    color: var(--text-main);
}

.printer-assistant-copy {
    margin: 0 0 18px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.5;
}

.printer-assistant-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.printer-choice-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    text-align: left;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.printer-choice-card i {
    font-size: 22px;
    color: var(--accent-secondary);
}

.printer-choice-card strong {
    font-size: 14px;
}

.printer-choice-card span {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.45;
}

.printer-choice-card:hover,
.printer-choice-card.is-active {
    border-color: var(--accent-primary);
    background: rgba(0, 123, 255, 0.10);
    transform: translateY(-1px);
}

.printer-assistant-custom-box {
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.printer-assistant-custom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.printer-assistant-custom-row label {
    font-size: 12px;
    color: var(--text-dim);
}

.printer-assistant-custom-row input {
    width: 110px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 8px 10px;
}

.printer-assistant-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.printer-assistant-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.printer-assistant-progress span {
    font-size: 12px;
    color: var(--text-dim);
}

.printer-assistant-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.printer-assistant-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.2s ease;
}

.printer-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.printer-summary-row span {
    color: var(--text-dim);
    font-size: 12px;
}

.printer-summary-row strong {
    color: var(--text-main);
    font-size: 13px;
}

.printer-assistant-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.printer-assistant-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
}

.printer-assistant-checklist-item.is-done {
    border-color: rgba(0, 123, 255, 0.22);
    background: rgba(0, 123, 255, 0.08);
}

.printer-assistant-checklist-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent-primary);
}

.printer-assistant-checklist-icon {
    color: var(--accent-secondary);
    font-size: 18px;
    margin-top: 1px;
}

.printer-assistant-checklist-item strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    margin-bottom: 3px;
}

.printer-assistant-footer {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.printer-assistant-footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .printer-assistant-choice-grid {
        grid-template-columns: 1fr;
    }

    .printer-assistant-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .printer-assistant-footer-actions {
        width: 100%;
    }

    .printer-assistant-footer-actions .btn,
    .printer-assistant-footer>.btn {
        width: 100%;
    }
}

/* Grade de Alinhamento e Multi-seleção */
.align-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.align-grid .btn-secondary {
    background-color: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    justify-content: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
}

.align-grid .btn-secondary:hover {
    background-color: #e0e0e0 !important;
    border-color: #ccc !important;
    transform: scale(1.02);
}

.align-grid .btn-secondary i {
    font-size: 20px;
}

/* Destaque para multi-seleção */
.element.multi-selected {
    border: 2px solid var(--accent-primary) !important;
    background-color: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

/* Correção de botões no painel properties */
.dynamic-controls .property-group label {
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================================
   ESTÚDIO DE IMPRESSÃO A4
   ============================================================ */

/* Container de preview dentro do modal */
.a4-preview-container {
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-lg);
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px;
    position: relative;
}

.ganging-sidebar-header {
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ganging-sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: var(--text-bright);
    margin: 0;
}

.ganging-sidebar-subtitle {
    font-size: 10px;
    color: var(--text-dim);
    margin: -2px 0 0;
}

.ganging-search-box {
    width: 100%;
    margin-top: 0;
    padding: 0 12px;
    min-height: 36px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(14, 8, 5, 0.28), rgba(0, 0, 0, 0.18));
    border: 1px solid rgba(244, 162, 89, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ganging-search-box:focus-within {
    border-color: rgba(244, 162, 89, 0.5);
    background: linear-gradient(180deg, rgba(20, 11, 6, 0.42), rgba(0, 0, 0, 0.18));
    box-shadow: 0 0 0 3px rgba(244, 162, 89, 0.12);
}

.ganging-search-box i {
    color: #f4c089;
    font-size: 15px;
}

.ganging-search-box input {
    font-size: 12px;
    color: var(--text-bright);
}

.ganging-search-box input::placeholder {
    color: rgba(255, 236, 214, 0.42);
}

.ganging-board-status {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 190px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.ganging-board-status span {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ganging-board-status strong {
    font-size: 12px;
    color: var(--text-main);
    line-height: 1.35;
}

.subscription-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    gap: 14px;
    margin-top: 12px;
    align-items: start;
}

.subscription-plan-card {
    min-width: 0;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.subscription-plan-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.subscription-plan-head>div {
    min-width: 0;
}

.subscription-plan-kicker {
    display: inline-flex;
    margin-bottom: 4px;
    font-size: 10px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.subscription-plan-card h4 {
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
    color: var(--text-bright);
    word-break: break-word;
}

.subscription-price-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.12);
}

.subscription-price-row strong {
    font-size: 12px;
    color: var(--text-main);
    min-width: 0;
}

.subscription-price-row span {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-secondary);
    white-space: nowrap;
    justify-self: end;
}

@media (max-width: 520px) {
    .subscription-plans-grid {
        grid-template-columns: 1fr;
    }

    .subscription-price-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .subscription-price-row span {
        justify-self: start;
    }
}

.ganging-free-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
}

.ganging-free-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.ganging-free-editor-kicker {
    display: inline-flex;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.ganging-free-editor-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-bright);
}

.ganging-free-editor-head p,
.ganging-free-editor-note {
    margin: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.ganging-free-editor-actions,
.ganging-free-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ganging-free-editor-toolbar {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-chip:hover,
.tool-chip.is-active {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.48);
    box-shadow: 0 10px 20px rgba(var(--accent-primary-rgb), 0.12);
}

.tool-chip i {
    font-size: 15px;
}

.shape-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 16px;
}

.line-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 16px;
}

.shape-library-modal {
    max-width: 560px;
    width: min(96vw, 560px);
    max-height: 92vh;
    overflow: auto;
}

.shape-library-btn {
    min-height: 112px;
}

.line-library-btn {
    min-height: 108px;
}

.shape-library-btn svg {
    width: 38px;
    height: 38px;
    display: block;
}

.shape-library-btn span {
    font-size: 10px;
    line-height: 1.25;
    text-align: center;
}

.line-library-preview {
    min-height: 34px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-library-preview span {
    display: block;
    max-width: 100%;
}

.line-library-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.line-library-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.line-library-control label {
    font-size: 11px;
    color: var(--text-dim);
}

.line-library-control select,
.line-library-control input[type="range"],
.line-library-control input[type="color"] {
    width: 100%;
}

.shape-library-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.shape-library-tool-btn {
    min-height: 84px;
}

.shape-library-tool-btn i {
    font-size: 22px;
}

.shape-library-note {
    min-height: 92px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.02);
}

.shape-library-note strong {
    color: var(--text-main);
    font-size: 13px;
}

.shape-library-note span {
    font-size: 12px;
    line-height: 1.5;
}

.ganging-free-editor-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.ganging-free-editor-control label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ganging-free-editor-control select,
.ganging-free-editor-control input[type="range"],
.ganging-free-editor-control input[type="color"] {
    width: 100%;
}

.ganging-toolbar select#gangingViewMode {
    min-width: 180px;
}

.ganging-print-page {
    page-break-after: always;
    break-after: page;
}

.ganging-print-page:last-child {
    page-break-after: auto;
    break-after: auto;
}

.ganging-print-page-label {
    font-size: 10px;
}

#a4PreviewScale {
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* Folha A4 branca */
.a4-paper {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 10mm;
    gap: 0;
    position: relative;
    box-sizing: border-box;
}

/* Cada etiqueta dentro da folha */
.a4-item {
    position: relative;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Marcas de corte nos cantos */
.a4-item.crop-marks {
    position: relative;
}

.crop-tl,
.crop-tr,
.crop-bl,
.crop-br {
    position: absolute;
    width: 4mm;
    height: 4mm;
    z-index: 10;
    pointer-events: none;
}

.crop-tl-h,
.crop-tr-h,
.crop-bl-h,
.crop-br-h {
    position: absolute;
    width: 4mm;
    height: 4mm;
    z-index: 10;
    pointer-events: none;
}

/* Canto superior esquerdo — vertical */
.crop-tl {
    top: 0;
    left: 0;
    border-top: 0.5px solid #555;
    border-left: 0.5px solid #555;
}

/* Canto superior esquerdo — horizontal (deslocado para fora) */
.crop-tl-h {
    top: -4mm;
    left: 0;
    border-top: 0.5px solid #555;
    width: 4mm;
    height: 0;
}

/* Canto superior direito — vertical */
.crop-tr {
    top: 0;
    right: 0;
    border-top: 0.5px solid #555;
    border-right: 0.5px solid #555;
}

.crop-tr-h {
    top: -4mm;
    right: 0;
    border-top: 0.5px solid #555;
    width: 4mm;
    height: 0;
}

/* Canto inferior esquerdo — vertical */
.crop-bl {
    bottom: 0;
    left: 0;
    border-bottom: 0.5px solid #555;
    border-left: 0.5px solid #555;
}

.crop-bl-h {
    bottom: -4mm;
    left: 0;
    border-bottom: 0.5px solid #555;
    width: 4mm;
    height: 0;
}

/* Canto inferior direito — vertical */
.crop-br {
    bottom: 0;
    right: 0;
    border-bottom: 0.5px solid #555;
    border-right: 0.5px solid #555;
}

.crop-br-h {
    bottom: -4mm;
    right: 0;
    border-bottom: 0.5px solid #555;
    width: 4mm;
    height: 0;
}

/* Caixa de informação dentro do painel de controles */
.a4-info-box {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: rgba(0, 123, 255, 0.06);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: auto;
}

.a4-info-box i {
    color: var(--accent-secondary);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Seletor e inputs dentro da coluna de controles */
.a4-controls .setting-item select,
.a4-controls .setting-item input[type="number"],
.a4-controls .setting-item input[type="range"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 7px 10px;
    outline: none;
    font-size: 13px;
    transition: border-color 0.2s;
}

.a4-controls .setting-item select:focus,
.a4-controls .setting-item input[type="number"]:focus {
    border-color: var(--accent-primary);
}

.a4-controls .setting-item input[type="range"] {
    padding: 8px 0;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.a4-controls .setting-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   GRUPO DE IMPRESSÃO (seletor + botão lado a lado)
   ============================================================ */
.print-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.4);
}

/* Seletor compacto de impressora */
.printer-quick-select {
    background: rgba(0, 90, 200, 0.18);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    padding: 0 10px;
    cursor: pointer;
    outline: none;
    min-width: 110px;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    transition: background 0.2s;
}

.printer-quick-select:hover {
    background-color: rgba(0, 123, 255, 0.2);
}

.printer-quick-select option {
    background: #161b26;
    color: var(--text-main);
    font-size: 13px;
}

/* Botão Imprimir quando está dentro do grupo */
.print-group .btn-primary {
    border-radius: 0;
    box-shadow: none;
}

/* Arredonda o lado esquerdo do select e o lado direito do botão */
.print-group .printer-quick-select {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.print-group .btn-primary {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

@media print {

    /* Oculta tudo... */
    body>*,
    .sidebar,
    .main-content,
    .top-bar,
    .preview-exit-btn,
    .modal-overlay:not(#layoutA4Modal),
    .toolset,
    .properties-panel {
        display: none !important;
    }

    /* ...mas mostra o modal A4 */
    body.a4-print-mode #layoutA4Modal {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: #fff !important;
        z-index: 99999 !important;
        padding: 0 !important;
    }

    body.a4-print-mode #layoutA4Modal .modal-content {
        box-shadow: none !important;
        background: #fff !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
    }

    body.a4-print-mode #layoutA4Modal .modal-header,
    body.a4-print-mode #layoutA4Modal .a4-controls {
        display: none !important;
    }

    body.a4-print-mode #layoutA4Modal .a4-studio-body {
        display: block !important;
    }

    body.a4-print-mode #layoutA4Modal .a4-preview-container {
        background: #fff !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.a4-print-mode #a4PreviewScale {
        transform: none !important;
    }

    body.a4-print-mode .a4-paper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
    }

    body.a4-print-mode .measurement-overlay {
        display: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 4mm;
    }
}

/* ============================================================
   MONTAGEM LIVRE A4 (GANGING)
   ============================================================ */
.ganging-project-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 8px 9px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.ganging-project-card:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
    transform: translateY(-2px);
}

.ganging-project-card:active {
    cursor: grabbing;
}

.ganging-project-card h4 {
    font-size: 12px;
    margin: 0;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ganging-project-card p {
    font-size: 10px;
    margin: 0;
    color: var(--text-dim);
}

.ganging-item-dragger {
    position: absolute;
    cursor: move;
    border: 1px rgba(0, 0, 0, 0.1) solid;
    transition: box-shadow 0.2s;
    user-select: none;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.ganging-item-dragger:hover {
    box-shadow: 0 0 0 2px var(--accent-primary);
    z-index: 100;
}

.ganging-item-dragger.dragging {
    opacity: 0.8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.ganging-item-dragger.is-selected {
    box-shadow: 0 0 0 2px var(--accent-secondary), 0 10px 28px rgba(0, 0, 0, 0.22);
    z-index: 120;
}

.ganging-item-dragger.is-resizing {
    box-shadow: 0 0 0 2px var(--accent-primary), 0 16px 34px rgba(0, 0, 0, 0.26);
    z-index: 160;
}

.ganging-item-dragger .ganging-del-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(255, 77, 77, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 110;
    border: 2px solid #fff;
}

.ganging-item-dragger:hover .ganging-del-btn {
    opacity: 1;
    transform: scale(1.1);
}

.ganging-item-dragger .ganging-resize-handle {
    position: absolute;
    right: -11px;
    bottom: -11px;
    width: 26px;
    height: 26px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 74%, #ffffff 26%));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    opacity: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    z-index: 140;
}

.ganging-item-dragger .ganging-resize-handle i {
    font-size: 12px;
    pointer-events: none;
}

.ganging-item-dragger:hover .ganging-resize-handle,
.ganging-item-dragger.is-selected .ganging-resize-handle,
.ganging-item-dragger.is-resizing .ganging-resize-handle {
    opacity: 1;
}

.ganging-item-dragger .ganging-resize-handle:hover,
.ganging-item-dragger.is-resizing .ganging-resize-handle {
    transform: scale(1.08);
    box-shadow: 0 10px 20px rgba(var(--accent-primary-rgb), 0.32);
}

.ganging-item-dragger .inner-label-container {
    pointer-events: auto;
    /* Permite edição em textos e ainda deixa o wrapper captar o arraste */
}

.ganging-item-dragger .label-text[contenteditable="true"] {
    pointer-events: auto;
    cursor: text;
    outline: none;
}

.ganging-item-dragger .label-drawing,
.ganging-item-dragger .label-shape {
    pointer-events: none;
}

@media print {
    body.ganging-print-mode>* {
        display: none !important;
    }

    body.ganging-print-mode #section-ganging {
        display: flex !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.ganging-print-mode #section-ganging .ganging-sidebar,
    body.ganging-print-mode #section-ganging .ganging-toolbar {
        display: none !important;
    }

    body.ganging-print-mode #section-ganging .ganging-workspace {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.ganging-print-mode #section-ganging .ganging-board-container {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    body.ganging-print-mode .a4-free-board {
        box-shadow: none !important;
        margin: 0 !important;
        page-break-after: avoid !important;
        width: 210mm !important;
        height: 297mm !important;
        overflow: hidden !important;
    }

    body.ganging-print-mode .ganging-del-btn {
        display: none !important;
    }

    body.ganging-print-mode .ganging-item-dragger {
        border: none !important;
    }

    body.ganging-print-mode .measurement-overlay {
        display: none !important;
    }

    body.ganging-print-mode .ganging-item-dragger * {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    body.ganging-print-mode .ganging-print-page-label {
        display: block !important;
    }
}

/* --- RANDOMIZADOR E GERADOR --- */
.btn-randomize {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    padding: 2px;
    transition: transform 0.2s;
    vertical-align: middle;
}

.btn-randomize:hover {
    transform: rotate(20deg) scale(1.2);
    color: var(--accent-secondary);
}

.input-group-with-btn {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-group-with-btn input {
    flex: 1;
}

.btn-icon-square {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-primary-rgb), 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-square:hover {
    background: var(--accent-primary);
    color: white;
}

/* --- MODELOS SALVOS (GALERIA) --- */
.saved-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding: 10px 0;
}

.saved-models-modal-content {
    width: min(920px, 94vw);
    max-width: 920px;
}

.saved-models-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 4px;
    flex-wrap: wrap;
}

.saved-models-search {
    flex: 1;
    min-width: 240px;
}

.saved-models-batch-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 10px;
    flex-wrap: wrap;
}

.saved-models-batch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.saved-model-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
    cursor: pointer;
}

.saved-model-toggle input {
    accent-color: var(--accent-primary);
}

.saved-model-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.saved-model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.saved-model-tag-filters {
    margin-top: 2px;
}

.saved-model-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.18s ease;
}

.saved-model-tag:hover,
.saved-model-tag.is-active {
    color: var(--text-main);
    border-color: rgba(var(--accent-primary-rgb), 0.32);
    background: rgba(var(--accent-primary-rgb), 0.14);
}

.saved-model-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 6px;
}

.saved-model-filter-chip {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.saved-model-filter-chip:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.28);
    color: var(--text-main);
}

.saved-model-filter-chip.active {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.16);
    color: var(--accent-secondary);
}

.saved-model-highlights {
    display: grid;
    gap: 14px;
    margin: 6px 0 2px;
}

.saved-model-folders {
    display: none;
}

.saved-model-folder-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb), 0.12), rgba(255, 255, 255, 0.03));
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-model-folder-card:hover,
.saved-model-folder-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.saved-model-folder-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(var(--accent-primary-rgb), 0.18);
    color: var(--accent-secondary);
    font-size: 18px;
}

.saved-model-folder-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
}

.saved-model-folder-meta {
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.4;
}

.saved-model-highlight-section {
    display: grid;
    gap: 10px;
}

.saved-model-highlight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.saved-model-highlight-header h4 {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}

.saved-model-highlight-header span {
    font-size: 11px;
    color: var(--text-dim);
}

.saved-model-highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.saved-model-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.saved-model-section-title h4 {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}

.saved-model-section-title span {
    font-size: 11px;
    color: var(--text-dim);
}

.model-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.model-card h4 {
    font-size: 14px;
    margin: 0;
    color: var(--text-main);
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    min-height: 38px;
}

.model-card .model-meta {
    font-size: 10px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-card.is-selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb), 0.24), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.model-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.model-card-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.18s ease;
}

.model-card-select.is-active,
.model-card-select:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.34);
    color: var(--text-main);
    background: rgba(var(--accent-primary-rgb), 0.14);
}

.model-card .model-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-secondary);
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 700;
}

.model-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.btn-model-del,
.btn-model-fav,
.btn-model-pin,
.btn-model-edit {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-model-del:hover {
    background: #dc3545;
    color: white;
}

.btn-model-fav {
    background: rgba(255, 193, 7, 0.1);
    color: #f4c542;
}

.btn-model-pin {
    background: rgba(var(--accent-primary-rgb), 0.14);
    color: var(--accent-secondary);
}

.btn-model-edit {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-model-fav:hover,
.btn-model-fav.is-active {
    background: rgba(255, 193, 7, 0.22);
    color: #ffd86b;
}

.btn-model-pin:hover,
.btn-model-pin.is-active {
    background: rgba(var(--accent-primary-rgb), 0.24);
    color: #fff1d7;
}

.btn-model-edit:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.developer-ads-preview {
    display: grid;
    gap: 10px;
}

.ad-preview-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px;
}

.ad-preview-item.is-active {
    border-color: rgba(var(--accent-primary-rgb), 0.45);
    background: rgba(var(--accent-primary-rgb), 0.08);
}

.ad-preview-item.is-hidden {
    opacity: 0.72;
}

.ad-preview-item h4 {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-main);
}

.ad-preview-item p {
    margin: 0;
    font-size: 11px;
    color: var(--text-dim);
}

.ad-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-size: 10px;
}

.ad-preview-meta strong {
    color: var(--text-main);
    font-size: 11px;
}

.ad-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.ad-preview-badge.is-active {
    background: rgba(244, 162, 89, 0.16);
    color: #f4a259;
}

.ad-preview-badge.is-hidden {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

.upgrade-cta-card {
    --upgrade-accent: rgba(244, 162, 89, 0.9);
    --upgrade-accent-soft: rgba(244, 162, 89, 0.16);
    --upgrade-secondary-soft: rgba(0, 123, 255, 0.12);
    border: 1px solid rgba(244, 162, 89, 0.28);
    background:
        linear-gradient(135deg, var(--upgrade-accent-soft), var(--upgrade-secondary-soft)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    position: relative;
    overflow: hidden;
}

.upgrade-cta-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--upgrade-accent), transparent 82%);
    opacity: 0.95;
    pointer-events: none;
}

.upgrade-cta-copy {
    min-width: 0;
}

.upgrade-cta-card h4 {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--text-bright);
}

.upgrade-cta-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-main);
}

.upgrade-cta-meta {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.upgrade-cta-meta.is-warning {
    color: #f4a259;
}

.upgrade-cta-card .upgrade-cta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--upgrade-accent) 18%, transparent);
    color: color-mix(in srgb, var(--upgrade-accent) 84%, white 16%);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.upgrade-cta-card .btn.btn-primary {
    background: linear-gradient(135deg, color-mix(in srgb, var(--upgrade-accent) 82%, #ffffff 18%), color-mix(in srgb, var(--upgrade-accent) 55%, #8b5cf6 45%));
    border: none;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--upgrade-accent) 20%, transparent);
}

.upgrade-cta-card .btn.btn-primary:hover {
    filter: brightness(1.04);
}

.upgrade-cta-card .upgrade-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #ffd18f;
    font-size: 12px;
    font-weight: 700;
}

.ad-feedback-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 10px;
}

.ad-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ad-feedback-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.45);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.ad-feedback-btn.is-danger:hover {
    border-color: rgba(255, 90, 90, 0.5);
    background: rgba(255, 90, 90, 0.1);
}

.ad-feedback-btn i {
    font-size: 12px;
}

.ad-analytics-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ad-analytics-card {
    margin-top: 2px;
}

.ad-analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ad-analytics-summary-card {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ad-analytics-summary-card span {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ad-analytics-summary-card strong {
    font-size: 20px;
    color: var(--text-bright);
}

.ad-analytics-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ad-analytics-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-analytics-column h4 {
    margin: 0;
    font-size: 12px;
    color: var(--text-bright);
}

.ad-analytics-rank-item,
.ad-analytics-inline-row {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-analytics-rank-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ad-analytics-rank-item.is-muted {
    opacity: 0.72;
}

.ad-analytics-rank-item strong,
.ad-analytics-inline-row strong {
    display: block;
    color: var(--text-main);
    font-size: 11px;
    margin-bottom: 4px;
}

.ad-analytics-rank-item span,
.ad-analytics-inline-row span,
.ad-analytics-rank-item small,
.ad-analytics-inline-row small {
    display: block;
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.45;
}

.ad-analytics-rank-metrics {
    text-align: right;
    min-width: 76px;
}

.ad-analytics-empty {
    margin: 0;
    padding: 10px 0;
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.45;
}

.card-strategy-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-strategy-panel h4 {
    margin: 0;
    font-size: 12px;
    color: var(--text-bright);
}

.card-strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.card-strategy-item {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-strategy-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--text-main);
    text-transform: capitalize;
}

.card-strategy-item span,
.card-strategy-item small {
    display: block;
    color: var(--text-dim);
    font-size: 10px;
    line-height: 1.4;
}

.upgrade-cta-sidebar {
    margin-bottom: 14px;
}

.upgrade-cta-compact {
    margin-top: 18px;
    padding: 12px;
}

.upgrade-cta-compact h4 {
    font-size: 12px;
}

.upgrade-cta-compact p,
.upgrade-cta-inline p {
    font-size: 11px;
}

.upgrade-cta-inline {
    min-width: 220px;
    max-width: 360px;
    padding: 14px;
}

.upgrade-cta-topbar {
    --upgrade-accent: rgba(248, 187, 96, 0.95);
    --upgrade-accent-soft: rgba(248, 187, 96, 0.14);
    --upgrade-secondary-soft: rgba(153, 102, 255, 0.09);
    --upgrade-topbar-secondary: rgba(255, 214, 160, 0.12);
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
    padding: 2px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
    overflow: hidden;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    align-self: center;
    border-radius: 12px;
    background: rgba(17, 10, 6, 0.18);
    border-color: var(--upgrade-topbar-secondary);
}

.upgrade-cta-topbar::before {
    display: none;
}

.upgrade-cta-topbar .upgrade-cta-mini {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.05));
    border: 1px solid color-mix(in srgb, var(--upgrade-topbar-secondary) 75%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.upgrade-cta-topbar .upgrade-cta-mini::before {
    content: '';
    width: 2px;
    align-self: stretch;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--upgrade-accent), transparent 82%);
    opacity: 0.85;
}

.upgrade-cta-topbar .upgrade-cta-copy {
    display: block;
    overflow: hidden;
}

.upgrade-cta-topbar h4 {
    margin: 0;
    font-size: 9px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upgrade-cta-topbar p {
    display: none;
}

.upgrade-cta-topbar .upgrade-cta-tag {
    display: none;
}

.upgrade-cta-topbar .btn,
.upgrade-cta-topbar button {
    width: auto !important;
    min-width: 88px;
    margin-top: 0 !important;
    padding: 5px 8px;
    justify-content: center;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1;
    border-radius: 8px;
    box-shadow: none;
}

body.section-editor-active .upgrade-cta-topbar {
    --upgrade-accent: rgba(123, 208, 255, 0.96);
    --upgrade-accent-soft: rgba(123, 208, 255, 0.11);
    --upgrade-secondary-soft: rgba(88, 130, 255, 0.08);
    --upgrade-topbar-secondary: rgba(123, 208, 255, 0.12);
}

body.section-ganging-active .upgrade-cta-topbar {
    --upgrade-accent: rgba(94, 234, 212, 0.96);
    --upgrade-accent-soft: rgba(94, 234, 212, 0.12);
    --upgrade-secondary-soft: rgba(34, 197, 94, 0.08);
    --upgrade-topbar-secondary: rgba(94, 234, 212, 0.12);
}

body.section-history-active .upgrade-cta-topbar {
    --upgrade-accent: rgba(129, 140, 248, 0.96);
    --upgrade-accent-soft: rgba(129, 140, 248, 0.12);
    --upgrade-secondary-soft: rgba(59, 130, 246, 0.08);
    --upgrade-topbar-secondary: rgba(129, 140, 248, 0.12);
}

body.section-stats-active .upgrade-cta-topbar {
    --upgrade-accent: rgba(52, 211, 153, 0.96);
    --upgrade-accent-soft: rgba(52, 211, 153, 0.12);
    --upgrade-secondary-soft: rgba(16, 185, 129, 0.08);
    --upgrade-topbar-secondary: rgba(52, 211, 153, 0.12);
}

body.section-settings-active .upgrade-cta-topbar {
    --upgrade-accent: rgba(244, 162, 89, 0.96);
    --upgrade-accent-soft: rgba(244, 162, 89, 0.13);
    --upgrade-secondary-soft: rgba(255, 208, 138, 0.08);
    --upgrade-topbar-secondary: rgba(244, 162, 89, 0.12);
}

.upgrade-cta-sidebar,
.upgrade-cta-slot-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(17, 10, 6, 0.16);
    border-color: rgba(255, 214, 160, 0.1);
}

.upgrade-cta-sidebar {
    --upgrade-accent: rgba(255, 182, 72, 0.96);
    --upgrade-accent-soft: rgba(255, 182, 72, 0.14);
    --upgrade-secondary-soft: rgba(255, 113, 67, 0.1);
}

.upgrade-cta-slot-editor {
    --upgrade-accent: rgba(123, 208, 255, 0.96);
    --upgrade-accent-soft: rgba(123, 208, 255, 0.14);
    --upgrade-secondary-soft: rgba(88, 130, 255, 0.12);
}

.upgrade-cta-sidebar .btn,
.upgrade-cta-slot-editor .btn {
    width: 100%;
    justify-content: center;
    min-height: 32px;
    box-shadow: none;
}

.upgrade-cta-slot-ganging {
    --upgrade-accent: rgba(94, 234, 212, 0.94);
    --upgrade-accent-soft: rgba(94, 234, 212, 0.14);
    --upgrade-secondary-soft: rgba(34, 197, 94, 0.1);
    width: min(100%, 620px);
    align-self: flex-start;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 7px 10px;
    border-radius: 14px;
    background: rgba(17, 10, 6, 0.16);
    border-color: rgba(255, 214, 160, 0.1);
}

.upgrade-cta-slot-ganging .upgrade-cta-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.upgrade-cta-slot-ganging .upgrade-cta-tag {
    grid-column: 1 / -1;
    margin-bottom: 0;
    width: fit-content;
    padding: 3px 7px;
    font-size: 9px;
}

.upgrade-cta-slot-ganging .btn {
    width: auto !important;
    min-width: 134px;
    margin-top: 0 !important;
    justify-content: center;
    min-height: 32px;
    box-shadow: none;
}

.upgrade-cta-slot-database,
.upgrade-cta-slot-stats,
.upgrade-cta-slot-settings-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 290px);
    min-height: 42px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(17, 10, 6, 0.15);
    border-color: rgba(255, 214, 160, 0.1);
}

.upgrade-cta-slot-database {
    --upgrade-accent: rgba(129, 140, 248, 0.96);
    --upgrade-accent-soft: rgba(129, 140, 248, 0.14);
    --upgrade-secondary-soft: rgba(59, 130, 246, 0.1);
}

.upgrade-cta-slot-stats {
    --upgrade-accent: rgba(52, 211, 153, 0.95);
    --upgrade-accent-soft: rgba(52, 211, 153, 0.14);
    --upgrade-secondary-soft: rgba(16, 185, 129, 0.08);
}

.upgrade-cta-slot-settings-header,
.upgrade-cta-slot-settings-card-inner {
    --upgrade-accent: rgba(244, 162, 89, 0.95);
    --upgrade-accent-soft: rgba(244, 162, 89, 0.15);
    --upgrade-secondary-soft: rgba(255, 208, 138, 0.08);
}

.upgrade-cta-slot-database .upgrade-cta-tag,
.upgrade-cta-slot-stats .upgrade-cta-tag,
.upgrade-cta-slot-settings-header .upgrade-cta-tag {
    grid-column: 1 / -1;
    margin-bottom: 0;
    width: fit-content;
    padding: 2px 6px;
    font-size: 9px;
}

.upgrade-cta-slot-database .upgrade-cta-copy,
.upgrade-cta-slot-stats .upgrade-cta-copy,
.upgrade-cta-slot-settings-header .upgrade-cta-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.upgrade-cta-slot-database h4,
.upgrade-cta-slot-stats h4,
.upgrade-cta-slot-settings-header h4 {
    margin-bottom: 0;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upgrade-cta-slot-database p,
.upgrade-cta-slot-stats p,
.upgrade-cta-slot-settings-header p {
    font-size: 9px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upgrade-cta-slot-database .btn,
.upgrade-cta-slot-stats .btn,
.upgrade-cta-slot-settings-header .btn {
    width: auto !important;
    min-width: 98px;
    margin-top: 0 !important;
    justify-content: center;
    min-height: 30px;
    padding: 5px 8px;
    font-size: 9px;
    box-shadow: none;
}

.upgrade-settings-card {
    justify-content: center;
    min-height: 100%;
}

.upgrade-cta-nested {
    width: 100%;
}

.upgrade-cta-slot-settings-card-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(17, 10, 6, 0.14);
    border-color: rgba(255, 214, 160, 0.1);
}

.upgrade-cta-slot-settings-card-inner h4 {
    font-size: 13px;
}

.upgrade-cta-slot-settings-card-inner p {
    font-size: 10px;
}

.upgrade-cta-slot-settings-card-inner .btn {
    width: 100%;
    justify-content: center;
    min-height: 36px;
    box-shadow: none;
}

.upgrade-cta-sidebar h4,
.upgrade-cta-slot-editor h4,
.upgrade-cta-slot-ganging h4,
.upgrade-cta-slot-database h4,
.upgrade-cta-slot-stats h4,
.upgrade-cta-slot-settings-header h4,
.upgrade-cta-slot-settings-card-inner h4 {
    letter-spacing: -0.01em;
}

.upgrade-cta-sidebar p,
.upgrade-cta-slot-editor p,
.upgrade-cta-slot-ganging p,
.upgrade-cta-slot-database p,
.upgrade-cta-slot-stats p,
.upgrade-cta-slot-settings-header p,
.upgrade-cta-slot-settings-card-inner p {
    color: rgba(230, 237, 243, 0.78);
}

.upgrade-cta-slot-database .upgrade-cta-tag,
.upgrade-cta-slot-stats .upgrade-cta-tag,
.upgrade-cta-slot-settings-header .upgrade-cta-tag {
    display: none;
}

@media (max-width: 1580px) {
    .upgrade-cta-topbar {
        max-width: 620px;
    }
}

@media (max-width: 1380px) {
    .upgrade-cta-topbar {
        max-width: 420px;
    }

    .upgrade-cta-topbar .upgrade-cta-mini:last-child {
        display: none;
    }
}

@media (max-width: 1280px) {

    .upgrade-cta-slot-ganging,
    .upgrade-cta-slot-database,
    .upgrade-cta-slot-stats,
    .upgrade-cta-slot-settings-header {
        grid-template-columns: 1fr;
    }

    .upgrade-cta-slot-ganging .btn,
    .upgrade-cta-slot-database .btn,
    .upgrade-cta-slot-stats .btn,
    .upgrade-cta-slot-settings-header .btn {
        width: 100% !important;
    }
}

.upgrade-cta-card.preview-outline {
    border-style: dashed;
    border-color: rgba(110, 231, 255, 0.45);
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(244, 162, 89, 0.14));
    box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.16);
}

/* --- PERFIL COMERCIAL (BRANCH SELECTION) --- */
.profile-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 10px 0;
}

.branch-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.branch-card i {
    font-size: 32px;
    color: var(--accent-primary);
    transition: transform 0.3s;
}

.branch-card h4 {
    margin: 0;
    font-size: 15px;
}

.branch-card p {
    font-size: 11px;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.4;
}

.branch-customizer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.branch-customizer label {
    font-size: 12px;
    color: var(--text-dim);
    text-align: left;
    font-weight: 600;
}

.branch-customizer input {
    width: 100%;
    min-height: 38px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 9px 11px;
    color: var(--text-main);
}

.branch-customizer input:focus {
    outline: none;
    border-color: rgba(var(--accent-primary-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.12);
}

.branch-customizer p {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.45;
    text-align: left;
    margin: 0;
}

.branch-card:hover {
    background: rgba(var(--accent-primary-rgb), 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.branch-card:hover i {
    transform: scale(1.2);
}

.branch-card.active {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
    box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.2);
}

.badge-branch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    max-width: 100%;
    background: rgba(var(--accent-primary-rgb), 0.14);
    color: var(--text-bright);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    white-space: normal;
    line-height: 1.2;
    justify-content: center;
    text-align: center;
}

.badge-branch i {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--accent-secondary);
}
