@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* --- Profession CRM Palette (Light Theme) --- */

    /* Backgrounds */
    --bg-body: #f3f4f6;
    /* Light gray background for the app */
    --bg-surface: #ffffff;
    /* White cards/surfaces */
    --bg-input: #ffffff;
    --bg-hover: #f9fafb;
    /* Very light hover state */

    /* Sidebar (Dark) */
    --bg-sidebar: #111827;
    /* Darker Navy/Black base */
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --text-sidebar: #f3f4f6;
    --text-sidebar-muted: #9ca3af;

    /* Text */
    --text-main: #111827;
    /* Almost black */
    --text-secondary: #4b5563;
    /* Gray 600 */
    --text-muted: #9ca3af;
    /* Gray 400 */

    /* Borders */
    --border: #e5e7eb;
    /* Gray 200 */
    --border-focus: #6366f1;
    /* Indigo 500 */

    /* Brand / Accents (Professional) */
    --primary: #4f46e5;
    /* Indigo 600 - Professional & Trust */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --primary-text: #ffffff;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Decoration */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 8px;
    /* More concise radius */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    /* Professional compact size */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* --- Layout --- */

.app-body {
    display: flex;
    flex-direction: column;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar (Dark & Professional) */
.sidebar {
    width: 250px;
    /* Slightly narrower for conciseness */
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 8px;
}

.sidebar-title {
    font-size: 20px;
    /* Larger header */
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-sidebar-muted);
    cursor: pointer;
    font-size: 20px;
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    /* Slightly taller for comfort */
    border-radius: var(--radius);
    color: var(--text-sidebar-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    /* Slightly larger logic */
    transition: all 0.2s ease;
    margin-bottom: 4px;
    /* Space between items */
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    opacity: 0.8;
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(90deg, #2563eb 0%, #0891b2 100%);
    /* Blue to Cyan gradient */
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    /* Subtle glow */
    font-weight: 600;
}

.sidebar-link.active i {
    opacity: 1;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Main Content (Light) */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    width: 100%;
    min-width: 0;
}

.app-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.menu-button {
    display: none;
    background: transparent;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
}

.app-content {
    padding: 24px 32px;
    max-width: 1600px;
    /* Wider for more columns */
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 901px) {
    .app-content {
        margin-left: 5px;
        margin-right: 5px;
    }
}

/* --- Components --- */

/* Cards - Clean, White, Shadow-md */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.info-card,
.card,
.user-card,
.group-card,
.profile-card {
    background: var(--bg-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.category-page {
    width: 100%;
}

.info-card:hover,
.user-card:hover {
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s;
}

.info-label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 500;
}

.info-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.05em;
}

/* Forms - Concise, Professional */
.container {
    max-width: 400px;
    width: 100%;
    margin: 40px auto;
    padding: 24px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    background: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 16px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    /* Indigo glow */
}

input::placeholder {
    color: var(--text-muted);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    background: var(--primary);
    color: var(--primary-text);
    transition: background-color 0.2s;
    text-decoration: none;
    gap: 8px;
    line-height: 1.5;
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: transparent;
    border-color: var(--text-muted);
}

/* Settings Sidebar (Secondary) - Light/Gray to differ from Main Dark Sidebar */
.settings-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.settings-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 12px;
}

.settings-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.settings-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

.settings-link.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.settings-icon {
    width: 20px;
    display: inline-flex;
    justify-content: center;
    color: var(--text-muted);
}

.settings-link.active .settings-icon {
    color: var(--primary);
}

.settings-content {
    flex: 1;
    min-width: 0;
}

/* Grids & Tiles */
.users-grid,
.group-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.category-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1400px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.user-card p {
    color: var(--text-secondary);
}

/* Avatars */
.user-avatar,
.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-meta span {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
}

/* Category Pills */
.category-pill {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-pill:hover {
    border-color: var(--text-muted);
}

.category-pill.active {
    background: var(--text-main);
    /* Black/Dark for contrast */
    color: #fff;
    border-color: var(--text-main);
}

/* Category Tiles */
.category-tile {
    background: var(--bg-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Colors for tags */
.tag-green {
    border-top: 3px solid #10b981;
}

.tag-blue {
    border-top: 3px solid #3b82f6;
}

.tag-pink {
    border-top: 3px solid #ec4899;
}

.tag-orange {
    border-top: 3px solid #f97316;
}

/* Utilities */
.is-hidden {
    display: none !important;
}

.links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    width: 100%;
    font-size: 13px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.notice {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Toast */
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    padding: 14px 18px;
    background: #fff;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    color: var(--text-main);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 9999;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    border-color: var(--danger);
}

.toast-info {
    border-color: #3b82f6;
}

/* Responsive */
@media (max-width: 900px) {
    .menu-button {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .settings-layout {
        display: block;
    }

    .settings-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        background: #fff;
        width: 260px;
        z-index: 45;
        padding: 24px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        border-right: 1px solid var(--border);
        transition: transform 0.3s;
    }

    body.settings-open .settings-sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 40;
        display: none;
    }

    body.sidebar-open .sidebar-overlay,
    body.settings-open .sidebar-overlay {
        display: block;
    }

    .app-header {
        padding: 0 16px;
    }

    .app-content {
        padding: 24px 16px;
    }
}
/* category-layout-wide */
.app-content {
    max-width: 1600px;
    width: 100%;
    margin: 24px auto 0;
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.settings-content {
    width: 100%;
    max-width: none;
    margin: 0;
}

.category-grid {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.category-tile {
    min-width: 0;
}

@media (max-width: 1500px) {
    .category-grid {
        grid-template-columns: repeat(5, minmax(140px, 1fr));
    }
}

@media (max-width: 1300px) {
    .category-grid {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
    }
}

@media (max-width: 1050px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 800px) {
    .category-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 560px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}


/* category-page-inline-styles */
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

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

.category-subtitle {
    color: var(--text-secondary);
    margin: 6px 0 0;
}

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

.category-form-row {
    background: var(--bg-surface);
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.category-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
}

.category-form-row select,
.category-form-row input,
.input-compact {
    margin-bottom: 0;
}

.category-tabs {
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5f5 #eef2ff;
}

.category-tabs::-webkit-scrollbar {
    height: 6px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 999px;
}

.category-tabs::-webkit-scrollbar-track {
    background: #eef2ff;
    border-radius: 999px;
}

.category-tabs .category-pill {
    flex: 0 0 auto;
}

.category-pill-icon {
    margin-right: 6px;
}

.category-pill[data-color] {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
}

.category-pill[data-color] .category-pill-icon {
    color: var(--text-muted);
}

.category-pill.active[data-color] {
    background: #f8fafc;
    border: 1px solid rgba(var(--data-color-rgb), 0.5);
    box-shadow: 0 0 0 2px rgba(var(--data-color-rgb), 0.5);
    color: var(--text-main);
}

.category-pill.active[data-color] .category-pill-icon {
    color: var(--data-color);
}

.category-section {
    margin-bottom: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    position: relative;
}

.category-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    gap: 12px;
}

.category-section-title {
    margin: 0;
    color: var(--data-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.category-section-icon {
    color: var(--data-color);
    font-size: 14px;
}

.category-add-btn {
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid #e5e7eb;
}

.category-add-btn i {
    color: #22c55e;
}

.category-add-btn:hover {
    background: #f8fafc;
    border-color: var(--text-muted);
}

.category-add-text {
    font-size: 13px;
}

.category-tile {
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--data-color);
}

.category-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    flex-direction: column;
    gap: 8px;
}

.category-edit-overlay-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid #e5e7eb;
}

.category-edit-overlay-icon {
    color: var(--text-main);
}

.category-edit-overlay-text {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
}

.category-tile:hover .category-edit-overlay {
    opacity: 1;
}

.category-tile-header {
    margin-bottom: 12px;
}

.category-tile-name {
    font-weight: 600;
    display: block;
    text-align: center;
    margin-top: 8px;
}

.category-tile-thumb {
    flex: 1;
    background: rgba(var(--data-color-rgb), 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-bottom: 8px;
    min-height: 80px;
}

.category-tile-icon {
    color: var(--data-color);
    font-size: 24px;
}

.category-modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.category-modal.is-open {
    display: flex;
}

.category-modal-content {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    width: 400px;
    max-width: calc(100% - 32px);
}

.category-modal-content h3 {
    margin-top: 0;
}

.category-modal-input,
.category-modal-select {
    width: 100%;
    box-sizing: border-box;
}

.category-modal-select {
    margin-top: 16px;
}

.category-modal-label {
    display: block;
    margin-top: 16px;
}

.category-modal-label span {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.category-modal-file {
    margin-bottom: 0;
}

.category-modal-tabs {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#editModal.create-mode .category-modal-tabs {
    display: flex;
}

#editModal.create-mode.group-locked .category-modal-tabs {
    display: none;
}

#editModal.create-mode.group-locked .category-modal-group {
    display: none;
}
#editModal.edit-mode .category-modal-group {
    display: none;
}

#editModal.create-mode .category-modal-select-wrap {
    display: none;
}

.category-modal-tab {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.category-modal-tab:hover {
    border-color: var(--text-muted);
}

.category-modal-tab-icon {
    color: var(--text-muted);
}

.category-modal-tab.active {
    border-color: rgba(var(--data-color-rgb), 0.5);
    box-shadow: 0 0 0 2px rgba(var(--data-color-rgb), 0.5);
}

.category-modal-tab.active .category-modal-tab-icon {
    color: var(--data-color);
}

.category-stage-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-stage-scope-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.category-stage-scope-btn.active {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.category-stage-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-stage-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.category-stage-empty {
    display: none;
    font-size: 12px;
    color: #94a3b8;
}

.category-modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.category-modal-buttons {
    display: flex;
    gap: 8px;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.category-modal-delete {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}

/* category-modal-redesign */
.category-modal-content {
    width: min(900px, 100%);
    max-width: 100%;
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.category-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.category-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.category-modal-close {
    background: transparent;
    border: none;
    font-size: 26px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.category-modal-body {
    padding: 20px 24px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-modal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.category-properties-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.category-properties-open {
    display: none;
}

#editModal.create-mode .category-properties-open {
    display: inline-flex;
}

#editModal.edit-mode .category-properties-open {
    display: inline-flex;
}

#editModal.create-mode [data-properties-slot-inline] {
    display: none;
}

#editModal.edit-mode [data-properties-slot-inline] {
    display: none;
}

.category-modal.property-modal {
    z-index: 120;
}
.category-modal.property-modal .category-modal-content {
    width: fit-content;
    max-width: min(900px, 100%);
    min-width: min(520px, 100%);
}
.category-modal-properties .category-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.category-property-card {
    margin-block: 12px;
    background: var(--bg-surface);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-property-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.category-property-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.category-property-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.category-property-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.category-property-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-property-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 10px;
    background: transparent;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    width: auto;
    max-width: 100%;
}

.category-property-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-property-option:has(input:checked) {
    background: var(--primary);
    color: #fff;
}

.category-property-option:has(input:checked) span {
    color: #fff;
}

.category-property-option span {
    flex: 1;
    text-align: left;
}
.category-property-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 0;
}

.category-modal-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    margin: 0;
}

.category-modal-input,
.category-modal-select {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #f8fafc;
    padding: 10px 14px;
}

.category-modal-select {
    margin-top: 0;
}

.category-upload-drop {
    border: 2px dashed #cbd5f5;
    border-radius: 14px;
    padding: 24px;
    background: #f8fafc;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.category-upload-drop:hover {
    border-color: #94a3b8;
}

.category-modal-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.category-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.category-upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ede9fe;
    color: #7c3aed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.category-upload-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.category-upload-subtitle {
    font-size: 14px;
    color: #64748b;
}

.category-upload-hint {
    font-size: 12px;
    color: #94a3b8;
}

.category-modal-tabs {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

#editModal.create-mode .category-modal-tabs {
    display: flex;
}

#editModal.create-mode.group-locked .category-modal-tabs {
    display: none;
}

#editModal.create-mode.group-locked .category-modal-group {
    display: none;
}

#editModal.create-mode .category-modal-select-wrap {
    display: none;
}

.category-modal-tab {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.category-modal-tab:hover {
    border-color: var(--text-muted);
}

.category-modal-tab-icon {
    color: var(--text-muted);
}

.category-modal-tab.active {
    border-color: rgba(var(--data-color-rgb), 0.5);
    box-shadow: 0 0 0 2px rgba(var(--data-color-rgb), 0.5);
}

.category-modal-tab.active .category-modal-tab-icon {
    color: var(--data-color);
}

.category-modal-actions {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.category-modal-delete {
    align-self: flex-start;
}

.category-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.category-modal-buttons .btn {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 12px;
}

.category-modal-buttons .btn-secondary {
    background: #e2e8f0;
    color: #334155;
    border: none;
}

/* category-stage-builder */
.category-stage-builder {
    display: none;
    gap: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

#editModal.create-mode .category-stage-builder {
    display: flex;
    flex-direction: column;
}

#editModal.edit-mode .category-stage-builder {
    display: flex;
    flex-direction: column;
}

.category-stage-builder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.category-stage-column {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    min-height: 120px;
}

.category-stage-column.is-selected,
.category-stage-column.is-available {
    grid-column: 1 / -1;
}

.category-stage-column.is-selected {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(209, 250, 229, 0.9));
}

.category-stage-column-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.category-stage-column-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.category-stage-column-title-row .category-stage-column-title {
    margin-bottom: 0;
}

.category-stage-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #f8fafc;
    color: #16a34a;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    font-size: 12px;
    white-space: nowrap;
}

.category-stage-add:hover {
    border-color: #86efac;
    color: #15803d;
    background: #f0fdf4;
}

.stage-add-modal {
    z-index: 120;
}
.stage-add-modal .category-modal-content {
    width: 520px;
    max-width: calc(100% - 32px);
}

.stage-add-scope {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.stage-add-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.stage-add-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #475569;
}

.stage-add-option input {
    accent-color: #4f46e5;
}

.stage-add-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.stage-add-actions .btn {
    width: auto;
}

@media (max-width: 640px) {
    .stage-add-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.category-stage-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.category-stage-empty {
    display: none;
    font-size: 12px;
    color: #94a3b8;
    padding: 4px 0;
}

.category-stage-template {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-stage-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-stage-scope-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.category-stage-scope-btn.active {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.category-stage-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.category-stage-chip.is-available {
    background: #f1f5f9;
    cursor: pointer;
}

.category-stage-chip.is-dragging {
    opacity: 0.6;
}

.category-stage-remove {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}
@media (max-width: 640px) {
    .category-modal-content {
        width: 100%;
    }

    .category-modal-buttons {
        grid-template-columns: 1fr;
    }

    .category-stage-builder-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-form-grid {
        grid-template-columns: 1fr;
    }
}


/* category-pill-all-hover */
.category-pill[data-group-id="all"]:not(.active):hover {
    background: var(--text-main);
    border-color: var(--text-main);
    color: #fff;
}


/* category-tile-hover-overlay */
.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #f8fafc;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

.category-tile:hover::after {
    opacity: 0.5;
}


/* category-edit-overlay-hover-fix */
.category-edit-overlay {
    padding: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
}

.category-edit-overlay:hover,
.category-edit-overlay:focus-visible {
    background: rgba(255, 255, 255, 0.9);
}

/* category-tile-image-top */
.category-tile {
    padding: 0;
}

.category-tile-thumb {
    order: -1;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.category-tile-header {
    padding: 12px 16px 16px;
    margin: 0;
    border-top: 1px solid var(--border);
}

.category-tile-name {
    margin: 0;
    font-size: 15px;
}

/* category-card-size-and-thumb */
.category-tile {
    min-height: 240px;
}

.category-tile-thumb {
    position: relative;
    background: #f1f5f9;
    min-height: 140px;
}
.category-tile-thumb.has-image {
    overflow: hidden;
}

.category-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8fafc;
    display: block;
}

.category-tile-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    color: var(--data-color);
    font-size: 18px;
    z-index: 1;
}
.category-tile-thumb.has-image .category-tile-icon {
    display: none;
}


/* category-sticky */
.category-page {
    --category-sticky-top: 16px;
}

.category-sticky-wrap {
    position: sticky;
    top: var(--category-sticky-top);
    z-index: 30;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 12px 0 8px;
    margin-bottom: 16px;
    transition: padding 0.2s ease, margin 0.2s ease;
}

.category-sticky-wrap .category-header {
    margin-bottom: 12px;
}

.category-sticky-wrap .category-tabs {
    margin-bottom: 0;
}

.category-header,
.category-tabs {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    padding: 0;
    transition: padding 0.2s ease, margin 0.2s ease, gap 0.2s ease;
}

body.category-sticky .category-sticky-wrap {
    padding: 4px 0;
    margin-bottom: 8px;
    top: 5px;
}

body.category-sticky .category-sticky-wrap .category-header {
    margin-bottom: 4px;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
}

body.category-sticky .category-header h2 {
    font-size: 16px;
    margin: 0;
    line-height: 1.2;
}

body.category-sticky .category-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}

body.category-sticky .category-tabs {
    gap: 6px;
}

body.category-sticky .category-pill {
    padding: 6px 12px;
    font-size: 12px;
}

.category-header h2,
.category-actions .btn,
.category-tabs,
.category-pill {
    transition: padding 0.2s ease, font-size 0.2s ease, gap 0.2s ease, margin 0.2s ease;
}

/* category-section-bg */
.category-section[data-color] {
    background-color: transparent;
    background-image: linear-gradient(180deg, rgba(var(--data-color-rgb), 0.04) 0%, rgba(var(--data-color-rgb), 0.02) 35%, #ffffff 100%);
}


@media (max-width: 1200px) {
    .app-content {
        margin: 0 auto;
    }
}


/* Product properties */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.property-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.property-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.property-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.property-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.property-tag {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}


.property-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.property-materials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.property-material {
    background: var(--bg-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-material-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.property-material-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.property-material-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.property-card-wide {
    grid-column: 1 / -1;
}
.property-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

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

.btn-icon.btn-danger {
    color: var(--danger);
}

.property-form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.property-form-inline input,
.property-form-inline select {
    margin-bottom: 0;
}

.property-form-inline .btn,
.property-form-inline .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
}

.property-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.property-tag-actions {
    display: inline-flex;
    gap: 4px;
}

.property-tag-action {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
}

.property-tag-action:hover {
    color: var(--text-main);
}

.property-material-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.section-block {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.section-header.section-header-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-header.section-header-actions > div {
    min-width: 0;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.section-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.property-section-title + .property-tags {
    margin-top: 6px;
}


/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-overlay.is-open {
    animation: modal-fade 0.2s ease;
}

.modal-overlay .modal {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-lg, var(--shadow-md));
    width: min(520px, 100%);
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    animation: modal-pop 0.2s ease;
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.modal-overlay .modal-close {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.modal-overlay .modal-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-overlay .modal-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-overlay .field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-overlay .option-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-overlay .modal-field .option-type-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.modal-overlay .modal-field .option-type-choice input {
    margin: 0;
    accent-color: var(--primary);
    display: inline-block;
}

.modal-overlay .modal-field .option-type-choice span {
    white-space: nowrap;
}

.modal-overlay .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.modal-overlay .modal-actions .modal-save {
    margin-left: auto;
}

.modal-overlay .modal.is-confirming .modal-actions {
    display: none;
}

.modal-overlay .modal-confirm {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.modal-overlay .modal.is-confirming .modal-confirm {
    display: flex;
}

.modal-overlay .modal-confirm-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-overlay .modal-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

@keyframes modal-pop {
    from {
        transform: translateY(8px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}


.modal-overlay .icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.modal-overlay .icon-choice {
    border: 1px solid #e5e7eb;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.modal-overlay .icon-choice:hover {
    background: #fff;
    color: var(--text-main);
}

.modal-overlay .icon-choice.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    color: var(--primary);
    background: #fff;
}

.modal-overlay .option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.modal-overlay [data-list="thicknesses"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.modal-overlay [data-list="thicknesses"] .option-row {
    margin: 0;
}

.modal-overlay [data-list="thicknesses"] .option-row .input-compact {
    text-align: center;
}

.modal-overlay .option-list + .btn-compact {
    margin-top: 8px;
}

.modal-overlay [data-field="options"] .option-add-icon {
    color: var(--success);
}

.modal-overlay .option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-overlay .option-row .input-compact {
    flex: 1;
}

.modal-overlay .option-remove {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.modal-overlay .option-remove:hover {
    background: #fff;
    color: var(--text-main);
}

.modal-overlay .btn-compact {
    padding: 6px 12px;
    font-size: 12px;
}
/* category-tile-properties */
.category-tile-properties {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.category-tile-property {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.category-tile-property-icon {
    color: var(--text-main);
    font-size: 14px;
}

.category-tile-property-name {
    font-weight: 600;
    color: var(--text-main);
}

.category-tile-property-sep {
    color: var(--text-secondary);
}

.category-tile-property-values {
    color: var(--text-secondary);
}
/* category-color-picker */
.category-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.category-color-swatch.is-disabled {
    cursor: not-allowed;
}

.category-color-swatch-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
}

.category-color-swatch.is-selected {
    border-color: var(--text-main);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--swatch-color);
}


/* group-icon-picker */
.group-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.group-icon-choice {
    width: 44px;
    height: 44px;
    border: 1px solid #e5e7eb;
    background: transparent;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.group-icon-choice img {
    width: 22px;
    height: 22px;
    display: block;
}

.group-icon-choice.is-selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    background: #f8fafc;
}

.group-icon-empty {
    font-size: 12px;
    color: var(--text-secondary);
}


.group-icon-mask {
    width: 20px;
    height: 20px;
    display: block;
    background-color: currentColor;

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    mask-mode: alpha;
}

.group-icon-mask.is-large {
    width: 72px;
    height: 72px;
}


.group-icon-img {
    width: 20px;
    height: 20px;
    display: block;
}


.group-icon-upload {
    border: none;
    background: transparent;
    color: #22c55e;
}

.group-icon-upload i {
    font-size: 18px;
}


.group-icon-choice.group-icon-upload {
    border: none;
    background: transparent;
    color: #22c55e;
    box-shadow: none;
}


button.group-icon-choice {
    background: transparent;
}

button.group-icon-choice:hover {
    background: #f3f4f6;
}

button.group-icon-choice.is-selected:hover {
    background: #f1f5f9;
}

button.group-icon-choice.group-icon-upload:hover {
    background: transparent;
}


/* group-icon-size */
button.group-icon-choice {
    width: 48px;
    height: 48px;
}

.group-icon-upload i {
    font-size: 20px;
}
.group-icon-add {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #22c55e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.group-icon-add:hover {
    background: transparent;
    color: #16a34a;
}


.modal-close-button {
    transition: opacity 0.15s ease;
}

.modal-close-button:hover {
    opacity: 0.6;
}


.color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.color-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-stage-builder.category-stage-builder {
    display: flex;
    flex-direction: column;
}


.catalog-filter-tabs {
    margin: 0;
    flex: 1 1 auto;
}


.catalog-category-block {
    margin-bottom: 18px;
}

.catalog-category-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 12px;
}

.catalog-category-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.catalog-category-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

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


.catalog-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.catalog-filter-tabs {
    margin: 0;
    flex: 1 1 auto;
}



.catalog-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.catalog-item-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.catalog-item-card:hover {
    box-shadow: var(--shadow-md, 0 6px 16px rgba(15, 23, 42, 0.12));
    transform: translateY(-1px);
}

.modal-overlay .modal.catalog-card-modal {
    width: min(1920px, 98vw);
    max-width: 98vw;
}\r\n\r\n.modal-overlay.catalog-layout-overlay {\r\n    z-index: 1100;\r\n}\r\n\r\n.modal-overlay .modal.catalog-layout-modal {\r\n    width: min(1400px, 96vw);\r\n    max-width: 96vw;\r\n}\r\n\r\n.catalog-layout-modal-body {\r\n    display: grid;\r\n    grid-template-columns: 260px 1fr;\r\n    gap: 20px;\r\n    min-height: 320px;\r\n}\r\n\r\n.catalog-layout-modal-list {
\r\n    display: flex;\r\n    flex-direction: column;\r\n    gap: 8px;\r\n    max-height: 70vh;\r\n    overflow: auto;\r\n
    grid-column: 1 / -1;
    width: 100%;
}
.catalog-layout-modal-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

.catalog-layout-modal-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-layout-modal-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
\r\n\r\n.catalog-layout-modal-item {\r\n    display: flex;\r\n    align-items: center;\r\n    gap: 8px;\r\n    padding: 8px 10px;\r\n    border-radius: 10px;\r\n    border: 1px solid #e5e7eb;\r\n    background: #fff;\r\n    color: var(--text-main);\r\n    text-align: left;\r\n    font-size: 13px;\r\n    cursor: pointer;\r\n}\r\n\r\n.catalog-layout-modal-item.is-active {\r\n    border-color: #6366f1;\r\n    background: #eef2ff;\r\n}\r\n\r\n.catalog-layout-modal-preview {
\r\n    border: 1px solid #e5e7eb;\r\n    border-radius: 12px;\r\n    padding: 16px;\r\n    background: #f8fafc;\r\n    min-height: 320px;\r\n    display: flex;\r\n    flex-direction: column;\r\n    gap: 12px;\r\n
    grid-column: 1 / -1;
}\r\n\r\n.catalog-layout-modal-filename {\r\n    font-size: 14px;\r\n    font-weight: 600;\r\n    color: var(--text-main);\r\n}\r\n\r\n.catalog-layout-modal-image {\r\n    width: 100%;\r\n    max-height: 70vh;\r\n    object-fit: contain;\r\n    border-radius: 8px;\r\n    background: #fff;\r\n}\r\n\r\n.catalog-layout-modal-frame {\r\n    width: 100%;\r\n    height: 70vh;\r\n    border: 0;\r\n    border-radius: 8px;\r\n    background: #fff;\r\n}\r\n\r\n.catalog-layout-modal-filebox {\r\n    display: flex;\r\n    align-items: center;\r\n    gap: 8px;\r\n    font-size: 14px;\r\n    color: var(--text-secondary);\r\n}\r\n\r\n.catalog-layout-modal-actions {\r\n    margin-top: auto;\r\n}\r\n\r\n.catalog-layout-modal-actions a {\r\n    display: inline-flex;\r\n    align-items: center;\r\n    gap: 8px;\r\n    color: var(--text-main);\r\n    font-size: 13px;\r\n    text-decoration: none;\r\n    border: 1px solid #e5e7eb;\r\n    padding: 6px 10px;\r\n    border-radius: 8px;\r\n    background: #fff;\r\n}\r\n\r\n.catalog-layout-modal-actions a:hover {\r\n    background: #f8fafc;\r\n}\r\n.catalog-layout-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-layout-modal-header-actions form {
    display: flex;
    align-items: center;
}

.catalog-layout-input {
    display: none;
}

.catalog-layout-add {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.catalog-layout-add:hover {
    background: #dcfce7;
}

.catalog-layout-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
\r\n.catalog-layouts-trigger {\r\n    cursor: pointer;\r\n}\r\n\r\n.catalog-layouts-trigger:hover {\r\n    color: var(--text-main);\r\n}\r\n\r\n.catalog-layouts-trigger:focus {\r\n    outline: none;\r\n}\r\n\r\n.catalog-card-modal-file {\r\n    cursor: pointer;\r\n}\r\n\r\n@media (max-width: 900px) {\r\n    .catalog-layout-modal-body {\r\n        grid-template-columns: 1fr;\r\n    }\r\n}\r\n

.catalog-card-modal-body {
gap: 16px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.catalog-card-modal-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.catalog-card-modal-grid {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: 20px;
    align-items: start;
}

.catalog-card-modal-media {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-card-modal-image {
    border-radius: 16px;
    border: 1px solid #e6ebf2;
    background: #f3f6fb;
    padding: 16px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card-modal-image img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.catalog-card-modal-placeholder {
    font-size: 13px;
    color: var(--text-muted);
}

.catalog-card-modal-details,
.catalog-card-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.catalog-card-modal-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-card-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.catalog-card-modal-text {
    font-size: 15px;
    color: var(--text-main);
    white-space: pre-line;
}

.catalog-card-modal-properties {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 720px) {
    .catalog-card-modal-grid {
        grid-template-columns: 1fr;
    }
}
.catalog-card-modal-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}


.catalog-card-modal-filecounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.catalog-card-modal-filecount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--text-main);
    font-size: 12px;
}

.catalog-card-modal-filecount-label {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.catalog-card-modal-filecount-value {
    color: var(--text-secondary);
}
.catalog-card-modal-files-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.catalog-card-modal-files-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-card-modal-files-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
@media (min-width: 721px) {
    .catalog-card-modal-files {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

.catalog-card-modal-filecounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.catalog-card-modal-filecount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--text-main);
    font-size: 12px;
}

.catalog-card-modal-filecount-label {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.catalog-card-modal-filecount-value {
    color: var(--text-secondary);
}
}

.catalog-card-modal-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
}

.catalog-card-modal-file:hover {
    background: #f8fafc;
}
.catalog-card-modal-extra {
    display: none;
}

.catalog-card-modal.is-details-open .catalog-card-modal-extra {
    display: flex;
}

.catalog-card-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.catalog-card-modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
}

.catalog-card-modal-row-name {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.catalog-card-modal-row-value {
    color: var(--text-main);
}

.catalog-card-modal-muted {
    font-size: 12px;
    color: var(--text-muted);
}

.catalog-card-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-card-modal-chip {
    background: #eef2f7;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-main);
}

.catalog-card-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-card-modal-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
}

.catalog-card-modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}












.catalog-card-modal-layouts {
    width: 100%;
}

