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

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: #f1f5f9;
        color: #334155;
        line-height: 1.6;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* ============ LAYOUT STRUCTURE ============ */
    .cmsapp-layout {
        display: flex;
        flex: 1;
        min-height: calc(100vh - 140px);
    }

    .cmsapp-sidebar {
        width: 280px;
        background: white;
        border-right: 1px solid #e2e8f0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        height: calc(100vh - 140px);
        overflow-y: auto;
        z-index: 100;
    }

    .cmsapp-main-content {
        flex: 1;
        padding: 20px;
        overflow-y: auto;
        background: #f1f5f9;
    }

    .cmsapp-container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    /* ============ HEADER FULLWIDTH ============ */
.cmsapp-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    position: relative;
    width: 100%;
    border-radius: 0;
    z-index: 200;
}

.cmsapp-header.client-mode {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.cmsapp-header-content {
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}


    .cmsapp-auth-controls {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .cmsapp-auth-btn {
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 13px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .cmsapp-auth-btn:hover {
        background: rgba(255, 255, 255, 0.25);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
.cmsapp-header-left {
    flex: 1;
}

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

.cmsapp-header h1 {
    font-size: 32px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.cmsapp-header p {
    opacity: 0.9;
    font-size: 16px;
    margin: 4px 0 0 0;
    font-weight: 400;
}

.cmsapp-mode-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.cmsapp-external-link {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cmsapp-external-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cmsapp-external-link i {
    font-size: 16px;
}
    /* ============ SIDEBAR MENU ============ */
.cmsapp-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.cmsapp-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmsapp-sidebar-subtitle {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cmsapp-sidebar-menu {
    padding: 8px 0;
    list-style: none;
}

.cmsapp-menu-item {
    margin: 2px 8px;
}

.cmsapp-menu-link {
    /* Reset button styles */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    
    /* Menu link styles */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 10px;
    position: relative;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.cmsapp-menu-link:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    color: #3b82f6;
    transform: translateX(4px);
}

.cmsapp-menu-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cmsapp-menu-link.active:hover {
    transform: translateX(4px);
    color: white;
}

.cmsapp-menu-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.cmsapp-menu-text {
    flex: 1;
    font-size: 14px;
}

.cmsapp-menu-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #3b82f6;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cmsapp-menu-link.active .cmsapp-menu-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
    /* ============ FOOTER FULLWIDTH ============ */
    .cmsapp-footer {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: white;
        padding: 24px 0;
        text-align: center;
        width: 100%;
        margin-top: auto;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }

    .cmsapp-footer-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .cmsapp-footer p {
        margin: 0;
        font-size: 14px;
        opacity: 0.9;
    }

    .cmsapp-footer a {
        color: #60a5fa;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }

    .cmsapp-footer a:hover {
        color: #93c5fd;
    }

    /* ============ STATS GRID ============ */
    .cmsapp-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .cmsapp-stat-card {
        background: white;
        padding: 24px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-left: 5px solid;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .cmsapp-stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
        border-radius: 0 0 0 60px;
    }

    .cmsapp-stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .cmsapp-stat-card.active {
        border-left-color: #10b981;
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    }

    .cmsapp-stat-card.inactive {
        border-left-color: #f59e0b;
        background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    }

    .cmsapp-stat-card.deleted {
        border-left-color: #ef4444;
        background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    }

    .cmsapp-stat-card.development {
        border-left-color: #8b5cf6;
        background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    }

    .cmsapp-stat-card.paused {
        border-left-color: #6366f1;
        background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    }

    .cmsapp-stat-card.total {
        border-left-color: #3b82f6;
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    }

    .cmsapp-stat-card.clients {
        border-left-color: #06b6d4;
        background: linear-gradient(135deg, #f0fdfa 0%, #cffafe 100%);
    }

    .cmsapp-stat-card.available {
        border-left-color: #f59e0b;
        background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    }

    .cmsapp-stat-number {
        font-size: 32px;
        font-weight: 800;
        margin-bottom: 8px;
        color: #1e293b;
    }

    .cmsapp-stat-label {
        color: #64748b;
        font-size: 14px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* ============ ACTIONS STYLES ============ */
    .cmsapp-actions {
        background: white;
        padding: 24px;
        border-radius: 16px;
        margin-bottom: 30px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    }

    .cmsapp-actions h3 {
        margin-bottom: 20px;
        color: #1e293b;
        font-size: 18px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cmsapp-action-buttons {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    .cmsapp-btn {
        padding: 12px 20px;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }

    .cmsapp-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .cmsapp-btn:hover::before {
        left: 100%;
    }

    .cmsapp-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .cmsapp-btn.primary {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    .cmsapp-btn.success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    .cmsapp-btn.warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    .cmsapp-btn.danger {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

    .cmsapp-btn.info {
        background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    }

    .cmsapp-btn.purple {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    }

    .cmsapp-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .cmsapp-btn.small {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* ============ SECTIONS STYLES ============ */
    .cmsapp-section {
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        margin-bottom: 30px;
    }

    .cmsapp-section-header {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        padding: 24px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cmsapp-section-title {
        font-size: 22px;
        font-weight: 700;
        color: #1e293b;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* ============ FILTERS STYLES ============ */
    .cmsapp-filters {
        background: white;
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .cmsapp-filters-row {
        display: flex;
        gap: 16px;
        align-items: center;
        flex-wrap: wrap;
    }

    .cmsapp-filter-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .cmsapp-filter-label {
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cmsapp-search-input {
        padding: 12px 16px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        font-size: 14px;
        min-width: 200px;
        transition: all 0.3s ease;
        background: white;
    }

    .cmsapp-search-input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .cmsapp-filter-select {
        padding: 12px 16px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        font-size: 14px;
        min-width: 150px;
        background: white;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .cmsapp-filter-select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .cmsapp-clear-filters {
        padding: 12px 16px;
        background: #f1f5f9;
        color: #64748b;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 500;
    }

    .cmsapp-clear-filters:hover {
        background: #e2e8f0;
        transform: translateY(-1px);
    }

    /* ============ RESOURCE LINKS STYLES ============ */
    .cmsapp-resource-links {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .cmsapp-resource-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .cmsapp-resource-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .cmsapp-resource-link.video {
        background: #fef3c7;
        color: #92400e;
        border: 1px solid #fcd34d;
    }

    .cmsapp-resource-link.video:hover {
        background: #fde68a;
        color: #78350f;
    }

    .cmsapp-resource-link.document {
        background: #e0e7ff;
        color: #3730a3;
        border: 1px solid #c7d2fe;
    }

    .cmsapp-resource-link.document:hover {
        background: #c7d2fe;
        color: #312e81;
    }

    /* ============ GRID STYLES ============ */
    .cmsapp-grid {
        padding: 24px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }

    .cmsapp-card {
        border: 2px solid #e2e8f0;
        border-radius: 16px;
        padding: 24px;
        transition: all 0.3s ease;
        position: relative;
        background: white;
        overflow: hidden;
    }

    .cmsapp-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
        border-radius: 0 0 0 40px;
    }

    .cmsapp-card:hover {
        border-color: #3b82f6;
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
        transform: translateY(-4px);
    }

    .cmsapp-card.active {
        border-color: #10b981;
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    }

    .cmsapp-card.inactive {
        border-color: #f59e0b;
        background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
        opacity: 0.8;
    }

    .cmsapp-card.deleted {
        border-color: #ef4444;
        background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
        opacity: 0.7;
    }

    .cmsapp-card.development {
        border-color: #8b5cf6;
        background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
        border-style: dashed;
    }

    .cmsapp-card.paused {
        border-color: #6366f1;
        background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
        opacity: 0.8;
    }

    .cmsapp-card.cmsapp-available-app {
        border-color: #f59e0b;
        background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
        opacity: 0.9;
    }

    .cmsapp-card.cmsapp-available-app:hover {
        border-color: #f59e0b;
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
        opacity: 1;
    }

    .cmsapp-status {
        position: absolute;
        top: 20px;
        right: 20px;
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cmsapp-status.active {
        background: #dcfce7;
        color: #166534;
    }

    .cmsapp-status.inactive {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-status.deleted {
        background: #fee2e2;
        color: #991b1b;
    }

    .cmsapp-status.development {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .cmsapp-status.paused {
        background: #e0e7ff;
        color: #3730a3;
    }

    .cmsapp-status.available {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-category {
        display: inline-block;
        background: #e0e7ff;
        color: #3730a3;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cmsapp-image {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: #64748b;
        border: 2px solid #e2e8f0;
    }

    .cmsapp-name {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 8px;
        color: #1e293b;
    }

    .cmsapp-url {
        font-size: 13px;
        color: #64748b;
        margin-bottom: 8px;
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
        background: #f8fafc;
        padding: 4px 8px;
        border-radius: 6px;
        display: inline-block;
    }

    .cmsapp-description {
        font-size: 14px;
        color: #64748b;
        margin-bottom: 16px;
        line-height: 1.6;
    }

    .cmsapp-card .cmsapp-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        background: none;
        padding: 0;
        margin: 0;
        box-shadow: none;
    }

    /* ============ CLIENT CARD STYLES ============ */
    .cmsapp-client-card {
        border: 2px solid #e2e8f0;
        border-radius: 16px;
        padding: 24px;
        position: relative;
        transition: all 0.3s ease;
        background: white;
        overflow: hidden;
    }

    .cmsapp-client-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
        border-radius: 0 0 0 40px;
    }

    .cmsapp-client-card:hover {
        border-color: #06b6d4;
        box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
        transform: translateY(-4px);
    }

    .cmsapp-client-card.active {
        border-color: #10b981;
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    }

    .cmsapp-client-card.inactive {
        border-color: #ef4444;
        background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
        opacity: 0.8;
    }

    .cmsapp-client-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .cmsapp-client-info h3 {
        font-size: 20px;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 4px;
    }

    .cmsapp-client-info .cmsapp-client-urlname {
        font-size: 13px;
        color: #64748b;
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
        background: #f8fafc;
        padding: 4px 8px;
        border-radius: 6px;
        display: inline-block;
    }

    .cmsapp-client-apps {
        margin-bottom: 16px;
    }

    .cmsapp-client-apps-title {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
    }

    .cmsapp-client-apps-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cmsapp-app-tag {
        background: #e0e7ff;
        color: #3730a3;
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
    }

    .cmsapp-app-tag.paused {
        background: #e0e7ff;
        color: #3730a3;
    }

    /* ============ NO RESULTS STYLES ============ */
    .cmsapp-no-results {
        grid-column: 1 / -1;
        text-align: center;
        color: #64748b;
        padding: 60px 20px;
    }

    .cmsapp-no-results-icon {
        font-size: 64px;
        margin-bottom: 16px;
        opacity: 0.5;
    }

    .cmsapp-no-results-title {
        font-size: 18px;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .cmsapp-no-results-text {
        font-size: 14px;
    }

    /* ============ AUTHENTICATION STYLES ============ */
    .cmsapp-auth-container {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000!important;
        padding: 20px;
    }

    .cmsapp-login-card {
        background: white;
        padding: 40px;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 420px;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    .cmsapp-login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 6px;
        background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    }

    .cmsapp-login-card.client-mode::before {
        background: linear-gradient(90deg, #059669, #10b981, #06b6d4);
    }

    .cmsapp-login-header {
        margin-bottom: 30px;
    }

    .cmsapp-login-icon {
        font-size: 52px;
        margin-bottom: 20px;
        background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .cmsapp-login-icon.client {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .cmsapp-login-title {
        font-size: 28px;
        font-weight: 700;
        margin-bottom: 8px;
        color: #1e293b;
    }

    .cmsapp-login-subtitle {
        color: #64748b;
        font-size: 14px;
        line-height: 1.5;
    }

    .cmsapp-login-form {
        text-align: left;
    }

    .cmsapp-login-button {
        width: 100%;
        padding: 14px;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .cmsapp-login-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .cmsapp-login-button:hover::before {
        left: 100%;
    }

    .cmsapp-login-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    }

    .cmsapp-login-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

    .cmsapp-login-button.client {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
    }

    .cmsapp-login-button.client:hover {
        box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
    }

    .cmsapp-auth-footer {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #e2e8f0;
        font-size: 12px;
        color: #64748b;
    }

    .cmsapp-version-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* ============ MODAL STYLES ============ */
    .cmsapp-modal {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        backdrop-filter: blur(4px);
    }

    .cmsapp-modal.show {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .cmsapp-modal-content {
        background: white;
        border-radius: 16px;
        padding: 30px;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        position: relative;
    }

    .cmsapp-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 2px solid #f1f5f9;
    }

    .cmsapp-modal-title {
        font-size: 22px;
        font-weight: 700;
        color: #1e293b;
    }

    .cmsapp-close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #64748b;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .cmsapp-close-btn:hover {
        background: #f1f5f9;
        color: #1e293b;
    }

    .cmsapp-form-group {
        margin-bottom: 20px;
    }

    .cmsapp-form-label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #374151;
        font-size: 14px;
    }

    .cmsapp-form-input,
    .cmsapp-form-textarea,
    .cmsapp-form-select {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        font-size: 14px;
        transition: all 0.3s ease;
        background: white;
    }

    .cmsapp-form-input:focus,
    .cmsapp-form-textarea:focus,
    .cmsapp-form-select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    /* ============ LOADING STYLES ============ */
    .cmsapp-loading {
        text-align: center;
        padding: 40px;
        color: #64748b;
    }

    .cmsapp-loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #e2e8f0;
        border-top: 4px solid #3b82f6;
        border-radius: 50%;
        animation: cmsappSpin 1s linear infinite;
        margin: 0 auto 16px;
    }

    @keyframes cmsappSpin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* ============ VISIBILITY CONTROLS ============ */
    .cmsapp-admin-only {
        display: block;
    }

    .cmsapp-client-only {
        display: none;
    }

    .cmsapp-client-mode .cmsapp-admin-only {
        display: none;
    }

    .cmsapp-client-mode .cmsapp-client-only {
        display: block;
    }

    /* ============ NOTIFICATION STYLES ============ */
    .cmsapp-notification {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        max-width: 400px;
        padding: 16px 20px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        animation: slideInRight 0.3s ease;
        backdrop-filter: blur(8px);
    }

    .cmsapp-notification.success {
        background: rgba(236, 253, 245, 0.95);
        color: #065f46;
        border: 1px solid #a7f3d0;
    }

    .cmsapp-notification.error {
        background: rgba(254, 242, 242, 0.95);
        color: #991b1b;
        border: 1px solid #fca5a5;
    }

    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    /* ============ SUPPORT SYSTEM STYLES ============ */
    /* Floating Support Buttons */
    #cmsapp-support-floating {
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .cmsapp-support-float-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: none;
        cursor: pointer;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .cmsapp-support-float-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    }

    .cmsapp-chat-btn {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    }

    .cmsapp-ticket-btn {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    }

    .cmsapp-support-badge {
        position: absolute;
        top: -2px;
        right: -2px;
        background: #fbbf24;
        color: #92400e;
        font-size: 11px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
        line-height: 1.2;
    }

    /* Support Modal Styles */
    .cmsapp-support-modal {
        position: fixed;
        bottom: 90px;
        left: 20px;
        width: 400px;
        height: 500px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        display: none;
        flex-direction: column;
        overflow: hidden;
        resize: both;
        min-width: 350px;
        min-height: 400px;
        max-width: 600px;
        max-height: 80vh;
    }

    .cmsapp-support-modal.show {
        display: flex;
    }

    .cmsapp-support-modal.minimized {
        height: 50px;
        resize: none;
    }

    .cmsapp-support-modal.minimized .cmsapp-support-modal-body {
        display: none;
    }

    .cmsapp-support-modal-header {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: move;
        flex-shrink: 0;
    }

    .cmsapp-support-modal-header h3 {
        font-size: 16px;
        font-weight: 600;
        margin: 0;
    }

    .cmsapp-support-modal-actions {
        display: flex;
        gap: 8px;
    }

    .cmsapp-support-minimize-btn,
    .cmsapp-support-close-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        width: 28px;
        height: 28px;
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: background-color 0.2s ease;
    }

    .cmsapp-support-minimize-btn:hover,
    .cmsapp-support-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .cmsapp-support-modal-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Admin Controls */
    .cmsapp-chat-admin-controls,
    .cmsapp-ticket-admin-controls {
        padding: 12px 16px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
    }

    .cmsapp-chat-admin-controls select,
    .cmsapp-ticket-admin-controls select {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 13px;
    }

    /* Chat Styles */
    .cmsapp-chat-messages {
        flex: 1;
        padding: 16px;
        overflow-y: auto !important;
        background: #f8fafc;
        max-height: 300px !important;
        min-height: 200px;
    }

    .cmsapp-chat-message {
        margin-bottom: 12px;
        display: flex;
    }

    .cmsapp-chat-message.own {
        justify-content: flex-end;
    }

    .cmsapp-chat-message-content {
        max-width: 80%;
        background: white;
        padding: 10px 12px;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .cmsapp-chat-message.own .cmsapp-chat-message-content {
        background: #3b82f6;
        color: white;
    }

    .cmsapp-chat-message-text {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .cmsapp-chat-message-time {
        font-size: 11px;
        opacity: 0.7;
    }

    .cmsapp-chat-empty {
        text-align: center;
        padding: 40px 20px;
        color: #64748b;
    }

    .cmsapp-chat-empty i {
        font-size: 32px;
        margin-bottom: 12px;
        display: block;
    }

    .cmsapp-chat-input-area {
        padding: 16px;
        border-top: 1px solid #e2e8f0;
        background: white;
        flex-shrink: 0;
    }

    .cmsapp-chat-input-wrapper {
        display: flex;
        gap: 8px;
        align-items: flex-end;
    }

    #cmsapp-chat-input {
        flex: 1;
        resize: none;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 14px;
        line-height: 1.4;
        min-height: 36px;
        max-height: 120px;
    }

    #cmsapp-chat-input:focus {
        outline: none;
        border-color: #3b82f6;
    }

    #cmsapp-chat-send-btn {
        background: #3b82f6;
        color: white;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease;
    }

    #cmsapp-chat-send-btn:hover {
        background: #2563eb;
    }

    #cmsapp-chat-send-btn:disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }

    /* Ticket Styles */
    .cmsapp-ticket-tabs {
        display: flex;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
    }

    .cmsapp-ticket-tab {
        flex: 1;
        padding: 12px 16px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: #64748b;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .cmsapp-ticket-tab.active {
        background: white;
        color: #3b82f6;
        border-bottom: 2px solid #3b82f6;
    }

    .cmsapp-ticket-tab:hover:not(.active) {
        background: #f1f5f9;
        color: #374151;
    }

    .cmsapp-ticket-tab-content {
        display: none;
        flex: 1;
        flex-direction: column;
        overflow: hidden;
    }

    .cmsapp-ticket-tab-content.active {
        display: flex;
    }

    .cmsapp-ticket-filters {
        padding: 16px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        gap: 12px;
        flex-shrink: 0;
    }

    .cmsapp-ticket-filters select {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 12px;
    }

    .cmsapp-tickets-list {
        flex: 1;
        overflow-y: auto !important;
        padding: 16px;
        max-height: 280px !important;
        min-height: 200px;
    }

    .cmsapp-ticket-item {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }

    .cmsapp-ticket-item:hover {
        border-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    }

    .cmsapp-ticket-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .cmsapp-ticket-id {
        font-family: monospace;
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
    }

    .cmsapp-ticket-status {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .cmsapp-ticket-status.open {
        background: #dcfce7;
        color: #166534;
    }

    .cmsapp-ticket-status.in_progress {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-ticket-status.resolved {
        background: #cffafe;
        color: #155e75;
    }

    .cmsapp-ticket-status.closed {
        background: #f3f4f6;
        color: #4b5563;
    }

    .cmsapp-ticket-title {
        font-size: 14px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .cmsapp-ticket-meta {
        display: flex;
        gap: 8px;
        align-items: center;
        font-size: 11px;
        color: #6b7280;
        flex-wrap: wrap;
    }

    .cmsapp-ticket-priority {
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .cmsapp-ticket-priority.low {
        background: #dcfce7;
        color: #166534;
    }

    .cmsapp-ticket-priority.medium {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-ticket-priority.high {
        background: #fee2e2;
        color: #991b1b;
    }

    .cmsapp-ticket-priority.urgent {
        background: #fecaca;
        color: #7f1d1d;
    }

    .cmsapp-ticket-app {
        background: #e0e7ff;
        color: #3730a3;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 500;
        font-family: monospace;
    }

    .cmsapp-ticket-client {
        background: #cffafe;
        color: #155e75;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 500;
        font-family: monospace;
    }

    .cmsapp-ticket-admin-actions {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        gap: 4px;
    }

    .cmsapp-ticket-replies-count {
        margin-top: 8px;
        font-size: 11px;
        color: #059669;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cmsapp-ticket-empty {
        text-align: center;
        padding: 40px 20px;
        color: #64748b;
    }

    .cmsapp-ticket-empty i {
        font-size: 32px;
        margin-bottom: 12px;
        display: block;
    }

    /* New Ticket Form */
    #cmsapp-ticket-tab-new {
    flex: 1;
    overflow-y: auto !important;
    padding: 16px;
    max-height: 370px !important;
    min-height: 200px;
    }

    /* Ticket Detail Styles */
    .cmsapp-ticket-detail-header {
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid #e2e8f0;
    }

    .cmsapp-ticket-detail-header h4 {
        font-size: 18px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 8px;
    }

    .cmsapp-ticket-detail-meta {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    .cmsapp-ticket-detail-description {
        margin-bottom: 20px;
    }

    .cmsapp-ticket-detail-description h5 {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
    }

    .cmsapp-ticket-detail-description p {
        color: #6b7280;
        line-height: 1.6;
    }

    .cmsapp-ticket-detail-info {
        background: #f8fafc;
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 20px;
        font-size: 13px;
        color: #4b5563;
    }

    .cmsapp-ticket-replies {
        margin-bottom: 20px;
        max-height: 200px;
        overflow-y: auto;
    }

    .cmsapp-ticket-replies h5 {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 12px;
    }

    .cmsapp-ticket-reply {
        background: #f8fafc;
        border-left: 3px solid #3b82f6;
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 0 8px 8px 0;
    }

    .cmsapp-ticket-reply-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .cmsapp-ticket-reply-header strong {
        color: #1f2937;
        font-size: 13px;
    }

    .cmsapp-ticket-reply-time {
        color: #6b7280;
        font-size: 11px;
    }

    .cmsapp-ticket-reply-content {
        color: #4b5563;
        font-size: 13px;
        line-height: 1.5;
    }

    .cmsapp-ticket-reply-form h5 {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
    }

    #cmsapp-ticket-reply-text {
        width: 100%;
        margin-bottom: 12px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 8px;
        font-size: 13px;
        resize: vertical;
        max-height: 120px;
    }

    /* Modal Content Scrolling */
    .cmsapp-modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }

    #cmsapp-ticket-detail-content {
        max-height: 60vh;
        overflow-y: auto;
        padding: 20px;
    }

    /* Support Loading and Error States */
    .cmsapp-support-loading {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 20px;
        color: #6b7280;
        font-size: 14px;
    }

    .cmsapp-support-error {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 20px;
        color: #dc2626;
        font-size: 14px;
        text-align: center;
    }

    /* ============ IMAGE UPLOAD STYLES ============ */
/* ============ IMAGE UPLOAD STYLES ============ */
.cmsapp-image-upload-section {
    margin-bottom: 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    background: #f8fafc;
}

.cmsapp-image-upload-area {
    margin-bottom: 20px;
}

.cmsapp-upload-dropzone {
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmsapp-upload-dropzone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.cmsapp-upload-dropzone.dragover {
    border-color: #10b981;
    background: #ecfdf5;
    border-style: solid;
}

.cmsapp-upload-content {
    pointer-events: none;
}

.cmsapp-upload-content i {
    font-size: 2.5rem;
    color: #6b7280;
    margin-bottom: 12px;
    display: block;
}

.cmsapp-upload-content p {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 16px;
}

.cmsapp-upload-content strong {
    color: #3b82f6;
}

.cmsapp-upload-content small {
    color: #6b7280;
    font-size: 13px;
}

.cmsapp-upload-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
}

.cmsapp-progress-bar {
    background: #f1f5f9;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cmsapp-progress-fill {
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.cmsapp-progress-text {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    text-align: center;
    display: block;
}

/* Uploaded Images Grid */
.cmsapp-uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding: 16px 0;
}

.cmsapp-uploaded-image-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.cmsapp-uploaded-image-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.cmsapp-uploaded-image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f1f5f9;
}

.cmsapp-uploaded-image-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    word-break: break-all;
}

.cmsapp-uploaded-image-actions {
    display: flex;
    gap: 6px;
}

.cmsapp-copy-url-btn {
    flex: 1;
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.cmsapp-copy-url-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.cmsapp-copy-url-btn.copied {
    background: #3b82f6;
}

.cmsapp-delete-image-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmsapp-delete-image-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.cmsapp-upload-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmsapp-upload-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Loading state */
.cmsapp-uploaded-image-card.loading {
    opacity: 0.6;
}

.cmsapp-uploaded-image-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .cmsapp-uploaded-images {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .cmsapp-uploaded-image-preview {
        height: 100px;
    }
    
    .cmsapp-upload-dropzone {
        padding: 20px 15px;
        min-height: 100px;
    }
    
    .cmsapp-upload-content i {
        font-size: 2rem;
    }
    
    .cmsapp-upload-content p {
        font-size: 14px;
    }
}
/* Missing file state */
.cmsapp-uploaded-image-card.missing-file {
    border-color: #fca5a5;
    background: #fef2f2;
}

.cmsapp-uploaded-image-card.missing-file::before {
    content: 'FILE MISSING';
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    z-index: 2;
}

/* Cleanup card specific styles */
.cleanup-card:hover {
    border-color: #f59e0b !important;
    background: #fef3c7 !important;
    transform: translateY(-2px);
}

    /* ============ RESPONSIVE STYLES ============ */
@media (max-width: 1200px) {
    .cmsapp-sidebar {
        width: 260px;
    }
    
    .cmsapp-header h1 {
        font-size: 28px;
    }
    
    .cmsapp-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .cmsapp-sidebar {
        width: 240px;
    }
    
    .cmsapp-header h1 {
        font-size: 24px;
    }
    
    .cmsapp-stats {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .cmsapp-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .cmsapp-layout {
        flex-direction: column;
    }

    .cmsapp-sidebar {
        width: 100%;
        height: auto;
        position: static;
        order: 1; /* Hiển thị sau header, trước main content */
        background: white;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .cmsapp-main-content {
        order: 2; /* Hiển thị sau sidebar menu */
        padding: 15px;
    }

    .cmsapp-sidebar-header {
        display: none; /* Ẩn header của sidebar trên mobile */
    }

    /* Mobile Grid Menu Layout - 2 cột */
.cmsapp-sidebar-menu {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 cột */
        gap: 8px;
        padding: 16px;
        background: white;
    }

    .cmsapp-menu-item {
        margin: 0;
        flex-shrink: 0;
    }

    .cmsapp-menu-link {
        padding: 12px 16px;
        border-radius: 10px;
        min-height: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
        border: 2px solid #f1f5f9;
        transition: all 0.3s ease;
        width: 100%;
    }

    .cmsapp-menu-link:hover {
        transform: none; /* Tắt transform trên mobile */
        border-color: #3b82f6;
    }

    .cmsapp-menu-link.active {
        border-color: #3b82f6;
    }

    .cmsapp-menu-icon {
        font-size: 18px;
        margin: 0;
    }

    .cmsapp-menu-text {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
    }

    .cmsapp-menu-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 2px 5px;
    }        
    .cmsapp-header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 0 15px;
    }

    .cmsapp-header h1 {
        font-size: 20px;
    }

    .cmsapp-header p {
        font-size: 14px;
    }

    .cmsapp-mode-indicator {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .cmsapp-stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .cmsapp-action-buttons {
        flex-direction: column;
    }
    
    .cmsapp-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .cmsapp-login-card {
        margin: 20px;
        padding: 30px;
    }

    .cmsapp-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cmsapp-search-input,
    .cmsapp-filter-select {
        min-width: auto;
        width: 100%;
    }

    #cmsapp-support-floating {
        bottom: 10px;
        left: 10px;
    }

    .cmsapp-support-float-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .cmsapp-support-modal {
        left: 10px;
        right: 10px;
        bottom: 70px;
        width: auto;
    }
}

@media (max-width: 480px) {
    /* Mobile menu 2 cột với kích thước nhỏ hơn */
     .cmsapp-sidebar-menu {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 12px;
    }

    .cmsapp-menu-link {
        padding: 10px 8px;
        min-height: 55px;
    }

    .cmsapp-menu-icon {
        font-size: 16px;
    }

    .cmsapp-menu-text {
        font-size: 11px;
    }

    .cmsapp-header {
        padding: 15px 0;
    }

    .cmsapp-header h1 {
        font-size: 18px;
    }

    .cmsapp-auth-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .cmsapp-auth-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .cmsapp-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cmsapp-stat-card {
        padding: 16px;
    }

    .cmsapp-stat-number {
        font-size: 24px;
    }

    .cmsapp-modal-content {
        width: 95%;
        padding: 20px;
    }
}
    /* ============ DETAILED DESCRIPTION MODAL ============ */
    #cmsapp-detailed-description-modal .cmsapp-modal-content {
        width: 95%;
        max-width: 900px;
        max-height: 90vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    #cmsapp-detailed-description-modal .cmsapp-modal-content > div:last-child {
        flex: 1;
        overflow-y: auto;
    }

    .ck-editor__editable {
        min-height: 350px !important;
    }

    .ck-editor {
        width: 100%;
    }

    @media (max-width: 768px) {
        #cmsapp-detailed-description-modal .cmsapp-modal-content {
            width: 98%;
            max-width: none;
            margin: 10px;
            max-height: 95vh;
        }
        
        .ck-editor__editable {
            min-height: 250px !important;
        }
    }

    /* Chat admin controls và ticket styles từ code cũ giữ nguyên */
    .cmsapp-chat-admin-controls,
    .cmsapp-ticket-admin-controls {
        padding: 12px 16px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
    }

    .cmsapp-chat-admin-controls select,
    .cmsapp-ticket-admin-controls select {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 13px;
    }

    .cmsapp-chat-messages {
        flex: 1;
        padding: 16px;
        overflow-y: auto !important;
        background: #f8fafc;
        max-height: 300px !important;
        min-height: 200px;
    }

    .cmsapp-chat-message {
        margin-bottom: 12px;
        display: flex;
    }

    .cmsapp-chat-message.own {
        justify-content: flex-end;
    }

    .cmsapp-chat-message-content {
        max-width: 80%;
        background: white;
        padding: 10px 12px;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .cmsapp-chat-message.own .cmsapp-chat-message-content {
        background: #3b82f6;
        color: white;
    }

    .cmsapp-chat-message-text {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .cmsapp-chat-message-time {
        font-size: 11px;
        opacity: 0.7;
    }

    .cmsapp-chat-empty {
        text-align: center;
        padding: 40px 20px;
        color: #64748b;
    }

    .cmsapp-chat-empty i {
        font-size: 32px;
        margin-bottom: 12px;
        display: block;
    }

    .cmsapp-chat-input-area {
        padding: 16px;
        border-top: 1px solid #e2e8f0;
        background: white;
        flex-shrink: 0;
    }

    .cmsapp-chat-input-wrapper {
        display: flex;
        gap: 8px;
        align-items: flex-end;
    }

    #cmsapp-chat-input {
        flex: 1;
        resize: none;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 14px;
        line-height: 1.4;
        min-height: 36px;
        max-height: 120px;
    }

    #cmsapp-chat-input:focus {
        outline: none;
        border-color: #3b82f6;
    }

    #cmsapp-chat-send-btn {
        background: #3b82f6;
        color: white;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease;
    }

    #cmsapp-chat-send-btn:hover {
        background: #2563eb;
    }

    #cmsapp-chat-send-btn:disabled {
        background: #9ca3af;
        cursor: not-allowed;
    }

    /* Ticket styles */
    .cmsapp-ticket-tabs {
        display: flex;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
    }

    .cmsapp-ticket-tab {
        flex: 1;
        padding: 12px 16px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: #64748b;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .cmsapp-ticket-tab.active {
        background: white;
        color: #3b82f6;
        border-bottom: 2px solid #3b82f6;
    }

    .cmsapp-ticket-tab:hover:not(.active) {
        background: #f1f5f9;
        color: #374151;
    }

    .cmsapp-ticket-tab-content {
        display: none;
        flex: 1;
        flex-direction: column;
        overflow: hidden;
    }

    .cmsapp-ticket-tab-content.active {
        display: flex;
    }

    .cmsapp-ticket-filters {
        padding: 16px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        gap: 12px;
        flex-shrink: 0;
    }

    .cmsapp-ticket-filters select {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 12px;
    }

    .cmsapp-tickets-list {
        flex: 1;
        overflow-y: auto !important;
        padding: 16px;
        max-height: 280px !important;
        min-height: 200px;
    }

    .cmsapp-ticket-item {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }

    .cmsapp-ticket-item:hover {
        border-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    }

    .cmsapp-ticket-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .cmsapp-ticket-id {
        font-family: monospace;
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
    }

    .cmsapp-ticket-status {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .cmsapp-ticket-status.open {
        background: #dcfce7;
        color: #166534;
    }

    .cmsapp-ticket-status.in_progress {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-ticket-status.resolved {
        background: #cffafe;
        color: #155e75;
    }

    .cmsapp-ticket-status.closed {
        background: #f3f4f6;
        color: #4b5563;
    }

    .cmsapp-ticket-title {
        font-size: 14px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .cmsapp-ticket-meta {
        display: flex;
        gap: 8px;
        align-items: center;
        font-size: 11px;
        color: #6b7280;
        flex-wrap: wrap;
    }

    .cmsapp-ticket-priority {
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .cmsapp-ticket-priority.low {
        background: #dcfce7;
        color: #166534;
    }

    .cmsapp-ticket-priority.medium {
        background: #fef3c7;
        color: #92400e;
    }

    .cmsapp-ticket-priority.high {
        background: #fee2e2;
        color: #991b1b;
    }

    .cmsapp-ticket-priority.urgent {
        background: #fecaca;
        color: #7f1d1d;
    }

    .cmsapp-ticket-app {
        background: #e0e7ff;
        color: #3730a3;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 500;
        font-family: monospace;
    }

    .cmsapp-ticket-client {
        background: #cffafe;
        color: #155e75;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 500;
        font-family: monospace;
    }

    .cmsapp-ticket-admin-actions {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        gap: 4px;
    }

    .cmsapp-ticket-replies-count {
        margin-top: 8px;
        font-size: 11px;
        color: #059669;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cmsapp-ticket-empty {
        text-align: center;
        padding: 40px 20px;
        color: #64748b;
    }

    .cmsapp-ticket-empty i {
        font-size: 32px;
        margin-bottom: 12px;
        display: block;
    }

    #cmsapp-ticket-tab-new {
        flex: 1;
        overflow-y: auto !important;
        padding: 16px;
        max-height: 370px !important;
        min-height: 200px;
    }
.cmsapp-name a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.cmsapp-name a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.cmsapp-name a:visited {
    color: inherit;
}
/* ============ URL OVERRIDE STYLES ============ */
.url-override-form {
    margin-bottom: 20px;
}

.url-override-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.url-override-toggle.enabled {
    border-color: #3b82f6;
    background: #eff6ff;
}

.url-override-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.url-override-fields {
    display: none;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.url-override-fields.show {
    display: grid;
}

.url-override-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.url-override-info h4 {
    color: #0c4a6e;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.url-override-info p {
    color: #0369a1;
    margin: 0;
    font-size: 13px;
}

.url-override-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.url-override-warning .icon {
    color: #d97706;
    margin-right: 8px;
}

.url-override-warning p {
    color: #92400e;
    margin: 0;
    font-size: 13px;
}

.url-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    font-family: monospace;
    font-size: 13px;
    color: #374151;
}

.url-preview.custom {
    background: #fdf2f8;
    border-color: #ec4899;
    color: #be185d;
}

.current-override-display {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.current-override-display h4 {
    color: #16a34a;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-override-display .override-details {
    font-size: 13px;
    color: #15803d;
}

.current-override-display .override-details div {
    margin-bottom: 4px;
}

.current-override-display .override-details strong {
    color: #14532d;
}

/* App card with URL override styles */
.url-override-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ec4899;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.url-override-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.url-display-section {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #64748b;
}

.url-display-section.has-override {
    border-left-color: #ec4899;
    background: #fef7f3;
}

.url-display-section .url-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.url-display-section.has-override .url-label {
    color: #be185d;
}

.url-display-section .url-value {
    font-family: monospace;
    font-size: 12px;
    color: #374151;
    word-break: break-all;
}

.url-display-section.has-override .url-value {
    color: #be185d;
    font-weight: 500;
}

/* Responsive cho modal */
@media (max-width: 768px) {
    #cmsapp-url-override-modal .cmsapp-modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .url-override-form {
        padding: 0;
    }
    
    .url-preview {
        font-size: 11px;
        padding: 8px;
    }

    .url-display-section {
        padding: 6px;
    }

    .url-display-section .url-value {
        font-size: 11px;
    }
}
/* Tags Management Styles */
.cmsapp-tags-management-section {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.cmsapp-current-tags {
    margin-bottom: 16px;
    min-height: 40px;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: white;
}

.cmsapp-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
    padding: 4px 8px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.cmsapp-tag-remove {
    cursor: pointer;
    padding: 0 2px;
    border-radius: 50%;
    color: #6b7280;
    transition: color 0.2s;
}

.cmsapp-tag-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.cmsapp-add-tag-section {
    position: relative;
}

.cmsapp-tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.cmsapp-tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.cmsapp-tag-suggestion-item:hover {
    background: #f8fafc;
}

.cmsapp-tag-suggestion-item:last-child {
    border-bottom: none;
}

.cmsapp-tag-suggestion-item.create-new {
    color: #059669;
    font-weight: 600;
}

.cmsapp-empty-tags {
    color: #64748b;
    font-style: italic;
    font-size: 13px;
    padding: 8px;
    text-align: center;
}
/* Setup Link Section Styles */
.cmsapp-setup-link-section {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.cmsapp-setup-link-section .cmsapp-form-input {
    max-width: 200px;
}