:root {
    --fuse-bg: #F1F5F9;
    --fuse-surface: #FFFFFF;
    --fuse-primary: #2563EB;
    --fuse-primary-dark: #1D4ED8;
    --fuse-primary-light: #EFF6FF;
    --fuse-text: #1E293B;
    --fuse-text-secondary: #64748B;
    --fuse-border: #E2E8F0;
    --fuse-success: #10B981;
    --fuse-warning: #F59E0B;
    --fuse-danger: #EF4444;
    --header-height: 88px;
    --utility-height: 50px;
    --radius-sm: 3px;
    --radius-md: 4px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--fuse-bg);
    color: var(--fuse-text);
    min-height: 100vh;
}

/* ── App Shell ── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.app-header {
    background: #1E293B;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--utility-height);
    padding: 9px 28px;
    background: #2563EB;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-utility-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

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

.utility-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.utility-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px 0 4px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: transparent;
    text-decoration: none;
    line-height: 1;
}

.utility-chip-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.utility-chip-icon svg {
    width: 14px;
    height: 14px;
}

.utility-chip-label {
    line-height: 1;
}

.utility-chip--interactive {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.utility-chip--interactive:hover {
    background: rgba(255, 255, 255, 0.12);
}

.utility-chip--interactive.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
}

button.utility-chip {
    appearance: none;
}

.login-page .page-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--fuse-surface);
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 36px 32px 32px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--fuse-border);
}

.login-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-brand-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fuse-text);
}

.login-brand-tagline {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fuse-text-secondary);
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-card p {
    font-size: 14px;
    color: var(--fuse-text-secondary);
    margin-bottom: 24px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

.login-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--fuse-danger);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: stretch;
    max-width: 100%;
    margin: 0;
    padding: 0 28px;
    min-height: var(--header-height);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    align-self: center;
    justify-self: start;
}

.brand-mark {
    display: block;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
    transition: transform 0.2s ease;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-name {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-tagline {
    font-size: 10px;
    font-weight: 600;
    color: #94A3B8;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-spacer {
    justify-self: end;
}

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

.top-nav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    justify-self: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    min-width: 96px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}

.nav-link:hover {
    color: #F1F5F9;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover .nav-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.nav-link.active {
    color: #FFFFFF;
    font-weight: 600;
    border-bottom-color: #3B82F6;
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.active .nav-icon {
    opacity: 1;
    color: #60A5FA;
}

button.nav-link {
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    appearance: none;
}

button.nav-link-logout:hover {
    color: #FCA5A5;
}

button.nav-link-logout:hover .nav-icon {
    color: #F87171;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fuse-text-secondary);
}

.topbar-breadcrumb a {
    color: var(--fuse-text-secondary);
    text-decoration: none;
}

.topbar-breadcrumb a:hover {
    color: var(--fuse-primary);
}

.topbar-breadcrumb .current {
    color: var(--fuse-text);
    font-weight: 600;
}

.topbar-breadcrumb .sep {
    color: var(--fuse-border);
}

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

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    background: var(--fuse-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--fuse-text-secondary);
    transition: background 0.15s, color 0.15s;
}

.topbar-icon-btn:hover {
    background: var(--fuse-bg);
    color: var(--fuse-text);
}

.page-content,
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 32px 32px;
    flex: 1;
    box-sizing: border-box;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--fuse-text);
    line-height: 1.2;
}

.page-header p {
    font-size: 14px;
    color: var(--fuse-text-secondary);
    margin-top: 6px;
}

/* ── Dashboard ── */
a.header-brand {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}

a.header-brand:hover {
    opacity: 0.92;
}

a.header-brand:hover .brand-mark {
    transform: scale(1.04);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: var(--fuse-surface);
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.dashboard-card:hover {
    border-color: var(--fuse-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-card-icon svg {
    width: 26px;
    height: 26px;
}

.dashboard-card-icon--blue {
    background: #EFF6FF;
    color: #2563EB;
}

.dashboard-card-icon--purple {
    background: #F5F3FF;
    color: #7C3AED;
}

.dashboard-card-icon--green {
    background: #ECFDF5;
    color: #059669;
}

.dashboard-card-icon--orange {
    background: #FFF7ED;
    color: #EA580C;
}

.dashboard-card-body {
    flex: 1;
    min-width: 0;
}

.dashboard-intro {
    margin-bottom: 28px;
}

.dashboard-intro h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--fuse-text);
    margin-bottom: 6px;
}

.dashboard-intro p {
    font-size: 14px;
    color: var(--fuse-text-secondary);
}

.dashboard-card-body h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fuse-text);
    margin-bottom: 6px;
}

.dashboard-card-body p {
    font-size: 14px;
    color: var(--fuse-text-secondary);
    line-height: 1.5;
}

.dashboard-card-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fuse-text-secondary);
    transition: color 0.15s, transform 0.15s;
    margin-top: 4px;
}

.dashboard-card-arrow svg {
    width: 20px;
    height: 20px;
}

.dashboard-card:hover .dashboard-card-arrow {
    color: var(--fuse-primary);
    transform: translateX(4px);
}

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

    .dashboard-card {
        padding: 20px;
    }
}

/* ── Page Shell (unified layout) ── */
.page-shell,
.brand-editor {
    background: var(--fuse-surface);
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
}

.page-shell .page-toolbar,
.page-shell .unified-toolbar,
.page-shell .action-buttons,
.page-shell .brand-toolbar,
.page-shell .page-panel,
.page-shell .brand-panel,
.page-shell .section,
.page-shell .settings-section,
.page-shell .preview-section,
.page-shell .code-editor-section,
.page-shell .tab-content,
.brand-editor .brand-toolbar,
.brand-editor .brand-panel,
.brand-editor .tab-content {
    background: none;
    border: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
    padding: 0;
}

.page-shell > .page-toolbar,
.page-shell > .unified-toolbar,
.page-shell > .action-buttons,
.page-shell > .brand-toolbar,
.brand-editor > .brand-tabs + .tab-content .brand-toolbar,
.brand-editor > .tab-content > .brand-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--fuse-border);
}

.page-shell > .page-panel,
.page-shell > .brand-panel,
.brand-editor .brand-panel {
    padding: 24px;
}

.page-panel-header,
.brand-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-panel-header h3,
.brand-panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--fuse-text);
}

.page-controls,
.brand-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.page-controls-row,
.brand-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.page-shell .search-filter-bar {
    display: contents;
}

.page-tabs,
.brand-tabs {
    display: flex;
    border-bottom: 1px solid var(--fuse-border);
}

.page-tab,
.brand-tab {
    font-family: inherit;
    background: none;
    color: var(--fuse-text-secondary);
    padding: 18px 28px;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.page-tab:hover,
.brand-tab:hover {
    color: var(--fuse-text);
}

.page-tab.active,
.brand-tab.active {
    color: var(--fuse-primary);
    border-bottom-color: var(--fuse-primary);
}

.page-tab#tabSearch.active,
.brand-tab#tabSearch.active {
    color: var(--fuse-success);
    border-bottom-color: var(--fuse-success);
}

.page-shell .tab-content {
    display: none;
    padding: 0;
}

.page-shell .tab-content.active,
.brand-editor .tab-content.active {
    display: block;
}

.brand-editor .tab-content {
    display: none;
}

/* Banner editor grid inside shell */
.page-shell .editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--fuse-border);
}

.page-shell .editor-grid .preview-section,
.page-shell .editor-grid .settings-section {
    padding: 24px;
    margin: 0;
}

.page-shell .editor-grid .preview-section {
    border-right: 1px solid var(--fuse-border);
}

.page-shell .code-editor-section {
    padding: 24px;
    border-top: 1px solid var(--fuse-border);
}

.page-shell .code-editor-section.active {
    display: block;
}

/* SVG editor layout */
.svg-workspace {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0;
    border-top: 1px solid var(--fuse-border);
}

.svg-workspace-col {
    padding: 24px;
}

.svg-workspace-col + .svg-workspace-col {
    border-left: 1px solid var(--fuse-border);
}

.svg-canvas-area {
    min-height: 400px;
    background: var(--fuse-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow: auto;
    position: relative;
}

.svg-links-list {
    min-height: 120px;
}

.svg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--fuse-text-secondary);
    border-top: 1px solid var(--fuse-border);
}

.svg-empty-state-icon {
    font-size: 48px;
    opacity: 0.35;
    margin-bottom: 16px;
}

.svg-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 8px;
}

.svg-empty-state p {
    font-size: 14px;
    max-width: 360px;
}

.panel-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 16px;
}

/* ── Cards (standalone only) ── */
.card {
    background: var(--fuse-surface);
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
}

.section-title,
.settings-title,
.preview-title,
.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

/* ── Item grids ── */
.brands-grid,
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 16px;
}

.videos-grid {
    grid-template-columns: repeat(4, 1fr);
}

.brand-card,
.video-card {
    background: var(--fuse-surface);
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.brand-card.selectable:hover,
.video-card:hover {
    border-color: #CBD5E1;
    box-shadow: var(--shadow-md);
}

.brand-card.selected {
    border-color: var(--fuse-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.brand-card.selectable {
    cursor: pointer;
}

.brand-card.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--fuse-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    z-index: 2;
}

.brand-card-image {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--fuse-bg);
}

.brand-card-image img {
    max-width: 100%;
    max-height: 58px;
    object-fit: contain;
}

.brand-card-body {
    padding: 12px 14px 0;
    flex: 1;
    min-width: 0;
}

.brand-card-name {
    font-weight: 600;
    color: var(--fuse-text);
    font-size: 14px;
    text-align: center;
    margin-bottom: 4px;
    word-break: break-word;
}

.brand-card-link {
    font-size: 11px;
    color: var(--fuse-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.brand-card-actions,
.video-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
}

.video-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 14px 0;
}

.video-card-brand {
    font-weight: 600;
    color: var(--fuse-primary);
    font-size: 15px;
    line-height: 1.3;
    word-break: break-word;
}

.video-card-category {
    flex-shrink: 0;
    background: var(--fuse-primary-light);
    color: var(--fuse-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.video-card-preview {
    margin: 12px 14px 0;
    min-height: 140px;
    max-height: 180px;
    border-radius: var(--radius-sm);
    background: #1E293B;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.video-card-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--fuse-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    flex-shrink: 0;
    z-index: 1;
}

.video-card-play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 12px solid white;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    margin-left: 3px;
}

.video-card-preview:hover .video-card-play-btn {
    transform: scale(1.05);
}

.video-card-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}

.video-card-preview.playing .video-card-play-btn {
    display: none;
}

.video-card-body {
    padding: 12px 14px 0;
    flex: 1;
}

.video-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--fuse-text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-card-url {
    font-size: 11px;
    color: var(--fuse-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
}

.btn-small {
    font-family: inherit;
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    background: var(--fuse-surface);
    color: var(--fuse-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-small.go,
.btn-go {
    color: var(--fuse-primary);
    border-color: #BFDBFE;
    background: var(--fuse-primary-light);
}

.btn-small.go:hover,
.btn-go:hover {
    background: #DBEAFE;
}

.btn-small.edit,
.btn-edit {
    color: #B45309;
    border-color: #FDE68A;
    background: #FFFBEB;
}

.btn-small.edit:hover,
.btn-edit:hover {
    background: #FEF3C7;
}

.btn-small.copy,
.btn-copy {
    color: var(--fuse-success);
    border-color: #A7F3D0;
    background: #ECFDF5;
}

.btn-small.delete,
.btn-delete {
    color: var(--fuse-danger);
    border-color: #FECACA;
    background: #FEF2F2;
}

.delete-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--fuse-text-secondary);
}

.delete-mode-toggle:hover {
    border-color: #FECACA;
    color: var(--fuse-danger);
}

.delete-mode-toggle.active {
    background: #FEF2F2;
    border-color: #FECACA;
    color: var(--fuse-danger);
}

.delete-mode-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--fuse-danger);
}

.tab-content#tabContentSearch .stat-badge {
    background: #ECFDF5;
    color: var(--fuse-success);
}

.tab-content#tabContentSearch .sort-btn.active {
    background: var(--fuse-success);
    border-color: var(--fuse-success);
}

.tab-content#tabContentSearch .search-input:focus {
    border-color: var(--fuse-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.tab-content#tabContentSearch .btn-small.go {
    color: var(--fuse-success);
    border-color: #A7F3D0;
    background: #ECFDF5;
}

.progress-container {
    display: none;
    margin: 16px 24px;
    padding: 16px;
    background: var(--fuse-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--fuse-border);
}

.progress-container.show {
    display: block;
}

.progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-percentage {
    font-size: 13px;
    color: var(--fuse-primary);
    font-weight: 700;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: var(--fuse-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--fuse-primary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    min-width: 0;
}

.progress-bar.danger {
    background: var(--fuse-danger);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--fuse-text-secondary);
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-text,
.empty-state-title {
    font-size: 15px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

.image-preview {
    width: 100%;
    height: 80px;
    background: var(--fuse-bg);
    border: 1px dashed var(--fuse-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview-placeholder {
    color: var(--fuse-text-secondary);
    font-size: 13px;
}

.sort-btn::after {
    content: '⇅';
    opacity: 0.45;
    font-size: 11px;
    margin-left: 4px;
}

.sort-btn.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.sort-btn.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

@media (max-width: 1024px) {
    .page-shell .editor-grid,
    .svg-workspace {
        grid-template-columns: 1fr;
    }

    .page-shell .editor-grid .preview-section {
        border-right: none;
        border-bottom: 1px solid var(--fuse-border);
    }

    .svg-workspace-col + .svg-workspace-col {
        border-left: none;
        border-top: 1px solid var(--fuse-border);
    }
}

@media (max-width: 768px) {
    .page-shell > .page-toolbar,
    .page-shell > .unified-toolbar,
    .page-shell > .action-buttons,
    .brand-toolbar {
        padding: 12px 16px;
    }

    .page-shell > .page-panel,
    .brand-panel {
        padding: 16px;
    }

    .page-controls-row,
    .brand-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: 0;
    }

    .page-tab,
    .brand-tab {
        flex: 1;
        padding: 14px 10px;
        font-size: 11px;
        text-align: center;
    }
}

/* ── Buttons ── */
.toolbar-btn,
.action-btn,
.modal-btn.confirm {
    font-family: inherit;
    background: var(--fuse-primary);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 40px;
}

.toolbar-btn:hover,
.action-btn:hover,
.modal-btn.confirm:hover {
    background: var(--fuse-primary-dark);
    transform: none;
    box-shadow: none;
}

.toolbar-btn.mode,
.toolbar-btn.secondary,
.action-btn.secondary {
    background: var(--fuse-success);
}

.toolbar-btn.mode:hover,
.toolbar-btn.secondary:hover,
.action-btn.secondary:hover {
    background: #059669;
}

.toolbar-btn.clear,
.action-btn.clear {
    background: var(--fuse-warning);
}

.toolbar-btn.clear:hover,
.action-btn.clear:hover {
    background: #D97706;
}

.toolbar-btn.mode {
    background: var(--fuse-bg);
    color: var(--fuse-text);
    border: 1px solid var(--fuse-border);
}

.toolbar-btn.mode:hover {
    background: var(--fuse-border);
}

.toolbar-btn.mode.active {
    background: var(--fuse-primary);
    color: white;
    border-color: var(--fuse-primary);
}

.unified-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    overflow-x: auto;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--fuse-text);
    font-size: 13px;
}

.form-group label .required {
    color: var(--fuse-danger);
    margin-left: 4px;
}

.form-group input,
.form-group textarea,
.form-group select,
.modal-input,
.code-textarea {
    font-family: inherit;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--fuse-surface);
    color: var(--fuse-text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.modal-input:focus,
.code-textarea:focus {
    outline: none;
    border-color: var(--fuse-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--fuse-surface);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--fuse-danger);
    background: #FEF2F2;
}

.form-group input[type="number"] {
    width: 140px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-flex {
    display: grid;
    grid-template-columns: 2fr 200px;
    gap: 16px;
    margin-bottom: 16px;
}

.layout-toggle {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--fuse-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--fuse-border);
}

.layout-toggle label {
    display: block;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 10px;
    font-size: 14px;
}

.toggle-btn {
    font-family: inherit;
    background: var(--fuse-surface);
    color: var(--fuse-text);
    padding: 10px 18px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.15s;
}

.toggle-btn:hover {
    border-color: var(--fuse-primary);
    color: var(--fuse-primary);
    transform: none;
    box-shadow: none;
}

.toggle-btn.active {
    background: var(--fuse-primary);
    color: white;
    border-color: var(--fuse-primary);
    box-shadow: none;
}

.editor-hint {
    font-size: 13px;
    color: var(--fuse-text-secondary);
    margin-top: 8px;
}

.code-textarea {
    font-family: 'Courier New', monospace;
    min-height: 280px;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
    background: var(--fuse-bg);
}

.code-editor-section {
    display: none;
}

.code-editor-section.active {
    display: block;
}

/* ── Tabs ── */
.tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--fuse-border);
}

.tab-button {
    font-family: inherit;
    background: transparent;
    color: var(--fuse-text-secondary);
    padding: 14px 24px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: var(--fuse-primary);
    background: var(--fuse-primary-light);
}

.tab-button.active {
    color: var(--fuse-primary);
    border-bottom-color: var(--fuse-primary);
    font-weight: 600;
    background: transparent;
}

.tab-button#tabSearch.active {
    color: var(--fuse-success);
    border-bottom-color: var(--fuse-success);
}

.tab-button#tabSearch:hover {
    color: var(--fuse-success);
    background: #F0FDF4;
}

.tab-content {
    padding: 24px;
    display: none;
}

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

.action-btn.danger,
.modal-btn.danger {
    background: var(--fuse-danger);
}

.action-btn.danger:hover,
.modal-btn.danger:hover {
    background: #DC2626;
}

.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    background: var(--fuse-surface);
    font-size: 14px;
    font-family: inherit;
}

.sort-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.sort-btn {
    font-family: inherit;
    padding: 8px 16px;
    border: 1px solid var(--fuse-border);
    border-radius: var(--radius-sm);
    background: var(--fuse-surface);
    color: var(--fuse-text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.sort-btn:hover {
    border-color: var(--fuse-primary);
    color: var(--fuse-primary);
}

.sort-btn.active {
    background: var(--fuse-primary);
    color: white;
    border-color: var(--fuse-primary);
}

.progress-bar {
    background: var(--fuse-primary);
}

.progress-bar.danger {
    background: var(--fuse-danger);
}

/* ── Modals ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--fuse-surface);
    padding: 28px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--fuse-border);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--fuse-text);
    margin-bottom: 8px;
}

.modal-description {
    font-size: 14px;
    color: var(--fuse-text-secondary);
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    font-family: inherit;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.modal-btn.cancel {
    background: var(--fuse-bg);
    color: var(--fuse-text);
    border: 1px solid var(--fuse-border);
}

.modal-btn.cancel:hover {
    background: var(--fuse-border);
}

/* ── Notifications ── */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--fuse-success);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.notification:empty {
    display: none;
}

.notification.error {
    background: var(--fuse-danger);
}

.notification.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: fuseSlideIn 0.3s ease;
}

.notification::before {
    content: '✓';
    width: 22px;
    height: 22px;
    background: white;
    color: var(--fuse-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.notification.error::before {
    content: '✕';
    color: var(--fuse-danger);
}

@keyframes fuseSlideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fuseSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-overlay.show {
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show .modal {
    animation: scaleIn 0.2s ease;
}

/* ── Users management ── */
.users-page .unified-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.users-toolbar-text h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: var(--fuse-text);
}

.users-toolbar-text p {
    margin: 0;
    font-size: 13px;
    color: var(--fuse-text-secondary);
}

.users-panel {
    padding: 0;
    overflow: hidden;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table th,
.users-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--fuse-border);
    vertical-align: middle;
}

.users-table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fuse-text-secondary);
    background: var(--fuse-bg);
}

.users-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

.users-table-actions {
    width: 160px;
    white-space: nowrap;
}

.users-empty {
    text-align: center;
    color: var(--fuse-text-secondary);
    padding: 40px 18px !important;
}

.users-you {
    font-size: 11px;
    font-weight: 600;
    color: var(--fuse-primary);
}

.users-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--fuse-bg);
    color: var(--fuse-text-secondary);
    border: 1px solid var(--fuse-border);
}

.users-badge--admin {
    background: #EFF6FF;
    color: #1D4ED8;
    border-color: #BFDBFE;
}

.users-badge--super {
    background: #F5F3FF;
    color: #6D28D9;
    border-color: #DDD6FE;
}

.users-status {
    font-size: 12px;
    font-weight: 500;
}

.users-status--ok {
    color: var(--fuse-success);
}

.users-status--pending {
    color: #B45309;
}

.users-action-btn {
    font-family: inherit;
    border: 1px solid var(--fuse-border);
    background: var(--fuse-surface);
    color: var(--fuse-text);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.users-action-btn:hover {
    background: var(--fuse-bg);
    border-color: var(--fuse-primary);
    color: var(--fuse-primary);
}

.users-action-btn--danger:hover {
    border-color: var(--fuse-danger);
    color: var(--fuse-danger);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fuse-text);
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--fuse-primary);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--fuse-text-secondary);
}

select.modal-input {
    cursor: pointer;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .header-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        min-height: auto;
    }

    .header-brand {
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-spacer {
        display: none;
    }

    .top-nav {
        justify-content: flex-start;
        padding: 0 8px;
        width: 100%;
    }

    .nav-link {
        min-width: 80px;
        padding: 10px 12px;
        font-size: 11px;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .brand-tagline {
        display: none;
    }

    .page-content,
    .container {
        padding: 16px;
    }

    .form-row,
    .form-row-3,
    .form-row-flex {
        grid-template-columns: 1fr;
    }

    .unified-toolbar,
    .action-buttons {
        flex-direction: column;
    }

    .toggle-btn {
        width: 100%;
        margin-right: 0;
    }

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

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