:root {
    --primary-color: #facc15;
    --primary-dark: #ca8a04;
    --text-color: #f8fafc; /* slate-800 mais sÃ³lido */
    --text-light: #94a3b8; 
    --bg-color: #0f172a; /* deep slate escuro */
    --card-bg: rgba(30, 41, 59, 0.45); /* dark glass */
    --border-color: #e2e8f0; /* Borda bem nÃ­tida */
    --success-color: #10b981; 
    --danger-color: #ef4444; 

    /* Sombras secas estilo Corporate (nÃ£o espalhadas) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    /* Bordas fechadas/retas SaaS */
    --radius-md: 6px;
    --radius-lg: 10px;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    font-size: 14px; /* O coraÃ§Ã£o do compactamento (Reduz tudo que usa REM) */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    color: #f8fafc;
    line-height: 1.5;
    padding-bottom: 40px;
    position: relative;
    min-height: 100vh;
}

.glow-effect {
    position: absolute;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top center, rgba(234, 179, 8, 0.15) 0%, rgba(15, 23, 42, 0) 50%);
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    animation: pulse-glow 8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Desktop Grid Layout */
.desktop-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1024px) {
    .desktop-grid-layout {
        display: grid;
        grid-template-columns: 1fr 380px;
        align-items: start;
    }

    .summary-actions-sidebar {
        position: sticky;
        top: 100px; /* Offset below sticky header */
    }
}

/* Header */
.app-header {
    background: rgba(15, 23, 42, 0.4); /* Glassmorphism Tech */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 0;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); /* Sombra pesada */
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Linha leve metÃ¡lica */
}

.app-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

/* Cards */
.card {
    background-color: var(--card-bg); /* JÃ¡ definido como Dark Glass em variÃ¡veis */
    border: 1px solid rgba(234, 179, 8, 0.3); box-shadow: 0 0 15px rgba(234, 179, 8, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15); /* Drop shadow elegante de vidro */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 16px;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: rgba(234, 179, 8, 0.4); /* Foco amarelo gold */
    box-shadow: 0 10px 40px -5px rgba(234, 179, 8, 0.15);
}

.card-header {
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.3); /* Contraste sutil do vidro */
    border-bottom: 1px solid rgba(234, 179, 8, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    color: var(--primary-dark);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

.card-body {
    padding: 16px;
}

/* Forms */
/* Desktop ERP Form Grid */
.form-grid {
    display: grid;
    gap: 16px;
}

.items-end {
    align-items: flex-end;
}

@media (min-width: 768px) {
    .form-grid.grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid.grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-grid .span-2 {
        grid-column: span 2;
    }
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

/* Compact Forms on Desktop */
@media (min-width: 1024px) {
    .form-group {
        margin-bottom: 12px;
    }
    
    .card-body {
        padding: 20px;
    }

    /* Mais denso */
    .form-control, input[type="text"], input[type="number"], input[type="tel"], select, textarea {
        height: 34px !important; 
        font-size: 0.9rem !important;
    }
    
    textarea.form-control {
        height: auto !important;
    }

    .form-group label {
        font-size: 0.8rem !important;
        margin-bottom: 6px !important;
    }

    .btn {
        height: 34px !important;
        font-size: 0.95rem !important;
    }
    
    .btn-large {
        height: 48px !important;
    }
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, .form-group select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    background-color: rgba(30, 41, 59, 0.7);
    color: #f8fafc;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15);
}

.input-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.grow {
    flex-grow: 1;
    min-width: 150px;
    /* Garante que nÃ£o fique muito pequeno antes de quebrar */
}

/* --- Tabs --- */
.tabs-header {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 4px;
}

.tab-btn {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
    background: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: #f8fafc;
}

.tab-btn.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.w-half {
    width: 50%;
}

.w-small {
    width: 100px;
    flex-shrink: 0;
}

.w-xs {
    width: 80px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(to right, #fcd34d, #fbbf24);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.btn-large {
    width: 100%;
    height: 56px;
    font-size: 1.125rem;
}

.full-width {
    width: 100%;
}

/* Lists */
.items-list {
    margin-top: 16px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

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

.item-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
}

.item-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-price {
    font-weight: 600;
}

.btn-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

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

/* Totals */
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
    font-weight: 700;
}

.highlight-text {
    color: var(--primary-dark);
}

.total-summary {
    margin-bottom: 16px;
    padding: 0;
}

.summary-line {
    background-color: rgba(30, 41, 59, 0.7);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.grand-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f8fafc;
    background: linear-gradient(to right, #fcd34d, #fbbf24);
    padding: 6px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
}

/* Suggestions / Autocomplete */
.relative {
    position: relative;
}

/* Container for positioning if needed, though .relative on form-group handles it */
.suggestions-list {
    position: absolute;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    top: 100%;
    left: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

#serviceSuggestions {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 350px;
    overflow-y: auto;
}

/* Spacer to ensure last item is fully visible */
#serviceSuggestions::after {
    content: "";
    display: block;
    height: 80px;
    /* Large spacer */
    width: 100%;
    pointer-events: none;
}

/* Custom Scrollbar */
#serviceSuggestions::-webkit-scrollbar {
    width: 6px;
}

#serviceSuggestions::-webkit-scrollbar-track {
    background: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

#serviceSuggestions::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

#serviceSuggestions::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
    background: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #f8fafc;
}

.suggestion-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Rich Suggestion Styles */
.suggestion-item-rich {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

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

.suggestion-item-rich:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.suggestion-name {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.suggestion-prices {
    display: flex;
    gap: 6px;
}

.price-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.price-chip span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 2px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.price-chip strong {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Hover Effects */
.price-chip:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.price-chip:active {
    transform: translateY(0);
}

/* Specific Colors - Premium Approach */

/* Minimum - Clean Gray/Green */
.price-chip.min {
    border-bottom: 3px solid #cbd5e1;
}

.price-chip.min:hover {
    border-bottom-color: #10b981;
}

.price-chip.min:hover strong {
    color: #059669;
}

/* Average - Gold (The Highlight) */
.price-chip.avg {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-bottom: 3px solid #f59e0b;
}

.price-chip.avg:hover {
    background-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.15);
}

.price-chip.avg span {
    color: #fbbf24;
}

.price-chip.avg strong {
    color: #facc15;
}

/* Maximum - Premium Black/Red */
.price-chip.max {
    border-bottom: 3px solid #334155;
}

.price-chip.max:hover {
    border-bottom-color: #ef4444;
}

.price-chip.max:hover strong {
    color: #f87171;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shimmer Effect for Main Button */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 200%;
    }
}

/* Logo Preview */
.logo-preview-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-preview-container img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

/* Custom File Input */
.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.custom-file-input label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px dashed var(--border-color);
    color: var(--text-light);
    transition: all 0.2s;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.custom-file-input label:hover {
    border-color: var(--primary-dark);
    background-color: #fffbeb;
    color: var(--primary-dark);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 95%;
    max-width: 500px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* Allow max height */
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

/* Fix for modal body scroll */
.modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: rgba(30, 41, 59, 0.7);
    display: block;
}

/* Service Modal Specifics */
#serviceSearchModal:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.services-list-modal {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Smaller button for header */
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 0.75rem;
}

/* Category Header in Modal */
.category-header {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-dark);
    padding: 10px 15px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-top: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    border-left: 3px solid var(--primary-color);
}

.category-header:first-child {
    margin-top: 0;
}

.category-header span {
    flex-grow: 1;
}

.suggestion-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 5px;
    font-style: italic;
    line-height: 1.2;
    padding: 4px 8px;
    background-color: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
}

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

.modal-body.pdf-preview {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

#pdf-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

#pdf-preview-container canvas,
#pdf-preview-container img {
    max-width: 100%;
    height: auto !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: transparent;
}

.modal-footer .btn {
    min-width: 120px;
}

.modal-footer .full-width {
    flex: 1;
}

/* =========================================
   PDF GENERATION STYLES (COMPACT & ABNT)
   ========================================= */

/* Main PDF Container */
.pdf-container {
    padding: 15mm 15mm;
    /* Reduced margins (approx 1.5cm) */
    background: white;
    font-family: 'Arial', sans-serif;
    /* ABNT Font */
    font-size: 10pt;
    /* Compact sizing */
    line-height: 1.3;
    color: #000;
    max-width: 800px;
    margin: 0 auto;
}

/* PDF Template Wrapper */
/* Actions Area */
.actions-area {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.actions-area .btn {
    flex: 1;
}

/* PDF Generation uses a separate window with its own styles now. */
/* These styles are kept minimal just in case user tries to Ctrl+P the main page */
@media print {
    body * {
        visibility: hidden;
    }

    .app-header,
    .container,
    .modal-overlay,
    .actions-area {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .input-row {
        flex-direction: column;
        gap: 16px;
    }

    .w-half,
    .w-small {
        width: 100%;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Payment Chips Redesign */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
    color: #f8fafc;
}

.checkbox-group label:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
    color: #f8fafc;
}

/* Selected State - Usando :has() para suporte moderno */
.checkbox-group label:has(input:checked) {
    background-color: rgba(245, 158, 11, 0.2);
    border-color: var(--primary-dark);
    color: #f8fafc;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.1);
}

/* Fallback para navegadores sem :has() (input dentro do label) */
.checkbox-group input:checked+span {
    font-weight: 700;
    color: #f8fafc;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Input Validation Tooltip */
.input-tooltip {
    position: absolute;
    background-color: #0f172a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.input-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.9) transparent transparent transparent;
}

.input-tooltip.show {
    opacity: 1;
    bottom: calc(100% + 5px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background-color: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    min-width: 300px;
    justify-content: center;
    backdrop-filter: blur(8px);
}

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

.toast.warning {
    background-color: rgba(234, 179, 8, 0.9);
    border-color: #f59e0b;
    color: #000;
    font-weight: 600;
}

.toast.error {
    background-color: rgba(239, 68, 68, 0.9);
    border-color: #dc2626;
    color: #fff;
}

.toast i {
    width: 20px;
    height: 20px;
}
/* --- Budget History Cards (Dark Tech UI) --- */
.status-section {
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Letreiros Glow */
.status-header.negotiating h3 { color: #60a5fa !important; text-shadow: 0 0 10px rgba(96, 165, 250, 0.4); }
.status-header.won h3 { color: #34d399 !important; text-shadow: 0 0 10px rgba(52, 211, 153, 0.4); }
.status-header.lost h3 { color: #94a3b8 !important; }

.status-count {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: auto;
}

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

.budget-card {
    background: rgba(30, 41, 59, 0.6);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.budget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* Status Neons top border */
.budget-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.budget-card.status-negotiating::before { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.budget-card.status-won::before { background: #10b981; box-shadow: 0 0 8px #10b981; }
.budget-card.status-lost::before { background: #64748b; }

.budget-header-card {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    align-items: flex-start;
}

.budget-client-info h4 {
    color: #f8fafc;
    font-size: 1rem;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.budget-client-info p {
    color: #94a3b8;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.budget-date {
    font-size: 0.75rem;
    color: #cbd5e1;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.budget-price-block {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-price-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.budget-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.budget-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-status-action, .btn-icon-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
}

.btn-status-action:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-status-action.action-won:hover { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.btn-status-action.action-lost:hover { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.btn-status-action.action-neg:hover { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.btn-icon-action:hover { background: rgba(239, 68, 68, 0.2); color: #f87171; }


/* --- Global Sidebar (Engineering Dark Tech) --- */
body {
    margin: 0;
    overflow-x: hidden;
}
.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}
.sidebar {
    width: 240px;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(234, 179, 8, 0.15) !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 5px 0 25px rgba(0,0,0,0.4) !important;
}
.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(15, 23, 42, 0.9) !important;
}
.sidebar-header h2 {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.sidebar-nav {
    padding: 24px 16px !important;
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    flex: 1;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px !important;
    border-radius: var(--radius-md) !important;
    color: #94a3b8 !important;
    text-decoration: none;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid transparent !important;
    position: relative;
    overflow: hidden;
    background: transparent !important;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.1) !important;
}
.nav-link.active {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.15) 0%, rgba(234, 179, 8, 0.02) 100%) !important;
    color: #facc15 !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
    box-shadow: inset 4px 0 0 0 #facc15, 0 4px 15px rgba(234, 179, 8, 0.1) !important;
    font-weight: 700 !important;
    transform: translateX(4px);
}
.nav-link.active i {
    color: #facc15 !important;
    filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.6)) !important;
}
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 10;
    min-width: 0; /* Evitar overflow horizontal em flexbox */
}

/* ================================================================
   SIDEBAR GLOBAL
   ================================================================ */
/* Sidebar Consolidada (Removida duplicaÃ§Ã£o) */

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(234,179,8,0.12);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-link i { width: 18px; height: 18px; flex-shrink: 0; }

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

.nav-link.active {
    background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(234,179,8,0.05));
    color: #eab308;
    box-shadow: inset 0 0 0 1px rgba(234,179,8,0.2);
}

/* BotÃ£o fechar dentro do drawer â€” oculto no desktop */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    border-radius: 8px;
    width: 32px; height: 32px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-close-btn:hover { background: rgba(255,255,255,0.1); color:#f8fafc; }

/* ================================================================
   TOP BAR MOBILE â€” Oculta no desktop
   ================================================================ */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 58px;
    background: rgba(10, 15, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(234,179,8,0.18);
    z-index: 900;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.mobile-topbar-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* ===== BOTÃƒO HAMBURGUER ===== */
.hamburger-btn {
    width: 44px; height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hamburger-btn:hover { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.3); }

.hamburger-btn span {
    display: block;
    width: 20px; height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AnimaÃ§Ã£o X quando ativo */
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #eab308; }
.hamburger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #eab308; }

/* ================================================================
   RESPONSIVO MOBILE â‰¤ 768px
   ================================================================ */
@media (max-width: 768px) {
    /* Mostrar top bar */
    .mobile-topbar { display: flex; }

    /* BotÃ£o fechar visÃ­vel dentro do drawer */
    .sidebar-close-btn { display: flex; }

    /* Sidebar comporta como drawer */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 270px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
    }

    /* ConteÃºdo principal: empurrado abaixo da top bar */
    .main-content {
        margin-left: 0 !important;
        padding: 74px 16px 32px !important;
    }

    /* Header interno das pÃ¡ginas */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    /* Grids adaptativos */
    .overview-grid,
    .agenda-cards-grid,
    .budget-grid,
    .client-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }
}

/* tablet: sidebar visÃ­vel, top bar oculta */
@media (min-width: 769px) {
    .mobile-topbar { display: none !important; }
    .sidebar { transform: translateX(0) !important; box-shadow: none; }
    .sidebar-close-btn { display: none !important; }
}


/* --- Eletrica App v2.2: ERP Classic Layout (Reversion) --- */
.modern-subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Search Bar Modern */
.search-container-erp {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    background: transparent;
    flex-wrap: wrap; /* Permitir quebrar linha em telas menores */
    width: 100%;
}

.search-label {
    font-weight: 700;
    color: #f8fafc;
    font-size: 1rem;
    height: 44px;
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 5;
}

.search-input-wrapper input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 0 12px 0 48px;
    height: 44px !important;
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    line-height: 44px;
}

.btn-search-erp {
    background: #334155;
    color: #94a3b8;
    border: none;
    padding: 0 30px;
    height: 44px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search-erp:hover {
    background: #475569;
    color: #fff;
}

.btn-new-quote-erp {
    background: transparent;
    color: #2dd4bf; /* Green/Teal do Cadastrar */
    border: none;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: auto;
}

/* Status Filter Tabs */
.status-tabs-erp {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.status-tabs-erp::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.status-tab-btn-erp {
    background: #1e2a3b;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-transform: uppercase;
}

.status-tab-btn-erp i {
    width: 20px;
    height: 20px;
}

.status-tab-btn-erp span.count-badge {
    background: #334155;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.status-tab-btn-erp.active {
    background: rgba(45, 212, 191, 0.1);
    border: 1.5px solid #2dd4bf;
}

/* ERP Table */
.erp-table-wrapper {
    background: #1e293b;
    border-radius: 12px;
    overflow-x: auto; /* Permitir scroll horizontal na tabela */
    border: 1px solid #334155;
    width: 100%;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.erp-table th {
    background: #0f172a;
    padding: 15px 20px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.erp-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #334155;
    color: #f8fafc;
    font-size: 0.95rem;
}

.erp-table tr:last-child td {
    border-bottom: none;
}

.erp-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.row-type-icon {
    color: #2dd4bf;
    width: 18px;
    height: 18px;
}

.badge-atrasado {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-view-erp {
    background: transparent;
    border: none;
    color: #2dd4bf;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.btn-view-erp:hover {
    opacity: 0.8;
}

.quote-number-cell {
    font-weight: 800;
}

/* Modal Detalhes (Quick View) */
.quick-view-modal {
    max-width: 650px !important;
}

.quick-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.quick-view-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
}

.quick-view-card h4 {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.quick-view-val {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
}

.action-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 25px;
}

/* BotÃ£o Premium do Hub (estilo cartÃ£o) */
.btn-action-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    gap: 10px;
    text-align: center;
}

.btn-action-hub i {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.btn-action-hub span {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-action-hub:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Variantes de cor */
.btn-action-hub.primary {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1) 0%, rgba(234, 179, 8, 0.02) 100%);
    border-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
}
.btn-action-hub.primary:hover {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(234, 179, 8, 0.05) 100%);
    border-color: #facc15;
}

.btn-action-hub.success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}
.btn-action-hub.success:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.btn-action-hub.danger {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.btn-action-hub.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

@media (max-width: 600px) {
    .search-container-erp { flex-wrap: wrap; }
    .btn-new-quote-erp { margin-left: 0; width: 100%; justify-content: flex-start; }
    .erp-table th:nth-child(1), .erp-table td:nth-child(1),
    .erp-table th:nth-child(2), .erp-table td:nth-child(2),
    .erp-table th:nth-child(3), .erp-table td:nth-child(3) { display: none; }
}

/* --- Eletrica App v2.3: Topo Refinement (Reference Fix) --- */
.tabs-header { justify-content: space-between !important; align-items: center !important; padding-bottom: 0 !important; }
.tab-btn.active { color: #facc15 !important; border-bottom: 3px solid #facc15 !important; }
.btn-verify-top { background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); color: #f8fafc; padding: 8px 16px; border-radius: 10px; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-bottom: 8px; }
.btn-verify-top:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.btn-verify-top i { width: 20px; height: 20px; }


/* --- Eletrica App v3.0: Página de Detalhes --- */
.details-page-container { animation: fadeIn 0.3s ease; }
.details-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.details-header h2 { font-size: 1.5rem; margin: 0; color: #facc15; }
.btn-back-details { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-light); padding: 8px 16px; border-radius: 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s; font-weight: 600; font-size: 0.9rem; }
.btn-back-details:hover { background: rgba(255,255,255,0.1); color: #fff; transform: translateX(-4px); }
.details-body-grid { display: grid; grid-template-columns: 1fr 350px; gap: 24px; }
.details-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-content: start; }
.details-actions-hub { background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; }
.details-actions-hub h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-top: 0; margin-bottom: 20px; }
@media (max-width: 992px) { .details-body-grid { grid-template-columns: 1fr; } .details-header { flex-direction: column; align-items: flex-start; gap: 12px; } }


/* --- Eletrica App v3.1: Edição Interativa de Detalhes --- */
.quick-view-card.clickable { cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.quick-view-card.clickable:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); border-color: #facc15; }

.status-options-list { display: flex; flex-direction: column; gap: 8px; }
.status-opt { display: flex; align-items: center; gap: 16px; padding: 14px 20px; background: rgba(30, 41, 59, 0.6); border-radius: 12px; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid transparent; }
.status-opt:hover { background: rgba(30, 41, 59, 0.9); transform: scale(1.05); border-color: rgba(255, 255, 255, 0.1); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3); }
.status-opt i { width: 20px; height: 20px; }
.status-opt span { font-weight: 600; font-size: 1rem; color: #f1f5f9; }

.det-items-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.det-item-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.05); }
.det-item-info { display: flex; flex-direction: column; gap: 4px; }
.det-item-name { font-weight: 600; color: #f8fafc; font-size: 0.95rem; }
.det-item-meta { font-size: 0.8rem; color: #94a3b8; }
.det-item-actions { display: flex; gap: 8px; }
.det-item-actions button { background: transparent; border: none; color: #ef4444; cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s; }
.det-item-actions button:hover { background: rgba(239, 68, 68, 0.1); }

.items-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.items-header h3 { font-size: 1.1rem; margin: 0; color: #f8fafc; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.items-header h3 i { color: #facc15; }


/* --- Eletrica App v3.2: Layout Organizado (Redesign) --- */
.details-layout-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.details-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 16px 24px; gap: 16px; flex-wrap: wrap; }
.top-bar-metrics { display: flex; gap: 24px; }
.metric-card { display: flex; flex-direction: column; gap: 4px; }
.metric-card small { color: #94a3b8; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.metric-val { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #f1f5f9; font-size: 1.1rem; }
.metric-val span { color: #facc15; }
.metric-val i { width: 16px; height: 16px; opacity: 0.5; }
.top-bar-actions { display: flex; gap: 12px; }

.details-card { background: rgba(30, 41, 59, 0.3); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.details-card h3 { font-size: 1rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; margin-top: 0; display: flex; align-items: center; gap: 10px; }
.card-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-section-header h3 { margin-bottom: 0; }

.client-info-display { margin-bottom: 16px; }
.display-name { font-size: 1.25rem; font-weight: 700; color: #f8fafc; }
.display-meta { font-size: 0.9rem; color: #94a3b8; margin-top: 4px; }
.client-quick-actions { display: flex; gap: 12px; }

.btn-whatsapp-sm { background: #10b98120; border: 1px solid #10b98140; color: #10b981; padding: 8px 16px; border-radius: 8px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-whatsapp-sm:hover { background: #10b981; color: #fff; }
.btn-email-sm { background: #6366f120; border: 1px solid #6366f140; color: #6366f1; padding: 8px 16px; border-radius: 8px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-email-sm:hover { background: #6366f1; color: #fff; }

.det-items-list-v2 { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.btn-toggle-section { background: transparent; border: none; color: #3b82f6; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; }
.btn-add-item-sm { background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(255, 255, 255, 0.2); color: #94a3b8; width: 100%; padding: 12px; border-radius: 12px; cursor: pointer; transition: all 0.2s; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-add-item-sm:hover { background: rgba(255, 255, 255, 0.1); border-color: #facc15; color: #facc15; }

.finance-summary { margin-bottom: 20px; }
.finance-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.finance-row:last-child { border-bottom: none; }
.finance-row span { color: #94a3b8; font-size: 0.9rem; }
.finance-row strong { color: #f8fafc; font-size: 1.1rem; }

.btn-visualizar-full { width: 100%; background: #22c55e; border: none; color: #000; font-weight: 800; padding: 16px; border-radius: 12px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 16px; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.05em; }
.btn-visualizar-full:hover { background: #16a34a; transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.3); }

.finance-actions-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sticky-finance { position: sticky; top: 20px; }

.extra-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 12px; }
.extra-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: rgba(15, 23, 42, 0.3); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; cursor: pointer; transition: all 0.2s; color: #94a3b8; }
.extra-action-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: #facc15; }
.extra-action-btn i { width: 24px; height: 24px; }
.extra-action-btn span { font-size: 0.75rem; font-weight: 600; }

@media (max-width: 992px) { .details-layout-grid { grid-template-columns: 1fr; } .details-top-bar { flex-direction: column; align-items: flex-start; } .top-bar-metrics { width: 100%; justify-content: space-between; } }


/* --- Eletrica App v3.3: Botões Premium (Refinamento) --- */
.btn-outline { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: #f8fafc; padding: 10px 20px; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.btn-outline i { width: 16px; height: 16px; color: #facc15; }

.btn-danger-outline { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; padding: 10px 20px; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-danger-outline:hover { background: #ef4444; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-danger-outline i { width: 16px; height: 16px; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn-link-sm { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #60a5fa; padding: 6px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.2s; }
.btn-link-sm:hover { background: #3b82f6; color: #fff; transform: scale(1.05); }
.btn-link-sm i { width: 14px; height: 14px; }

.btn-outline-sm { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); color: #94a3b8; padding: 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; flex: 1; text-align: center; }
.btn-outline-sm:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: #facc15; }

.btn-primary-sm { background: #facc15; color: #000; border: none; padding: 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary-sm:hover { background: #eab308; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(250, 204, 21, 0.3); }
.btn-primary-sm i { width: 16px; height: 16px; }

.btn-icon-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.btn-icon-danger:hover { background: #ef4444; color: #fff; transform: scale(1.1); }
.btn-icon-danger i { width: 16px; height: 16px; }


/* --- Eletrica App v3.4: Correção Sidebar Sticky --- */
.details-side-col { position: sticky; top: 24px; align-self: start; z-index: 10; }
.sticky-finance { position: static !important; }


