/* Variables CSS personalizadas - Dark Theme */
:root {
    --bg-dark: #0a0b0d;
    --bg-dark-secondary: #14171c;
    --bg-dark-tertiary: #1a1d24;
    --sidebar-bg: #0f1115;
    --border-color: #2a2d35;
    --text-primary: #ffffff;
    --text-secondary: #a0a3a8;
    --text-muted: #6b6e76;
    --accent-red: #c44536;
    --accent-red-light: #d95f4e;
    --gradient-red: linear-gradient(135deg, #c44536, #d95f4e);
    --hover-bg: #1e2128;
}

/* Estilos base con Google Fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* App Container - Layout Principal */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 450px;
    height: 100vh;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    width: 40px;
    height: 40px;
    background: var(--gradient-red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.logo h5 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-content {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    position: relative;
}

.nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-dark-tertiary);
    color: var(--text-primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.badge-new {
    margin-left: auto;
    background-color: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Sidebar Search */
.sidebar-search {
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar-search h6 {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-box input {
    width: 100%;
    background-color: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

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

.search-box input:focus {
    outline: none;
    border-color: var(--accent-red);
}

/* Sidebar Categories */
.sidebar-categories {
    padding: 0 1.25rem;
}

.sidebar-categories h6 {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.category-item {
    margin-bottom: 0.25rem;
}

.category-btn {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s;
    cursor: pointer;
}

.category-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.category-btn i:first-child {
    width: 20px;
    text-align: center;
}

.category-content {
    padding: 0.5rem 0 0.5rem 2.75rem;
}

.category-content a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.category-content a:hover {
    color: var(--text-primary);
}

/* Mobile Close Button */
.mobile-close-btn {
    display: none;
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.mobile-close-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.mobile-close-btn:active {
    transform: scale(0.95);
}

@media (max-width: 992px) {
    .mobile-close-btn {
        display: flex;
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.btn-upgrade {
    width: 100%;
    background: var(--gradient-red);
    border: 1px solid white;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(196, 69, 54, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.credits-info {
    background-color: var(--bg-dark-tertiary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.credits-info small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.credits-info strong {
    font-size: 1.1rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--bg-dark-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details small {
    display: block;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    background-color: var(--bg-dark-secondary);
    padding: 2rem;
    overflow-y: auto;
}

.tool-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: var(--gradient-red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tool-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}

.tool-header h4 span {
    font-weight: 400;
    line-height: 1.4;
    font-size: 1rem;
}

.tool-header p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.tool-section {
    background-color: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.section-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Upload Area */
.upload-area {
    background-color: var(--bg-dark-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--accent-red);
    background-color: rgba(196, 69, 54, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: var(--bg-dark);
}

.upload-area h6 {
    font-weight: 600;
    margin-top: 1rem;
}

/* Form Styles */
.form-label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-control {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.form-control:focus {
    background-color: var(--bg-dark-secondary);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Generate Button */
.btn-generate {
    width: 100%;
    background: var(--gradient-red);
    border: 1px solid white;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(196, 69, 54, 0.4);
}

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

/* ========== RESULT PANEL ========== */
.result-panel {
    background-color: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.result-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-content {
    flex: 1;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-placeholder {
    text-align: center;
    max-width: 350px;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background-color: var(--bg-dark-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: var(--text-muted);
}

.result-placeholder h5 {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;
}

.result-placeholder p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-start {
    background-color: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-start:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-red);
}

.result-steps {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.step-item {
    text-align: center;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-circle.active {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.step-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 260px 1fr 400px;
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 260px 1fr;
    }
    
    .result-panel {
        display: none;
    }
    
    .feedback-modal {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s;
    }
    
    .sidebar.open {
        left: 0;
    }
}

/* ========== AUTH LOADER ========== */
#authLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#authLoader.hide {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(196, 69, 54, 0.2);
    border-top: 4px solid #c44536;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    color: #a0a0a0;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
}

/* ========== COLOR PICKER MODAL ========== */
.color-option {
    width: 100%;
    background: #252525;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.color-option:hover {
    background: #2a2a2a;
    border-color: #c44536;
    transform: translateY(-2px);
}

.color-option.selected {
    background: #2a2a2a;
    border-color: #c44536;
    box-shadow: 0 0 0 3px rgba(196, 69, 54, 0.2);
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== ACTION BUTTONS ========== */
.btn-action {
    width: 100%;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-action-primary {
    background: linear-gradient(135deg, #c44536, #d95f4e);
    color: white;
    border: 1px solid white;
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(196, 69, 54, 0.4);
}

.btn-action-secondary {
    background: #252525;
    color: #ffffff;
    border: 2px solid #444;
}

.btn-action-secondary:hover {
    background: #2a2a2a;
    border-color: #c44536;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ========== MOBILE STYLES ========== */

/* Mobile Header - Solo visible en mobile */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-menu-btn {
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.mobile-menu-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.mobile-logo {
    flex: 1;
    text-align: center;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Media Queries para Tablet y Mobile */
@media (max-width: 1024px) {
    /* Layout de 2 columnas: sidebar oculto, contenido principal */
    .app-container {
        grid-template-columns: 1fr 400px;
    }
    
    .sidebar {
        position: fixed;
        left: -70%;
        top: 0;
        bottom: 0;
        width: 70%;
        z-index: 1001;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .mobile-overlay {
        display: block;
    }
}

@media (max-width: 768px) {
    /* Layout mobile: flujo vertical sin grid */
    .app-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .main-content {
        padding: 1rem;
        overflow-y: visible;
        order: 2;
    }
    
    /* Sidebar se mantiene fixed para overlay */
    .sidebar {
        order: 1;
    }
    
    /* Result panel inline en mobile, debajo del contenido */
    .result-panel {
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        height: auto;
        max-height: none;
        order: 3;
        display: block !important;
    }
    
    /* Tool sections más compactas */
    .tool-section {
        padding: 1.25rem;
    }
    
    .tool-header {
        padding: 1.25rem;
    }
    
    /* Upload area más pequeña */
    .upload-area {
        min-height: 200px;
    }
    
    /* Botones de acción apilados */
    .btn-action {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    /* Ajustes para pantallas muy pequeñas */
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .result-panel {
        max-width: 100%;
    }
    
    .mobile-header {
        padding: 0.75rem 1rem;
    }
    
    .tool-header h4 {
        font-size: 1.25rem;
    }
    
    .tool-header p {
        font-size: 0.85rem;
    }
    
    /* Modal más compacto */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .color-option {
        padding: 0.75rem;
    }
    
    .color-circle {
        width: 40px !important;
        height: 40px !important;
    }
    
    .color-name {
        font-size: 0.75rem;
    }
}

/* ========== CLIENT ASSIGNMENT PANEL ========== */

.client-toggle-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.client-toggle-btn:hover {
    border-color: var(--accent-red);
    color: var(--text-primary);
    background: rgba(196, 69, 54, 0.05);
}

.client-toggle-btn.active {
    border-color: var(--accent-red);
    border-style: solid;
    color: var(--text-primary);
    background: rgba(196, 69, 54, 0.06);
}

.client-toggle-btn .toggle-label {
    flex: 1;
}

.client-toggle-btn .toggle-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.25s;
}

.client-toggle-btn.active .toggle-chevron {
    transform: rotate(180deg);
}

.client-panel {
    margin-top: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.client-panel .form-select {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    font-family: 'Raleway', sans-serif;
}

.client-panel .form-select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(196, 69, 54, 0.15);
    background-color: var(--bg-dark-secondary);
    color: var(--text-primary);
}

.client-panel .form-select option {
    background-color: #1a1d24;
    color: var(--text-primary);
}

.client-panel .form-control {
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
}

.client-panel .form-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.client-section-divider {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

/* ── Client mode tabs ──────────────────────────────── */
.client-mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.client-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.client-mode-tab:hover {
    border-color: rgba(196, 69, 54, 0.4);
    color: var(--text-primary);
}

.client-mode-tab.active {
    background: rgba(196, 69, 54, 0.12);
    border-color: rgba(196, 69, 54, 0.45);
    color: #fff;
}

/* ── Existing client search ────────────────────────── */
.cp-search-wrap {
    position: relative;
    margin-bottom: 0.5rem;
}

.cp-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.cp-search-wrap input {
    width: 100%;
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.6rem 0.75rem 0.6rem 2.15rem;
    font-size: 0.85rem;
    font-family: 'Raleway', sans-serif;
    transition: border-color 0.2s;
}

.cp-search-wrap input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(196, 69, 54, 0.15);
}

/* ── Client results list ───────────────────────────── */
.cp-results {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark-tertiary);
}

.cp-msg {
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.cp-msg a {
    color: var(--accent-red);
    text-decoration: none;
}

.cp-msg a:hover { text-decoration: underline; }

.cp-result-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cp-result-item:last-child { border-bottom: none; }

.cp-result-item:hover { background: rgba(255, 255, 255, 0.04); }

.cp-result-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(196, 69, 54, 0.1);
    border: 1px solid rgba(196, 69, 54, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-red);
    flex-shrink: 0;
}

.cp-result-info { flex: 1; min-width: 0; }

.cp-result-name {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-result-vehicle {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-result-check {
    color: transparent;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Selected client chip ──────────────────────────── */
.cp-selected-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(196, 69, 54, 0.1);
    border: 1px solid rgba(196, 69, 54, 0.3);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cp-selected-chip span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.15rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.cp-clear-btn:hover { color: var(--accent-red); }

/* ========== SIDEBAR CLIENTS BADGE ========== */

.clients-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ========== CLIENTS LIST MODAL ========== */

.clients-modal-search {
    position: relative;
    margin-bottom: 1rem;
}

.clients-modal-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.clients-modal-search input {
    width: 100%;
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: 'Raleway', sans-serif;
    transition: border-color 0.2s;
}

.clients-modal-search input:focus {
    outline: none;
    border-color: var(--accent-red);
}

.clients-modal-search input::placeholder { color: var(--text-muted); }

.clients-list-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 2px;
}

/* Client Card */
.client-card {
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
}

.client-card:hover {
    border-color: rgba(196, 69, 54, 0.4);
}

.client-card.expanded {
    border-color: var(--accent-red);
}

.client-card-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
}

.client-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.client-info { flex: 1; min-width: 0; }

.client-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-vehicle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-phone {
    font-size: 0.77rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.client-badge {
    display: inline-block;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.68rem;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: baseline;
}

.client-badge.plate {
    font-family: monospace;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.client-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.client-mod-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.77rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.color-dot-mini {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.client-delete-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.client-delete-btn:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #dc3545;
}

/* Client detail (expanded) */
.client-detail {
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.client-detail-inner {
    padding: 1rem;
}

.cd-section {
    margin-bottom: 1rem;
}

.cd-section:last-child { margin-bottom: 0; }

.cd-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

.cd-field {
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 0.45rem 0.65rem;
}

.cd-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.cd-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cd-notes {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    background: var(--bg-dark-tertiary);
    border-radius: 7px;
    padding: 0.6rem 0.8rem;
}

.cd-mods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cd-mod-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-dark-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.cd-mod-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.cd-mod-thumb-ph {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.cd-mod-info { flex: 1; min-width: 0; }

.cd-type-badge {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.67rem;
    color: var(--text-secondary);
}

.cd-mod-link {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.cd-mod-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-red);
}

/* Empty state */
.clients-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.clients-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.clients-empty-state p {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.clients-empty-state small {
    font-size: 0.82rem;
    opacity: 0.6;
}
