.btn-nuevo, .btn-guardar, .btn-export, .btn-cliente, .btn-historial {
    padding: 10px 18px; border: none; border-radius: 8px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    color: white;
}

.btn-nuevo { background: #6366f1; }
.btn-guardar { background: #f59e0b; }
.btn-export { background: #10b981; }
.btn-cliente { background: #3b82f6; }
.btn-historial { background: #8b5cf6; }

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top, rgba(102, 126, 234, 0.2), transparent 40%), rgba(8, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
}

.modal-content {
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    border-radius: 24px; width: min(800px, 95vw);
    max-height: 90vh; overflow-y: auto; padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.4);
    position: relative; animation: slideUpModal 0.4s ease;
}

body.dark-mode .modal-content { background: #2a2a2a; color: #eee; }

.publi-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.publi-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(102, 126, 234, 0.2));
    animation: pulse-logo 2s ease-in-out infinite;
}

.publi-header h2 { 
    font-size: 2.5em; background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-align: center; margin: 10px 0;
}

.publi-tagline { color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85em; }

.publi-section { margin-bottom: 20px; padding: 15px; border-radius: 15px; background: #f8fafc; border: 1px solid #eef2f7; }

.btn-start-app {
    width: 100%; padding: 18px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; font-size: 1.2em; font-weight: bold; cursor: pointer;
}

.modal-close { position: absolute; top: 20px; right: 20px; font-size: 2em; cursor: pointer; border: none; background: none; }
body.dark-mode .modal-close { color: white; }

/* Paneles de Control Superior */
.top-controls {
    display: flex; align-items: center; gap: 20px; margin-bottom: 15px; justify-content: flex-start;
    flex-wrap: wrap;
}

/* Nuevo Buscador Minimalista */
.search-box {
    display: flex; align-items: center; background: white; position: relative;
    padding: 8px 15px; border-radius: 12px; border: 1px solid #cbd5e1;
    flex: 1; max-width: 300px; gap: 10px;
}

.search-box input {
    border: none; outline: none; width: 100%; font-size: 0.9em;
    color: #0f172a; /* Texto con mayor contraste */
    font-weight: 500;
}

.search-box input::placeholder {
    color: #475569; /* Placeholder más visible */
}

.search-icon { color: #64748b; font-size: 0.9em; }

.search-results-dropdown {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0;
    background: white; border: 1px solid #cbd5e1; border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25); z-index: 5000;
    max-height: 450px; overflow-y: auto; overflow-x: hidden;
    animation: slideDown 0.2s ease-out;
}

.search-result-item {
    padding: 12px 18px; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 0.2s;
}

.search-result-item:hover { background: #f0f7ff; }
.search-result-item:last-child { border-bottom: none; }

.result-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.result-text { display: flex; flex-direction: column; min-width: 0; }

.result-name { 
    font-size: 0.85em; font-weight: 600; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.result-cat { font-size: 0.7em; color: #64748b; text-transform: uppercase; }
.result-price { font-size: 0.8em; font-weight: bold; color: #2563eb; margin-left: 10px; white-space: nowrap; }

/* Ajustes modo oscuro */
body.dark-mode .search-box { background: #334155; border-color: #475569; }
body.dark-mode .search-box input { color: white; }
body.dark-mode .search-results-dropdown { background: #1e293b; border-color: #334155; }
body.dark-mode .search-result-item { border-bottom-color: #334155; }
body.dark-mode .search-result-item:hover { background: #334155; }
body.dark-mode .result-name { color: #f1f5f9; }
body.dark-mode .result-cat { color: #94a3b8; }
body.dark-mode .result-price { color: #60a5fa; }

/* Botones de Detalles */
.btn-details-sm {
    background: #60a5fa; /* Color azul para detalles */
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    border-radius: 999px;
    font-size: 0.8em; /* Más pequeño */
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0; /* Evita que se encoja */
}
.btn-details-sm:hover { background: #3b82f6; transform: scale(1.05); }

.btn-details-inline {
    background: none;
    border: none;
    color: #60a5fa; /* Color azul para detalles */
    font-size: 0.9em;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}
.btn-details-inline:hover { color: #3b82f6; }
body.dark-mode .btn-details-inline { color: #93c5fd; }
body.dark-mode .btn-details-inline:hover { color: #60a5fa; }

.global-price-selector {
    display: flex; gap: 15px; background: rgba(255,255,255,0.5); 
    padding: 8px 15px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.05);
}

.cliente-panel, .historial-panel {
    padding: 20px; border-radius: 12px; margin-bottom: 20px;
    animation: slideInLeft 0.3s ease;
}

.cliente-panel { background: #eff6ff; border: 2px solid #3b82f6; color: #1e40af; }
.historial-panel { background: #fffbeb; border: 2px solid #f59e0b; color: #92400e; }

body.dark-mode .cliente-panel { background: #1e293b; border-color: #3b82f6; color: #bfdbfe; }
body.dark-mode .historial-panel { background: #2d2a1e; border-color: #f59e0b; color: #fde68a; }

.presupuesto-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; border-bottom: 1px solid rgba(0,0,0,0.05); background: white; border-radius: 8px; margin-bottom: 8px;
}

/* Selector de precios estilo checkbox */
.full-width { grid-column: 1 / -1; }
.price-type-selector { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(0,0,0,0.05); }

.checkbox-group { display: flex; gap: 25px; margin-top: 10px; }

.checkbox-item {
    display: flex; align-items: center; cursor: pointer;
    font-weight: 500; font-size: 0.9em; position: relative; padding-left: 30px;
    user-select: none; transition: color 0.2s;
}

.checkbox-item input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }

.checkmark {
    position: absolute; top: 0; left: 0; height: 20px; width: 20px;
    background-color: #fff; border: 2px solid #cbd5e1; border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-item:hover input ~ .checkmark { border-color: #667eea; background-color: #f8fafc; }

.checkbox-item input:checked ~ .checkmark {
    background-color: #667eea; border-color: #667eea;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.checkmark:after {
    content: ""; position: absolute; display: none;
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-item input:checked ~ .checkmark:after { display: block; }

body.dark-mode .checkmark { background-color: #334155; border-color: #475569; }
body.dark-mode .checkbox-item { color: #cbd5e1; }