/* CSS Variables */
:root {
    --primary-color: #022b6d;
    --primary-light: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --success-700: #047857;
        /* Primary scale (added) */
        --primary-500: #3b82f6;
        --primary-600: #2563eb;
        --primary-700: #1d4ed8;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --danger-color: #ef4444;
    --gray-50: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --red-50: #fef2f2;
    --red-200: #fecaca;
    --blue-50: #eff6ff;
    --blue-200: #bfdbfe;
    --blue-700: #1d4ed8;
    --yellow-50: #fffbeb;
    --yellow-200: #fde68a;
    --yellow-700: #a16207;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 1rem;
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23ffffff' fill-opacity='0.08' d='M20 18V6c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zM6 6h12v10H6V6zm1 12c0 .55.45 1 1 1h8c.55 0 1-.45 1-1H7z'/%3e%3c/svg%3e");
    background-size: 60px 60px;
    background-repeat: repeat;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    z-index: 1;
}

.login-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.login-header {
    text-align: center;
}

.login-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
}
    /* Peças: coloração de estoque */
    .parts-table td.stock-total { color: var(--primary-700); font-weight:700; }
    .parts-table td.stock-allocated { color: var(--yellow-700); font-weight:600; }
    .parts-table td.stock-available { color: var(--success-700); font-weight:600; }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-error {
    background: var(--red-50);
    color: var(--error-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--red-200);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.login-error i {
    color: var(--error-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]) {
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 43, 109, 0.1);
}

/* Container para senha com botão de mostrar/esconder */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 3rem; /* Espaço para o botão */
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.password-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(2, 43, 109, 0.05);
}

.password-toggle:active {
    transform: scale(0.95);
}

.password-toggle i {
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Ensure the calculator checkbox doesn't inherit large control sizes */
#useDefaultMargin {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    padding: 0 !important;
    border-radius: 3px;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.btn-login {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.875rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--primary-dark);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: opacity 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

/* Hamburger toggle (hidden by default on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}
.nav-toggle:hover { background: var(--gray-100); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-link.active {
    background: var(--primary-color);
    color: var(--white);
}

.nav-link-disabled {
    opacity: 0.4;
    color: var(--gray-400) !important;
    cursor: not-allowed;
    background: none !important;
    pointer-events: none;
}

.nav-link-disabled i {
    color: var(--gray-400) !important;
}

.nav-link-disabled:hover {
    background: none !important;
    color: var(--gray-400) !important;
}

.nav-link-loading {
    opacity: 0.6;
    color: var(--gray-500) !important;
    cursor: wait;
    background: none !important;
    pointer-events: none;
    animation: pulse 1.5s ease-in-out infinite;
}

.nav-link-loading i {
    color: var(--gray-500) !important;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.user-details #userName {
    font-weight: 500;
    color: var(--gray-800);
}

.user-details .user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    opacity: 0.8;
    margin-top: 1px;
}

.user-dropdown {
    position: relative;
}

.btn-user {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.btn-user:hover {
    background: var(--gray-100);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    padding: 0.5rem;
    display: none;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background: var(--gray-100);
}

/* Responsive navbar: mobile hamburger */
@media (max-width: 900px) {
    .navbar {
    padding: 0.5rem 0.75rem;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    grid-template-rows: auto auto; /* primeira linha: header | segunda: menu */
        align-items: center;
        gap: 0.5rem 0.75rem;
    }
    .nav-toggle { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        grid-column: 1; 
        justify-self: start;
    }
    .nav-brand { 
        grid-column: 2; 
        justify-self: center;
        overflow: hidden; 
        white-space: nowrap;
        min-width: 0;
    }
    .nav-brand img { 
        width: clamp(110px, 40vw, 180px);
        height: auto !important; 
        display: block; 
        max-width: 100%;
    }
    .nav-user { 
        grid-column: 3; 
        justify-self: end; 
        gap: 0.4rem; 
        white-space: nowrap;
    }
    .nav-user .user-details { display: none; }
    .nav-user .user-info { gap: 0.25rem; }
    .nav-user .nav-link { padding: 0.25rem 0.4rem; margin-right: 0 !important; }
    .nav-user .nav-link i { font-size: 1rem; }
    .btn-user { font-size: 1.25rem; padding: 0.25rem; }
    .nav-toggle { font-size: 1.25rem; padding: 0.25rem; }
    .nav-menu {
        display: none;
        grid-column: 1 / -1;
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
        margin-top: 0.25rem;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        padding-top: 0.5rem;
    }
    .navbar.open .nav-menu { display: flex; }
    .nav-menu .nav-link { width: 100%; padding: 0.75rem 0.5rem; }
    /* Dropdown positioning on small screens */
    .user-dropdown .dropdown-menu { right: 0; left: auto; }
}

@media (max-width: 480px) {
    .user-details { display: none; }
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header,
.page-header {
    margin-bottom: 2rem;
}

.page-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.page-header .header-text {
    flex: 1;
}

.page-header .header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.page-header .header-controls .filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header .header-controls label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    white-space: nowrap;
}

.page-header .header-controls .filter-select {
    min-width: 160px;
}

.period-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: #1976d2;
    margin-top: 0.75rem;
}

.period-indicator i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .page-header .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header .header-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .page-header .header-controls .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.dashboard-header h1,
.page-header h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-header p,
.page-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
}

/* Badge de Modo Edição */
.edit-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 2px solid #42a5f5;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: pulse-edit 2s infinite;
}

.edit-mode-badge i {
    font-size: 0.9rem;
}

@keyframes pulse-edit {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 3px 8px rgba(21, 101, 192, 0.2);
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-icon {
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-content h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card-content p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.card-action:hover {
    color: var(--primary-dark);
}

/* Stats Card */
.stats-card .card-content {
    padding-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Recent Activity */
.recent-activity {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.recent-activity h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.activity-item i {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Components Page */
.components-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 2rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: var(--white);
    color: var(--gray-800);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.tab-panel {
    display: none;
}

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

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h3 i {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: none;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.view-toggle .btn {
    padding: 0.5rem;
    min-width: auto;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.view-toggle .btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.view-toggle .btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
}

/* Sub-abas de processadores */
.processor-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 0.5rem;
}

.processor-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.processor-tab-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.processor-tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.processor-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.processor-tab-btn i {
    font-size: 1.1rem;
}

.processor-content {
    position: relative;
}

.processor-panel {
    display: none;
}

.processor-panel.active {
    display: block;
}

/* Sub-abas de GPUs */
.gpu-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 0.5rem;
}

.gpu-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.gpu-tab-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.gpu-tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.gpu-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.gpu-tab-btn i {
    font-size: 1.1rem;
}

.gpu-content {
    position: relative;
}

.gpu-panel {
    display: none;
}

.gpu-panel.active {
    display: block;
}

/* Sub-abas de Displays/Telas */
.gpu-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.subtab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.subtab-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.subtab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.subtab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.subtab-btn i {
    font-size: 1rem;
}

.subtab-content {
    display: none;
}

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

.display-content {
    position: relative;
}

/* Barra de pesquisa de processadores */
.search-container {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    max-width: 400px;
    flex: 1;
}

.search-box i.fa-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

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

.search-box input::placeholder {
    color: var(--gray-400);
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.search-results {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    display: none;
}

.search-results.show {
    display: block;
}

.search-results .result-count {
    padding: 0.5rem;
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-sm);
    color: var(--blue-700);
}

.search-results .no-results {
    padding: 0.5rem;
    background: var(--yellow-50);
    border: 1px solid var(--yellow-200);
    border-radius: var(--radius-sm);
    color: var(--yellow-700);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1200;
    animation: fadeIn 0.18s ease;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem; /* respira lateral em telas menores */
}

.modal.show { display: flex; }

/* Port badges no modal de visualização */
.ports-row {
    flex-direction: column;
    align-items: flex-start;
}

.ports-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.port-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

.port-badge i {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Component badges para componentes novos */
.components-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.component-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #1565c0;
    font-weight: 500;
    white-space: nowrap;
}

.components-row .value {
    display: block;
    width: 100%;
}

/* Feature badges para recursos adicionais */
.features-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #7b1fa2;
    font-weight: 500;
    white-space: nowrap;
}

.features-row .value {
    display: block;
    width: 100%;
}

/* Seção de carcaça no modal */
.carcaca-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #dee2e6;
}

.carcaca-status {
    margin-bottom: 1rem;
}

/* Badge "Usado" para peças marcadas como usadas */
.used-badge {
        display:inline-block;
        margin-top:4px;
        background: linear-gradient(135deg,#fef3c7,#fde68a);
        color:#92400e;
        font-size:.55rem;
        font-weight:700;
        letter-spacing:.5px;
        padding:2px 6px 3px;
        border-radius:10px;
        border:1px solid #fcd34d;
        text-transform:uppercase;
        line-height:1;
        box-shadow:0 1px 1px rgba(0,0,0,0.05), 0 0 0 1px rgba(251,191,36,0.35) inset;
}
@media (prefers-color-scheme: dark) {
    .used-badge {
        background:linear-gradient(135deg,#78350f,#92400e);
        color:#fde68a;
        border-color:#b45309;
        box-shadow:0 1px 1px rgba(0,0,0,0.4),0 0 0 1px rgba(180,83,9,0.6) inset;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge.status-novo {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
    border: 2px solid #ffb74d;
}

.status-badge.status-gold {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #f57f17;
    border: 2px solid #ffc107;
}

.status-badge.status-silver {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #7b1fa2;
    border: 2px solid #ba68c8;
}

.status-badge.status-smart {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 2px solid #66bb6a;
}

.status-badge.status-classic {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #ef6c00;
    border: 2px solid #ff9800;
}

.status-badge.status-default {
    background: linear-gradient(135deg, #f5f5f5, #eeeeee);
    color: #424242;
    border: 2px solid #bdbdbd;
}

.status-emoji {
    font-size: 1.2rem;
}

.carcaca-observation {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #2196f3;
}

.observation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1976d2;
    font-size: 0.9rem;
}

.observation-text {
    color: #424242;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Battery card no modal de visualização */
.battery-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.battery-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.battery-title {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.battery-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.battery-spec {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.battery-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.battery-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

/* Indicadores de saúde da bateria */
.battery-excellent {
    color: #28a745 !important;
}

.battery-good {
    color: #ffc107 !important;
}

.battery-warning {
    color: #fd7e14 !important;
}

.battery-critical {
    color: #dc3545 !important;
}

/* Responsividade para telas menores */
@media (max-width: 576px) {
    .ports-badges {
        flex-direction: column;
        align-items: stretch;
    }
    
    .port-badge {
        justify-content: center;
    }
    
    .battery-info {
        grid-template-columns: 1fr;
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.toast-success {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
}

.toast-notification.toast-error {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

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

.toast-content i {
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        transform: translateY(-100%);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px; /* Definindo largura máxima padrão */
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideIn 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 800px;
}

.modal-full {
    max-width: 95vw;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.delete-confirmation-icon {
    text-align: center;
    margin-bottom: 1.5rem;
}

.delete-confirmation-icon svg {
    display: block;
    margin: 0 auto 1rem auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease;
}

.delete-confirmation-icon svg:hover {
    transform: scale(1.05);
}

.modal-footer {
    display: flex;
    justify-content: space-between; /* separa extremos */
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.modal-footer .btn-danger {
    margin-right: auto; /* Posicionar à esquerda */
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.modal-footer .btn-danger:hover {
    opacity: 1;
    background: #b91c1c;
    border-color: #b91c1c;
}

.modal-footer .btn-outline { order: 1; }
.modal-footer .btn-primary { margin-left: auto; order: 2; }

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.delete-item-info {
    padding: 1rem;
    background: var(--red-50);
    border: 1px solid var(--red-200);
    border-radius: var(--radius-md);
    margin: 1rem 0;
    text-align: center;
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
    font-size: 0.875rem;
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--error-color);
    color: var(--white);
    border: 1px solid var(--error-color);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
    border: 1px solid var(--gray-500);
}

.btn-secondary:hover {
    background: var(--gray-600);
    border-color: var(--gray-600);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    border: 1px solid var(--success-color);
}

.btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Warning (orange) */
.btn-warning {
    background: #f59e0b;
    color: #111827;
    border: 1px solid #f59e0b;
}
.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

/* History Page */
.history-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.search-input,
.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 43, 109, 0.1);
}

.history-list {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.2s;
}

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

.history-item:hover {
    background: var(--gray-50);
}

.history-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.history-content {
    flex: 1;
}

.history-content h4 {
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.history-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.history-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

/* Placeholder Styles */
.placeholder-content {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-600);
}

.placeholder-icon {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.placeholder-content h2,
.placeholder-content h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
    font-weight: 600;
}

.placeholder-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feature-list,
.feature-preview {
    text-align: left;
    max-width: 400px;
    margin: 1.5rem auto;
    list-style: none;
    padding: 0;
}

.feature-list li,
.feature-preview li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-700);
}

.feature-list i {
    color: var(--success-color);
    width: 16px;
}

.placeholder-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.history-placeholder {
    grid-column: 1 / -1;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* ===== PARTS (PEÇAS) TABLE ===== */
.parts-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    /* removido overflow:hidden para não cortar botões de ação na borda */
    font-size: 0.875rem;
}
.parts-table thead th {
    background: var(--gray-100);
    text-align: left;
    padding: 0.75rem 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.parts-table tbody td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.parts-table tbody tr:last-child td { border-bottom: none; }
.parts-table tbody tr:hover { background: var(--gray-50); }
.parts-table thead th:last-child,
.parts-table tbody td:last-child { padding-right: 1.15rem; }
.parts-table tbody td:last-child { white-space: nowrap; }
.parts-table code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.table-action-btn {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.18s ease;
}
.table-action-btn + .table-action-btn { margin-left: 0.4rem; }
.table-action-btn.edit:hover { border-color: var(--primary-color); color: var(--primary-color); }
.table-action-btn.delete:hover { border-color: var(--error-color); color: var(--error-color); }
.table-action-btn.delete { color: var(--error-color); border-color: var(--red-200); }
.table-action-btn.edit { color: var(--primary-color); border-color: var(--gray-300); }
.table-action-btn.print { color: var(--gray-600); }
.table-action-btn.print:hover { border-color: var(--primary-color); color: var(--primary-color); }

@media (max-width: 780px) {
  .parts-table thead { display: none; }
  .parts-table tbody tr { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--gray-200); }
  .parts-table tbody td { border: none; padding: 0; font-size: 0.8rem; }
  .parts-table tbody td:nth-child(1) { grid-column: 1 / 2; }
  .parts-table tbody td:nth-child(2) { grid-column: 2 / 3; text-align: right; }
        /* Nova ordem: 1=codigo 2=marca 3=tipo 4=descricao 5=estoque 6=preco 7=acao */
        .parts-table tbody td:nth-child(3) { grid-column: 1 / 2; }
        .parts-table tbody td:nth-child(4) { grid-column: 1 / 3; }
        .parts-table tbody td:nth-child(5) { grid-column: 1 / 2; }
        .parts-table tbody td:nth-child(6) { grid-column: 2 / 3; text-align: right !important; }
        .parts-table tbody td:nth-child(7) { grid-column: 1 / 3; text-align: left !important; }
}

/* Inline grouped form rows for modal (Peças) */
.form-group-row {
        display: flex;
        gap: 1rem;
}
.form-group-row .form-group { flex: 1; }
@media (max-width: 640px) {
    .form-group-row { flex-direction: column; }
}

/* Campo Código estreito dentro de linha agrupada */
.form-group-row .codigo-field {
    flex: 0 0 120px; /* largura ajustada conforme solicitado */
    max-width: 120px;
}
.form-group-row .tipo-field { flex: 1 1 auto; min-width: 180px; }
.form-group-row .estoque-field { flex: 0 0 120px; max-width:120px; }
.form-group-row .preco-field { flex: 0 0 145px; max-width:145px; }
 .parts-total-summary { display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; font-size:.8rem; padding:.5rem .75rem; background:var(--gray-50); border:1px solid var(--gray-200); border-radius: var(--radius-md); }
 .parts-total-summary .muted { color: var(--gray-500); font-weight:500; }
 .parts-total-summary .value { font-weight:600; color: var(--gray-800); }
@media (max-width: 640px) {
    .form-group-row .estoque-field,
    .form-group-row .preco-field,
    .form-group-row .tipo-field { flex: 1 1 auto; max-width:100%; }
}
.form-group-row .codigo-field input {
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding-left: 0.5rem;
        text-align: left;
}
@media (max-width: 640px) {
    .form-group-row .codigo-field { flex: 1 1 auto; max-width: 100%; }
}

/* Linha Código + Usado (modal peças) */
.codigo-used-row { display:flex; align-items:center; gap:.75rem; margin-bottom:.75rem; flex-wrap:nowrap; }
.codigo-used-row .codigo-field { flex:0 0 auto; }
.codigo-used-row .codigo-badge { display:flex; align-items:center; justify-content:space-between; gap:.75rem; background:#f1f5f9; border:1px solid var(--gray-300); border-radius:var(--radius-md); padding:0 .9rem 0 .85rem; height:44px; font-size:.8rem; font-weight:600; color:#0f172a; min-width:150px; }
.codigo-used-row #pecaCodigo { background:transparent; border:none; padding:0; margin:0; width:70px; text-align:right; font-weight:600; color:#0f172a; cursor:not-allowed; font-size:.8rem; }
.used-flag-wrapper { flex:0 0 auto; display:flex; align-items:center; }
.used-flag-label { display:flex; align-items:center; gap:.55rem; cursor:pointer; font-size:.7rem; font-weight:600; color:#334155; background:#f8fafc; border:1px solid var(--gray-300); padding:0 1rem 0 .85rem; height:44px; border-radius:var(--radius-md); box-shadow:0 0 0 1px rgba(15,23,42,0.02); }
.used-flag-label i { font-size:.8rem; color:#0f766e; }
.used-flag-label input[type=checkbox]{ width:16px; height:16px; cursor:pointer; accent-color:#0f766e; }
@media (max-width:560px){
    .codigo-used-row { flex-wrap:wrap; }
    .used-flag-wrapper { margin-left:0; }
}

/* Botão engrenagem (Gerenciar Tipos) dentro do label Tipo */
.btn-manage-tipos {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    width: 19px;
    height: 19px;
    min-width: 19px;
    min-height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    transition: all 0.18s ease;
    position: relative;
    /* Removido top negativo que ampliava área "visual" e podia capturar hover ao lado */
    top: 0;
    z-index: 1;
}
.btn-manage-tipos i { pointer-events:none; }
.btn-manage-tipos:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}
.btn-manage-tipos:active {
    transform: translateY(0);
}

/* Botão engrenagem (Gerenciar Origens) dentro do label Origem */
.btn-manage-origens {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    width: 19px;
    height: 19px;
    min-width: 19px;
    min-height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    transition: all 0.18s ease;
    position: relative;
    top: 0;
    z-index: 1;
}
.btn-manage-origens i { pointer-events:none; }
.btn-manage-origens:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}
.btn-manage-origens:active {
    transform: translateY(0);
}

/* Alinhamento suave do label + botão engrenagem */
label.label-with-gear {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    position: relative;
}
/* Restringir hover apenas ao botão engrenagem */
label.label-with-gear { pointer-events: none; }
label.label-with-gear .label-text-tipo { pointer-events: none; }
label.label-with-gear .label-text-origem { pointer-events: none; }
label.label-with-gear .btn-manage-tipos { pointer-events: auto; }
label.label-with-gear .btn-manage-origens { pointer-events: auto; }

/* Garantir que o * continue logo após a palavra Tipo */
.form-group.required .label-with-gear .label-text-tipo::after {
    content: " *";
    color: var(--error-color);
    font-weight: bold;
}

/* Remover o ::after padrão do label.required (pois já aplicamos acima apenas no texto) */
.form-group.required > label::after { content: none; }

/* Pequeno fallback geral para navegadores sem suporte especial */
.no-has .label-with-gear { display:inline-flex; }

/* Forçar remoção do * duplicado no label quando existe o botão engrenagem */
.form-group.required > label.label-with-gear::after { content: none !important; }

/* ===== ETIQUETA (50mm x 30mm) Preview & Print ===== */
.etiqueta-preview-wrapper { padding: .5rem; background: var(--gray-100); border:1px dashed var(--gray-300); border-radius: var(--radius-md); }
.etiqueta-card {
    width: 50mm;
    height: 30mm;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 2px;
    padding: 2mm 2.5mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Segoe UI', Arial, sans-serif;
    position: relative;
    overflow: hidden;
}
.etiqueta-line { font-size: 8px; line-height: 1.15; font-weight: 600; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiqueta-line.desc { font-size: 7px; font-weight: 500; }
.etiqueta-price { font-size: 10px; font-weight: 700; text-align: right; margin-top: 1px; }
.etiqueta-divider { height:1px; background: var(--gray-300); margin:1px 0 2px; }
.etiqueta-header { display:flex; justify-content:space-between; align-items:flex-start; gap:2mm; }
.etiqueta-code { font-size:8px; font-weight:700; }
.etiqueta-tipo { font-size:7px; font-weight:600; color: var(--gray-600); }
.etiqueta-footer { font-size:6px; text-align:right; color: var(--gray-500); }
.etiqueta-brand { font-size:7px; font-weight:600; }

@media print {
    @page { margin: 0; size: 50mm 30mm; }
    html, body { padding:0; margin:0; background:#fff; }
    body.printing-label * { display:none !important; }
    /* Re-exibe somente a etiqueta mantendo layout correto */
    body.printing-label #printLabelRoot, 
    body.printing-label #printLabelRoot * { visibility: visible !important; }
    #printLabelRoot { width:50mm; height:30mm; display:block !important; margin:0 !important; padding:0 !important; overflow:hidden !important; }
    #printLabelRoot .etiqueta-card { display:flex !important; border:none !important; box-shadow:none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    #printLabelRoot .etiqueta-header { display:flex !important; }
    #printLabelRoot .etiqueta-line, 
    #printLabelRoot .etiqueta-divider,
    #printLabelRoot .etiqueta-price,
    #printLabelRoot .etiqueta-footer,
    #printLabelRoot .etiqueta-brand { display:block !important; }
}

/* ===== GERADOR STYLES ===== */
.generator-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.spec-builder {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: visible;
}

.config-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--gray-50);
    overflow: visible; /* garante que dropdowns absolutamente posicionados não sejam cortados */
    position: relative;
}

/* Destaque quando houver peças instaladas */
.config-section.pecas-has-data {
        border-color: #16a34a;
        box-shadow: 0 0 0 1px #16a34a, 0 0 0 4px rgba(34,197,94,0.25), 0 4px 18px -2px rgba(22,163,74,0.35);
        transition: box-shadow .25s ease, border-color .25s ease;
}
@media (prefers-reduced-motion: reduce) {
    .config-section.pecas-has-data { transition: none; }
}

/* Caso algum container específico crie clipping futuro, aplicar esta classe utilitária */
.allow-overflow-visible { overflow: visible !important; }

.config-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group select,
.form-group input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
}

.form-group.required label::after {
    content: " *";
    color: var(--error-color);
    font-weight: bold;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 43, 109, 0.1);
}

.form-group input.required-field {
    border-color: var(--error-color);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-toggle {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.btn-toggle.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

/* Search Container (reduzido para não sobrepor overlays/modais) */
.search-container {
    position: relative;
    z-index: 50; /* antes era 10000, exagerado */
}

/* Scoped dropdown styling for generator processor search to avoid conflicts
   with generic .search-results summary styles earlier in the file. */
.config-section .search-container .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 320px; /* increased so more itens visíveis antes do scroll */
    overflow-y: auto;
    overscroll-behavior: contain; /* evita scroll "vazar" para a página */
    z-index: 60; /* apenas acima dos campos locais; modais usam >=1000 */
    display: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.config-section .search-container .search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: var(--gray-50);
}

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

/* Processor Specs */
.processor-specs {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.spec-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.spec-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.spec-item span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* RAM Slots */
.ram-slots {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

/* Grid para slots lado a lado */
.ram-slots .ram-slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.ram-slot-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.slot-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.checkbox-group {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: var(--gray-50);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label i {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + i {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Ícone do tipo de conexão */
.checkbox-label i:not(:first-of-type) {
    width: auto;
    height: auto;
    border: none;
    background: none;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-right: 0.25rem;
}

/* Títulos das seções com ícones */
.ports-with-counters h5,
.ports-simple h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ports-with-counters h5 i,
.ports-simple h5 i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}

.radio-label:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.radio-indicator::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    transform: scale(0);
    transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-indicator {
    border-color: var(--primary-color);
    background: var(--white);
}

.radio-label input[type="radio"]:checked + .radio-indicator::after {
    transform: scale(1);
}

.radio-label input[type="radio"]:checked ~ .radio-content strong {
    color: var(--primary-color);
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.radio-content p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.825rem;
    line-height: 1.4;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-900);
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Status Observations - Spacing for status section */
.status-observations {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Battery Duration Section */
.battery-duration-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.battery-duration-section h4 {
    margin-bottom: 1rem;
    color: var(--gray-800);
    font-size: 1rem;
    font-weight: 600;
}

.usage-profiles label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.duration-estimate {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
}

.estimate-display {
    text-align: center;
}

.estimate-hours {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.hours-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.hours-text {
    font-size: 1.2rem;
    color: var(--gray-600);
    font-weight: 500;
}

.estimate-range {
    margin-bottom: 0.5rem;
}

.range-text {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.consumption-info {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-style: italic;
}

textarea::placeholder {
    color: var(--gray-500);
}

/* Battery Preview */
.battery-preview {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.battery-preview-bar {
    width: 100%;
    height: 20px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.battery-preview-fill {
    height: 100%;
    background: #dc2626;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.battery-preview-text {
    text-align: center;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.battery-status {
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Battery Grid Layout - 2 Colunas */
.battery-grid-layout {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.battery-inputs-column {
    width: 100%;
}

.battery-inputs-column .form-group {
    margin-bottom: 1rem;
}

.battery-inputs-column input {
    max-width: 250px;
    width: 100%;
}

.battery-preview-column {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.battery-preview-column .battery-preview {
    width: 100%;
    max-width: 280px;
    margin: 0;
}

/* Responsividade para a estrutura de bateria */
@media (max-width: 768px) {
    .battery-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .battery-preview-column {
        order: -1; /* Preview aparece primeiro no mobile */
    }
    
    .battery-preview-column .battery-preview {
        max-width: 100%;
    }
}

/* Battery Tip */
.battery-tip {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.battery-tip i {
    color: var(--primary-color);
    margin-top: 0.125rem;
    font-size: 0.875rem;
}

.battery-tip small {
    color: var(--gray-600);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Battery Autonomy Section */
.battery-autonomy-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.battery-autonomy-section h4 {
    margin-bottom: 1rem;
    color: var(--gray-900);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.autonomy-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.autonomy-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-md);
}

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

.autonomy-range {
    display: flex;
    align-items: center;
    justify-content: center;
}

.autonomy-text {
    font-size: 1.1rem;
    color: var(--gray-900);
}

.autonomy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.8rem;
}

/* Dual Range Slider para Autonomia - Versão Compacta */
.dual-range-container {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.dual-range-slider {
    position: relative;
    height: 40px;
    margin: 1rem 0;
    width: 100%;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    transform: translateY(-50%);
}

.slider-range {
    position: absolute;
    top: 50%;
    height: 6px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 3px;
    transform: translateY(-50%);
    transition: all 0.2s ease;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    user-select: none;
    z-index: 5;
    /* Evitar que o thumb seja afetado por pointer-events quando sobrepostos */
    pointer-events: auto;
}

.slider-thumb:hover {
    background: #2563eb;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10; /* Thumb em hover fica por cima */
}

.slider-thumb:active {
    background: #1d4ed8;
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 15; /* Thumb ativo fica por cima de todos */
}

.slider-thumb.dragging {
    z-index: 20 !important; /* Thumb sendo arrastado sempre fica por cima */
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.slider-thumb-min {
    background: #059669;
}

.slider-thumb-min:hover {
    background: #047857;
}

.slider-thumb-min:active {
    background: #065f46;
}

.slider-thumb-max {
    background: #3b82f6;
}

.slider-thumb-max:hover {
    background: #2563eb;
}

.slider-thumb-max:active {
    background: #1d4ed8;
}

.range-labels {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    margin-top: 1.5rem;
    position: relative;
    width: 100%;
    gap: 0;
    /* Garantir alinhamento perfeito com o slider */
    padding: 0;
    align-items: center;
}

.range-label {
    position: relative;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Melhor espaçamento para cliques */
    padding: 0.25rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-label:hover {
    color: #3b82f6;
    transform: scale(1.1);
}

.range-label::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 8px;
    background: #cbd5e1;
}

/* Primeira e última marcação com traços nas extremidades */
.range-label:first-child::before {
    left: 0;
    transform: none;
}

.range-label:last-child::before {
    right: 0;
    left: auto;
    transform: none;
}

.range-label.active {
    color: #3b82f6;
    font-weight: 700;
}

.range-label.in-range {
    color: #059669;
    font-weight: 600;
}

.range-values {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.autonomy-display {
    text-align: center;
}

.autonomy-range {
    margin-bottom: 0.25rem;
}

.autonomy-text {
    font-size: 0.95rem;
    color: #1e40af;
    font-weight: 600;
}

.autonomy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #64748b;
    font-size: 0.75rem;
}

.autonomy-note i {
    font-size: 0.7rem;
}

/* Ocultar preview separado - agora integrado */
.autonomy-preview {
    display: none !important;
}

/* Price Input Group */
.price-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* Largura específica para campo de reparo */
.price-input-group.repair-price {
    max-width: 200px;
}

.currency-symbol {
    position: absolute;
    left: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
}

.price-input-group input {
    padding-left: 2.5rem;
}

/* Number inputs */
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    color: var(--gray-900);
    transition: border-color 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Port Groups */
.port-groups {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ports-section {
    margin-top: 1rem;
}

.ports-section h4 {
    margin-bottom: 1rem;
    color: var(--gray-900);
    font-weight: 600;
}

/* Layout de 2 colunas para portas */
.ports-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.ports-with-counters,
.ports-simple {
    margin-bottom: 0;
}

.ports-with-counters h5:first-child,
.ports-simple h5:first-child {
    margin-top: 0;
}

.port-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin-bottom: 0.5rem;
}

.port-group .checkbox-label {
    margin: 0;
    padding: 0;
    background: transparent;
    flex: 1;
}

.port-count {
    min-width: 120px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.port-count:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#networkSpeed {
    min-width: 180px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
}

#networkSpeed:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsividade para portas */
@media (max-width: 768px) {
    .ports-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .port-count, #networkSpeed {
        min-width: 100px;
        font-size: 0.8rem;
    }
}

.config-summary {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-700);
    border-left: 4px solid var(--primary-color);
}

/* Storage Controls */
.storage-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.empty-slots-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.empty-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.empty-slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px dashed var(--gray-300);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.empty-slot-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--gray-50);
}

.storage-configs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.storage-config {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.btn-remove {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--error-color);
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    font-size: 0.875rem;
}

.storage-config:hover .btn-remove {
    opacity: 1;
    transform: scale(1.05);
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Largura reduzida para selects de armazenamento */
.storage-config .form-group select {
    max-width: 175px;
}

.storage-config .config-grid {
    grid-template-columns: 175px 175px;
    gap: 1rem;
}

/* Badge para armazenamento principal */
.storage-badge {
    position: absolute;
    top: -8px;
    left: 1rem;
    background: var(--success-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    z-index: 10;
}

.primary-storage {
    border-color: var(--success-color);
    border-width: 2px;
}

/* Tip inline para armazenamento principal */
.storage-tip-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.storage-tip-inline i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* GPU Section */
#integratedGpuModel {
    max-width: 250px;
}

/* Checkbox desabilitado */
.checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label input[type="checkbox"]:disabled + i {
    opacity: 0.5;
    color: var(--gray-400);
}

.checkbox-label:has(input[type="checkbox"]:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    color: var(--gray-500);
}

/* Preview Section */
.preview-section {
    margin-top: 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.preview-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800);
    margin: 0;
}

.preview-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.preview-content {
    padding: 1.5rem;
    background: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

/* Spec Output Styles */
.spec-row {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.spec-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.spec-row h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    text-align: left !important;
}

.spec-row p {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.5rem 0;
    color: var(--gray-700);
}

.spec-row ul {
    list-style-type: none;
    padding: 0;
    margin: 0.5rem 0;
}

.spec-row ul li {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    font-size: 0.875rem;
}

.spec-row ul li:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .generator-container {
        padding: 0 1rem;
    }

    .spec-builder {
        padding: 1rem;
    }

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

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

    .storage-controls {
        flex-direction: column;
    }

    .empty-slots-grid {
        grid-template-columns: 1fr;
    }

    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .preview-controls {
        align-self: stretch;
        justify-content: space-between;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .button-group {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        order: 3;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

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

    .components-tabs {
        flex-direction: column;
    }

    .history-filters {
        flex-direction: column;
    }

    .filter-group {
        flex-direction: column;
    }

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

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .history-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
}

/* Campo de ajuda */
.field-help {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Aviso importante para campo de custo */
.field-help.cost-warning {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 0.5rem;
    font-style: normal;
    font-weight: 500;
    margin-top: 0.5rem;
}

.field-help.cost-warning i {
    color: #f59e0b;
}

/* Campos desabilitados */
input:disabled,
select:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
    opacity: 0.7;
}

input:disabled::placeholder {
    color: var(--gray-400);
}

/* Labels com melhor estilo */
.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0;
    display: inline-block;
    line-height: 1.4;
}

.form-group.required label::after {
    content: ' *';
    color: var(--danger-color);
    white-space: nowrap;
    display: inline;
}

/* Layout específico para seção RAM */
.ram-header-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.ram-header-grid .form-group select {
    max-width: 280px;
}

/* Layout para slots de memória alinhado com o grid superior */
.ram-slots-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.ram-slots-grid .form-group select {
    max-width: 280px;
}

/* Botões DDR com altura ajustada */
.ram-header-grid .button-group .btn-toggle {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

/* Campo obrigatório com destaque */
.required-highlight {
    border: 2px solid #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    animation: requiredPulse 2s infinite;
    transition: all 0.3s ease;
}

.required-highlight:focus {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    outline: none;
}

.required-highlight.filled {
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
    animation: none;
}

@keyframes requiredPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    }
}

/* Responsivo para RAM header */
@media (max-width: 768px) {
    .ram-header-grid,
    .ram-slots-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Slots de RAM em coluna única no mobile */
    .ram-slots .ram-slots-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ram-header-grid .form-group select,
    .ram-slots-grid .form-group select {
        max-width: 100%;
    }
}

/* ===== COMPONENTES PAGE STYLES ===== */

/* Tabs de componentes */
.components-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--gray-50);
}

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

.tab-btn i {
    font-size: 1rem;
}

/* Conteúdo das tabs */
.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
}

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

/* Header do painel */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h3 {
    color: var(--gray-800);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Grid de componentes */
.components-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Grupos por marca/tipo */
.brand-group,
.type-group {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.brand-title,
.type-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.brand-title i,
.type-title i {
    color: var(--primary-color);
}

/* Cards de componentes */
.component-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Tabela de componentes - nova visualização compacta */
.components-table,
.table-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.components-table table,
.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.components-table thead,
.table-container thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.components-table th,
.table-container th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-right: 1px solid var(--gray-200);
}

.components-table th:last-child,
.table-container th:last-child {
    border-right: none;
    text-align: center;
    width: 100px;
}

.components-table tbody tr,
.table-container tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s ease;
}

.components-table tbody tr:hover,
.table-container tbody tr:hover {
    background: var(--gray-50);
}

.components-table tbody tr:last-child,
.table-container tbody tr:last-child {
    border-bottom: none;
}

.components-table td,
.table-container td {
    padding: 0.75rem;
    color: var(--gray-600);
    border-right: 1px solid var(--gray-100);
}

.components-table td:last-child,
.table-container td:last-child {
    border-right: none;
    text-align: center;
}

.components-table .table-actions,
.table-container .table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.components-table .brand-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.components-table .brand-intel {
    background: #e3f2fd;
    color: #1976d2;
}

.components-table .brand-amd {
    background: #fff3e0;
    color: #f57c00;
}

.components-table .brand-nvidia {
    background: #e8f5e8;
    color: #388e3c;
}

.components-table .brand-qualcomm {
    background: #f3e5f5;
    color: #7b1fa2;
}

.components-table .brand-apple {
    background: #f5f5f5;
    color: #424242;
}

.components-table .brand-generic {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Type badges para memórias */
.components-table .type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.components-table .type-ddr3 {
    background: #fef3c7;
    color: #92400e;
}

.components-table .type-ddr4 {
    background: #dbeafe;
    color: #1e40af;
}

.components-table .type-ddr5 {
    background: #dcfce7;
    color: #16a34a;
}

.components-table .type-dedicated {
    background: #fee2e2;
    color: #dc2626;
}

.components-table .type-integrated {
    background: #f3e8ff;
    color: #7c3aed;
}

.components-table .table-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.components-table .btn-icon {
    padding: 0.375rem;
    min-width: auto;
    border-radius: var(--radius-sm);
}

.components-table .btn-edit {
    background: var(--primary-color);
    color: white;
}

.components-table .btn-delete {
    background: var(--danger-color);
    color: white;
    opacity: 1;
    visibility: visible;
}

.components-table .btn-icon:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.component-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

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

/* Header do card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.card-header h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    margin: 0;
    flex: 1;
    padding-right: 0.5rem;
}

/* Ações do card */
.card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    color: var(--gray-600);
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

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

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

.btn-icon.btn-default {
    color: var(--gray-400);
}

.btn-icon.btn-default:hover {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-icon.btn-default-active {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-icon.btn-default-active:hover {
    background-color: #d97706;
    color: var(--white);
}

.default-badge {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: var(--white);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.default-badge i {
    font-size: 0.5rem;
}

/* Estilos específicos para botões de delete na tabela de componentes */
.components-table .btn-delete,
.components-table .btn.btn-delete {
    background: var(--danger-color) !important;
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.components-table .btn-delete:hover,
.components-table .btn.btn-delete:hover {
    background: #dc2626 !important;
    opacity: 0.9 !important;
}

/* Conteúdo do card */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.spec-label {
    color: var(--gray-600);
    font-weight: 500;
}

.spec-value {
    color: var(--gray-800);
    font-weight: 600;
    text-align: right;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.empty-state p {
    font-size: 0.875rem;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--gray-500);
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* Responsivo para componentes */
@media (max-width: 768px) {
    .components-tabs {
        margin-bottom: 1rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .component-cards {
        grid-template-columns: 1fr;
    }
    
    .component-card {
        padding: 0.75rem;
    }
    
    .card-header h5 {
        font-size: 0.8rem;
    }
    
    .spec-row {
        font-size: 0.7rem;
    }
    
    .empty-state {
        padding: 2rem 0.5rem;
    }
    
    .empty-state i {
        font-size: 2rem;
    }
    
    .empty-state h3 {
        font-size: 1rem;
    }
    
    /* Sub-tabs responsivo */
    .gpu-subtabs {
        gap: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    .subtab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .subtab-btn i {
        font-size: 0.9rem;
    }
}

/* ===== CORREÇÃO ESPECÍFICA - MODAIS DE MARCAS E LINHAS ===== */

/* Garantir centralização correta dos novos modais */
#brandModal,
#productLineModal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

#brandModal.show,
#productLineModal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Garantir que o conteúdo seja bem dimensionado */
#brandModal .modal-content,
#productLineModal .modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
}

/* Responsividade para modais de marcas e linhas */
@media (max-width: 768px) {
    #brandModal .modal-content,
    #productLineModal .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* === ESTILOS PARA ADIÇÃO INLINE NO GERADOR === */

/* Ajustar config-title para ter flex layout */
.config-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

/* Remover alterações nos labels dos form-groups */
.form-group label {
    position: static;
    display: block;
    align-items: normal;
    justify-content: normal;
}

/* Dropdown inline para adicionar no header */
.config-title .inline-add-dropdown {
    position: relative;
    margin-left: auto;
}

/* Botão + inline no header */
.config-title .btn-inline-add {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-title .btn-inline-add:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Menu dropdown inline no header */
.config-title .inline-add-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 150px;
    overflow: hidden;
    margin-top: 8px;
}

/* Opções do menu inline */
.inline-add-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-color);
}

.inline-add-option:hover {
    background: var(--gray-50);
}

.inline-add-option i {
    color: var(--primary-color);
    width: 16px;
}

/* Modais inline */
#inlineBrandModal,
#inlineLineModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#inlineBrandModal .modal-content,
#inlineLineModal .modal-content,
#inlineProcessorModal .modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

/* Modal de processador precisa ser um pouco maior */
#inlineProcessorModal .modal-content {
    max-width: 500px;
}

/* Responsividade para adição inline */
@media (max-width: 768px) {
    .config-title .inline-add-menu {
        left: 0;
        right: auto;
        min-width: 120px;
    }
    
    .config-title .btn-inline-add {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}

/* === SEÇÃO DE GARANTIA === */

/* Espaçamento da subseção garantia */
.garantia-section {
    margin-top: 2rem !important;
}

.garantia-title {
    margin-bottom: 1rem !important;
    display: block !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.garantia-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 0.5rem;
}

.garantia-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}

.garantia-btn:hover {
    border-color: #022B6D;
    background: #eff6ff;
    color: #022B6D;
}

.garantia-btn.active {
    border-color: #022B6D;
    background: #022B6D;
    color: #ffffff;
}

.garantia-btn.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.garantia-btn i {
    font-size: 14px;
}

.garantia-options {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.garantia-options .form-group {
    margin-bottom: 0;
}

.slider-container {
    margin: 10px 0;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #022B6D;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #022B6D;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6b7280;
    margin-top: 5px;
}

.slider-labels span {
    font-weight: 500;
}

/* Display em tempo real dos meses */
#garantiaMesesDisplay {
    font-weight: 600;
    color: #022B6D;
}

/* Input de data customizado */
input[type="date"] {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    font-family: inherit;
    max-width: 400px;
    width: 100%;
}

input[type="date"]:focus {
    outline: none;
    border-color: #022B6D;
    box-shadow: 0 0 0 3px rgba(2, 43, 109, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    color: #022B6D;
    cursor: pointer;
}

/* Responsividade para botões de garantia */
@media (max-width: 768px) {
    .garantia-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .garantia-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    input[type="date"] {
        max-width: 100%;
    }
}

/* ===== HISTÓRICO DE NOTEBOOKS ===== */

/* Tabela de Histórico */
.history-table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    margin: 20px 0;
    position: relative;
}

/* Loading overlay for history table */
.table-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 12px;
}
.table-loading-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #374151;
    font-weight: 500;
}
.table-loading-content i {
    color: #2563eb;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    overflow: visible;
}

.history-table thead {
    background: #022B6D;
    color: white;
}

.history-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.history-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.history-table tbody tr:hover {
    background: #f8fafc;
}

.history-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

/* Célula de preço clicável */
.history-table .preco[style*="cursor: pointer"]:hover {
    background-color: #f0f9ff;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

/* Status Filter Tags */
.status-filter-container {
    margin: 1rem 0;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Fix: Quando paginação do topo está oculta, alinhar filtros à direita */
.status-filter-container:has(#paginationContainerTop[style*="display: none"]) {
    justify-content: flex-end;
}

/* Fallback para navegadores que não suportam :has() */
.status-filter-container.no-top-pagination {
    justify-content: flex-end;
}

.status-filter-tags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

/* Paginação do topo (dentro do container de status) */
#paginationContainerTop.pagination-container {
    margin: 0;            /* remove margens padrão */
    padding: 0;           /* remove padding padrão */
    border-top: none;     /* sem linha divisória no topo */
}

#paginationContainerTop .pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.status-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.status-tag.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.status-tag i {
    font-size: 0.8rem;
}

/* Cores específicas por status nos filtros */
.status-tag[data-status="all"] {
    border-color: #d1d5db;
    background: #f9fafb;
    color: #374151;
}
.status-tag[data-status="all"]:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
    color: #111827;
}
.status-tag.active[data-status="all"] {
    background: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
}

/* Pending (âmbar) */
.status-tag[data-status="pending"] {
    border-color: #fbbf24; /* amber-400 */
    background: #fffbeb;   /* amber-50 */
    color: #b45309;        /* amber-700 */
}
.status-tag[data-status="pending"]:hover {
    border-color: #f59e0b; /* amber-500 */
    background: #fef3c7;   /* amber-100 */
    color: #92400e;        /* amber-800 */
}
.status-tag.active[data-status="pending"] {
    background: #f59e0b;   /* amber-500 */
    border-color: #d97706; /* amber-600 */
    color: #ffffff;
}

/* Approved (verde) */
.status-tag[data-status="approved"] {
    border-color: #86efac; /* green-300 */
    background: #f0fdf4;   /* green-50 */
    color: #16a34a;        /* green-600 */
}
.status-tag[data-status="approved"]:hover {
    border-color: #34d399; /* green-400 */
    background: #dcfce7;   /* green-100 */
    color: #15803d;        /* green-700 */
}
.status-tag.active[data-status="approved"] {
    background: #16a34a;   /* green-600 */
    border-color: #16a34a;
    color: #ffffff;
}

/* No Site (azul) */
.status-tag[data-status="finalizado"] {
    border-color: #93c5fd; /* blue-300 */
    background: #eff6ff;   /* blue-50 */
    color: #1d4ed8;        /* blue-700 */
}
.status-tag[data-status="finalizado"]:hover {
    border-color: #60a5fa; /* blue-400 */
    background: #dbeafe;   /* blue-100 */
    color: #1e40af;        /* blue-800 */
}
.status-tag.active[data-status="finalizado"] {
    background: #3b82f6;   /* blue-500 */
    border-color: #2563eb; /* blue-600 */
    color: #ffffff;
}

.status-tag[data-status="vendido"] {
    border-color: #fed7aa; /* orange-200 */
    background: #fef3c7;   /* amber-100 */
    color: #d97706;        /* amber-600 */
}
.status-tag[data-status="vendido"]:hover {
    border-color: #fdba74; /* orange-300 */
    background: #fde68a;   /* yellow-200 */
    color: #b45309;        /* amber-700 */
}
.status-tag.active[data-status="vendido"] {
    background: #f59e0b;   /* amber-500 */
    border-color: #d97706; /* amber-600 */
    color: #ffffff;
}

/* Modal de Venda - Estilos específicos */
.notebook-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.notebook-info-card h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notebook-info-card .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

#vendorSection {
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #d97706;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Botão marcar como vendido */
#soldConfirmBtn {
    background: #d97706 !important;
    border-color: #b45309 !important;
    color: white !important;
}

#soldConfirmBtn:hover {
    background: #b45309 !important;
    border-color: #92400e !important;
}

/* Definir larguras das colunas - ATUALIZADO */
.col-codigo, .history-table .codigo {
    width: 10%;
    font-weight: 600;
    color: #022B6D;
}

.col-marca, .history-table .marca {
    width: 15%;
    font-weight: 500;
}

.col-modelo, .history-table .modelo {
    width: 30%;
    color: #4b5563;
}

.col-data, .history-table .data {
    width: 15%;
}

.col-responsavel, .history-table .responsavel {
    width: 15%;
    color: #374151;
}

.col-aprovado, .history-table .aprovado {
    width: 10%;
    text-align: left;
}

/* Ícone de foto junto ao status */
.photo-status-icon {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 2px solid !important;
    position: relative !important;
    z-index: 1 !important;
}

.photo-status-icon.has-photo {
    background: #dcfce7 !important;
    color: #16a34a !important;
    border-color: #86efac !important;
}

.photo-status-icon.has-photo:hover {
    background: #bbf7d0 !important;
    border-color: #4ade80 !important;
    transform: scale(1.1) !important;
}

.photo-status-icon.no-photo {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
}

.photo-status-icon.no-photo:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    transform: scale(1.1) !important;
}

.col-acoes, .history-table .acoes {
    width: 10%;
    text-align: center;
}

/* Formatação da data e hora */
.date-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-time .date {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.date-time .time {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

/* Menu de Ações */
.action-menu {
    position: relative;
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.view-btn {
    background: #3b82f6;
    border: 1px solid #2563eb;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.875rem;
}

.view-btn:hover {
    background: #2563eb;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.action-menu-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.action-menu-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-width: 200px;
    z-index: 9999;
    overflow: hidden;
    /* Preparação para posicionamento dinâmico */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.action-dropdown.show {
    visibility: visible;
    opacity: 1;
}

/* Posicionamento para cima quando necessário */
.action-dropdown.position-up {
    top: auto;
    bottom: 100%;
    margin-bottom: 4px;
}

/* Posicionamento para esquerda quando necessário */
.action-dropdown.position-left {
    right: auto;
    left: 0;
}

/* Posicionamento padrão para baixo */
.action-dropdown.position-down {
    top: 100%;
    bottom: auto;
    margin-top: 4px;
}

/* Scroll interno se necessário */
.action-dropdown.with-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* Estilização da barra de scroll */
.action-dropdown::-webkit-scrollbar {
    width: 6px;
}

.action-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.action-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.action-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .action-dropdown {
        min-width: 140px;
        max-width: 180px;
        font-size: 12px;
    }
    
    .action-dropdown a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .action-dropdown a i {
        width: 12px;
        font-size: 11px;
    }
    
    /* Em telas pequenas, sempre usar scroll se necessário */
    .action-dropdown.with-scroll {
        max-height: 200px;
    }
}

/* Melhorias visuais para interação */
.action-menu {
    position: relative;
}

.action-menu-btn {
    position: relative;
    z-index: 1;
}

.action-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.action-dropdown a:hover {
    background: #f3f4f6;
}

.action-dropdown a i {
    width: 14px;
    font-size: 12px;
}

/* Cores específicas para ações */
.action-dropdown a:nth-child(2):hover { /* Excluir */
    background: #fef2f2;
    color: #dc2626;
}

.action-dropdown a:nth-child(5):hover { /* Arquivar */
    background: #fffbeb;
    color: #d97706;
}

/* Status de Aprovação */
.approval-status {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.status-icon.pending {
    background: #fef3c7;
    color: #d97706;
    border: 2px solid #fbbf24;
}

.status-icon.approved {
    background: #f0fdf4;
    color: #16a34a;
    border: 2px solid #86efac;
}

.status-icon.finalizado {
    background: #eff6ff;   /* blue-50 */
    color: #1d4ed8;        /* blue-700 */
    border: 2px solid #93c5fd; /* blue-300 */
}

.status-icon.vendido {
    background: #fef3c7;   /* amber-100 */
    color: #d97706;        /* amber-600 */
    border: 2px solid #fed7aa; /* orange-200 */
}

.status-icon:hover {
    transform: scale(1.1);
}

/* Botão de Aprovar no Modal */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    color: white;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state i {
    color: #d1d5db;
    margin-bottom: 24px;
}

.empty-state h3 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 20px;
}

.empty-state p {
    margin: 0 0 24px 0;
    line-height: 1.6;
}

/* Paginação */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-controls .btn {
    min-width: 90px;
}

/* Responsividade da tabela */
@media (max-width: 1024px) {
    .history-table {
        font-size: 13px;
    }
    
    .history-table th,
    .history-table td {
        padding: 12px 8px;
    }
    
    .col-modelo {
        width: 20%;
    }
    
    .col-responsavel {
        width: 12%;
    }
    
    .col-aprovado {
        width: 8%;
    }
    
    .col-acoes {
        width: 8%;
    }
}

@media (max-width: 768px) {
    .history-table-container {
        overflow-x: auto;
    }
    
    .history-table {
        min-width: 700px;
        font-size: 12px;
    }
    
    .history-table th,
    .history-table td {
        padding: 10px 6px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ===== MODAL DE VISUALIZAÇÃO ===== */
.view-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    margin: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* (duplicated .modal removed; unified earlier) */

.view-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.view-modal .modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    gap: 0.5rem;
}

.view-modal .modal-footer .btn-warning {
    background: #f59e0b;
    border: 1px solid #f59e0b;
    color: #111827;
}
.view-modal .modal-footer .btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.view-modal .modal-footer .btn {
    margin: 0 0.25rem !important;
}

.view-modal .modal-footer .btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    min-width: auto;
}

.view-modal .modal-footer .btn-success {
    background: #22c55e;
    border: 1px solid #22c55e;
    color: white;
}

.view-modal .modal-footer .btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-1px);
}

.view-modal .modal-footer .btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.view-modal .modal-footer .btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.spec-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.spec-section:last-child {
    border-bottom: none;
}

.spec-section h4 {
    color: white !important;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spec-section h4 i {
    color: white !important;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Forçar cor branca nos títulos das seções do modal */
.view-modal .spec-section h4,
#viewModalContent .spec-section h4 {
    color: white !important;
}

.view-modal .spec-section h4 i,
#viewModalContent .spec-section h4 i {
    color: white !important;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.spec-label {
    font-weight: 500;
    color: var(--gray-600);
    flex: 0 0 120px;
}

.spec-value {
    color: var(--gray-800);
    text-align: right;
    word-break: break-word;
}

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

.spec-list li {
    padding: 0.25rem 0;
    color: var(--gray-700);
}

.spec-list li:before {
    content: "•";
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.notebook-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 2rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
}

.notebook-header h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.notebook-header h2 i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.notebook-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.meta-item i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Melhorias nas seções de especificações */
.spec-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.spec-section:last-child {
    border-bottom: none;
}

.spec-section h4 {
    color: white !important;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.spec-section h4 i {
    color: white !important;
    font-size: 1rem;
    opacity: 0.8;
    width: 20px;
    text-align: center;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.spec-item:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spec-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.spec-value {
    color: var(--gray-900);
    font-weight: 500;
    font-size: 0.95rem;
    word-break: break-word;
}

/* Badges e elementos especiais */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-bom {
    background: #dbeafe;
    color: #1e40af;
}

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

.status-ruim {
    background: #fee2e2;
    color: #dc2626;
}

.brand-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.brand-intel {
    background: #dbeafe;
    color: #1e40af;
}

.brand-amd {
    background: #fed7d7;
    color: #c53030;
}

.brand-nvidia {
    background: #d9f7be;
    color: #389e0d;
}

.processor-name {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.clock-speed {
    font-weight: 600;
    color: var(--success-color);
}

.memory-type {
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
}

.total-memory {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1rem;
}

.observation-item {
    grid-column: 1 / -1;
    background: var(--blue-50);
    border-color: var(--blue-200);
}

.observation-text {
    font-style: italic;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Seção de slots de memória */
.memory-slots {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.memory-slots h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.slot-item {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s ease;
}

.slot-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.slot-header span:first-of-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.soldered-badge {
    background: var(--warning-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.slot-specs {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-specs span {
    font-weight: 600;
    color: var(--primary-color);
}

.slot-specs span:last-child {
    color: var(--success-color);
}

/* Layout compacto do modal */
.compact-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem 1.5rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-sizing: border-box;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.header-main h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.code-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.serial-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: 'Courier New', monospace;
    height: 33px;
}

.serial-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

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

.price-info .copy-price {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    height: 37px;
}

.price-info .card-price-copy {
    background: rgb(255, 255, 255);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.price-info .card-price-copy i {
    color: #3b82f6;
}

.price-info .pix-price-copy {
    background: #16a34a;
    color: white;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.price-info .pix-price-copy i {
    color: white;
}

.price-info .profit-badge {
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.8rem;
    height: 37px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    /* Background e cores são definidas dinamicamente via JavaScript */
}

.header-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
    flex-wrap: wrap;
    align-items: center;
}

.header-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Informação de aprovação no modal */
.approval-info {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    color: #22c55e !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    backdrop-filter: blur(4px);
    margin-top: 0.5rem;
    flex-basis: 100%;
}

/* Badge do selo no header */
.header-status-badge {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.header-status-badge:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
}

.badge-emoji {
    font-size: 0.9rem;
    filter: brightness(1.2);
}

/* Cores específicas dos badges no header */
.badge-novo {
    background: rgba(255, 215, 0, 0.3) !important;
    border-color: rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Variantes adicionais usadas pelo selo de carcaça */
.badge-platina {
    background: rgba(221, 221, 221, 0.35) !important;
    border-color: rgba(221, 221, 221, 0.6) !important;
    box-shadow: 0 0 8px rgba(221, 221, 221, 0.25);
}

.badge-ouro {
    background: rgba(255, 215, 0, 0.28) !important;
    border-color: rgba(255, 215, 0, 0.55) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.22);
}

.badge-prata {
    background: rgba(192, 192, 192, 0.32) !important;
    border-color: rgba(192, 192, 192, 0.55) !important;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.2);
}

.badge-bronze {
    background: rgba(205, 127, 50, 0.28) !important;
    border-color: rgba(205, 127, 50, 0.55) !important;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.2);
}

.badge-gold {
    background: rgba(255, 165, 0, 0.3) !important;
    border-color: rgba(255, 165, 0, 0.5) !important;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.3);
}

.badge-silver {
    background: rgba(192, 192, 192, 0.3) !important;
    border-color: rgba(192, 192, 192, 0.5) !important;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.3);
}

.badge-smart {
    background: rgba(100, 149, 237, 0.3) !important;
    border-color: rgba(100, 149, 237, 0.5) !important;
    box-shadow: 0 0 8px rgba(100, 149, 237, 0.3);
}

.badge-classic {
    background: rgba(255, 140, 0, 0.3) !important;
    border-color: rgba(255, 140, 0, 0.5) !important;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.3);
}

.badge-default {
    background: rgba(128, 128, 128, 0.3) !important;
    border-color: rgba(128, 128, 128, 0.5) !important;
}

/* ===== Overrides para o modal de precificação (fundo claro) ===== */
.pricing-modal .notebook-info .code-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pricing-modal .notebook-info .code-badge {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-200);
}

.pricing-modal .notebook-info .header-status-badge {
    color: var(--gray-800) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.compact-section {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    min-width: 0;
    box-sizing: border-box;
}

.compact-section:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.section-header {
    background: var(--gray-50);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header i {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.section-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.compact-specs {
    padding: 1.25rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 1rem;
}

.spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-row .label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    min-width: 80px;
    flex-shrink: 0;
}

.spec-row .value {
    color: var(--gray-900);
    font-weight: 500;
    text-align: right;
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
    max-width: 55%;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Responsivo */
@media (min-width: 1200px) {
    .view-modal {
        max-width: 1050px;
    }
}

@media (max-width: 768px) {
    .compact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .view-modal {
        max-width: 95vw;
        width: 95vw;
        margin: 1rem auto;
        max-height: 95vh;
    }
    
    .view-modal .modal-body {
        padding: 1rem;
    }
    
    .view-modal .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .view-modal .modal-footer .btn-sm {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .compact-header {
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
    }
    
    .header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .header-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .header-status-badge {
        padding: 0.3rem 0.7rem !important;
        font-size: 0.85rem !important;
        align-self: flex-start;
    }
    
    .spec-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .spec-row .value {
        text-align: left;
    }
}

/* Estilos específicos para valores especiais */
.spec-row .value[title] {
    cursor: help;
}

.compact-specs {
    padding: 1rem;
}

.storage-item {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.storage-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.storage-item.primary-storage {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.storage-item.empty-slot {
    border-color: var(--gray-300);
    background: var(--gray-50);
    opacity: 0.7;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.storage-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--gray-800);
}

.storage-title i {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.primary-badge {
    background: var(--success-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.empty-badge {
    background: var(--gray-400);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.storage-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.storage-spec {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.storage-type-ssd {
    color: var(--success-color);
    font-weight: 600;
}

.storage-type-hdd {
    color: var(--primary-color);
    font-weight: 600;
}

.storage-size {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.1rem;
}

.storage-summary {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.summary-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.summary-item i {
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    .view-modal {
        max-width: 98vw;
        width: 98vw;
        margin: 1vh auto;
        max-height: 98vh;
    }
    
    .view-modal .modal-body {
        padding: 1rem;
    }
    
    .view-modal .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .view-modal .modal-footer .btn-sm {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    .notebook-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .spec-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .spec-item {
        padding: 0.75rem;
    }
    
    .slots-grid {
        grid-template-columns: 1fr;
    }
    
    .spec-label {
        font-size: 0.75rem;
    }
    
    .spec-value {
        font-size: 0.9rem;
    }
    
    .notebook-header {
        padding: 1.5rem 1rem;
    }
    
    .notebook-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Filtros do histórico */
.history-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.history-filters .filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.history-filters .search-input {
    min-width: 250px;
}

@media (max-width: 768px) {
    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-filters .filter-group {
        flex: 1;
    }

/* Animações para notificações */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Modal de confirmação de exclusão */
.modal-content .fa-trash-alt {
    color: #ef4444;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal .modal-content .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    transition: all 0.2s ease;
}

.modal .modal-content .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

.modal .modal-content .btn-outline-secondary {
    border-color: #6b7280;
    color: #6b7280;
    transition: all 0.2s ease;
}

.modal .modal-content .btn-outline-secondary:hover {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}
    
    .history-filters .search-input {
        min-width: auto;
        width: 100%;
    }
}

/* ===== MODAL CONFIRMAÇÃO EDIÇÃO ===== */
.edit-confirm-options {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.edit-confirm-options .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-confirm-options .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsivo para modal de edição */
@media (max-width: 480px) {
    .edit-confirm-options {
        flex-direction: column;
    }
    
    .edit-confirm-options .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== MODAL AÇÕES PÓS-SALVAMENTO ===== */
.post-save-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.post-save-options .btn {
    justify-content: flex-start;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.post-save-options .btn i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.post-save-options .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsivo para modal pós-salvamento */
@media (min-width: 640px) {
    .post-save-options {
        flex-direction: row;
        gap: 10px;
    }
    
    .post-save-options .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* ===== BOTÃO FLUTUANTE MODO EDIÇÃO ===== */
.floating-edit-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

.floating-edit-button.hidden {
    animation: slideOutDown 0.3s ease-in forwards;
}

/* Botão flutuante de voltar */
.floating-back-button {
    position: fixed;
    bottom: 20px;
    right: 140px; /* À esquerda do botão de salvar */
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

.floating-back-button.hidden {
    animation: slideOutDown 0.3s ease-in forwards;
}

.btn-floating {
    /* Usar as mesmas classes do botão original */
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: auto;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-floating:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.4);
}

.btn-floating:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(34, 197, 94, 0.3);
}

.btn-floating::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: 50%;
}

.btn-floating i {
    position: relative;
    z-index: 1;
}

/* Variante secundária do botão flutuante (para voltar) */
.btn-floating-secondary {
    background: var(--secondary-color, #6b7280) !important;
    border-color: var(--secondary-color, #6b7280) !important;
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.3) !important;
}

.btn-floating-secondary:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
    box-shadow: 0 6px 25px rgba(107, 114, 128, 0.4) !important;
}

.btn-floating-secondary:active {
    box-shadow: 0 2px 15px rgba(107, 114, 128, 0.3) !important;
}

/* Animações */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsivo */
@media (max-width: 768px) {
    .floating-edit-button {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-back-button {
        bottom: 15px;
        right: 140px; /* Manter distância do botão de salvar */
    }
    
    .btn-floating {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 480px) {
    .floating-back-button {
        right: 120px; /* Reduzir um pouco a distância em telas pequenas */
    }
    
    .btn-floating {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: auto;
    }
    
    /* Mostrar apenas ícones em telas muito pequenas */
    .btn-floating span {
        display: none;
    }
}

/* ===== ESTILOS DE VALIDAÇÃO ===== */

/* Campos com erro de validação */
.validation-error {
    border: 2px solid var(--error-color) !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    animation: shake 0.6s ease-in-out;
}

/* Animação de shake para campos com erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Modal de validação */
.validation-modal {
    z-index: 10000;
}

.validation-modal-content {
    max-width: 600px;
    width: 90%;
    margin: 2rem auto;
}

.validation-header {
    padding: 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.validation-header.error {
    background-color: var(--error-color);
    color: white;
}

.validation-header.warning {
    background-color: var(--warning-color);
    color: white;
}

.validation-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-body {
    padding: 1.5rem;
    background: white;
}

.validation-errors,
.validation-warnings {
    margin-bottom: 1rem;
}

.validation-errors h4,
.validation-warnings h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-errors h4 {
    color: var(--error-color);
}

.validation-warnings h4 {
    color: var(--warning-color);
}

.validation-errors ul,
.validation-warnings ul {
    margin-left: 1.5rem;
    margin-bottom: 0;
}

.validation-errors li,
.validation-warnings li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.validation-errors li {
    color: var(--gray-700);
}

.validation-warnings li {
    color: var(--gray-600);
}

/* Destaque para button groups com erro */
.button-group.validation-error {
    border: 2px solid var(--error-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background-color: rgba(239, 68, 68, 0.05);
}

.radio-group.validation-error {
    border: 2px solid var(--error-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Responsivo para modal de validação */
@media (max-width: 768px) {
    .validation-modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    
    .validation-header,
    .validation-body {
        padding: 1rem;
    }
    
    .validation-header h3 {
        font-size: 1.1rem;
    }
}

/* ==========================
   CONFIGURAÇÕES STYLES
   ========================== */

/* Header da página de configurações */
.config-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.config-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-header h1 i {
    color: var(--primary-light);
}

.config-header p {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Container principal das configurações */
.config-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Seção de configurações */
.config-container .config-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    /* removido overflow:hidden para não interferir em outros módulos (ex: gerador) */
}

/* Garantir que no gerador nunca haja clipping dos dropdowns */
.spec-builder .config-section { overflow: visible; }

.section-header {
    padding: 1.5rem;
    background: transparent;
    color: var(--gray-800);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Formulário de configurações */
.config-form {
    padding: 2rem;
}

.config-form .form-group {
    margin-bottom: 1.5rem;
}

.config-form .form-group:last-of-type {
    margin-bottom: 2rem;
}

.config-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.config-form label i {
    color: var(--primary-light);
    width: 16px;
}

.config-form input[type="text"],
.config-form input[type="email"] {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--white);
}

.config-form input[type="text"]:focus,
.config-form input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.config-form input.readonly-field {
    background-color: var(--gray-100);
    color: var(--gray-600);
    cursor: not-allowed;
}

.config-form .form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Ações do formulário */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.form-actions .btn-secondary,
.form-actions .btn-primary {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-300);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estados ativos dos botões */
.btn-primary-active {
    background: linear-gradient(135deg, var(--success-color), #16a34a) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.btn-secondary-active {
    background-color: var(--warning-color) !important;
    color: var(--white) !important;
}

/* Loading overlay específico para configurações */
.config-container .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Responsividade para configurações */
@media (max-width: 768px) {
    .config-header h1 {
        font-size: 1.75rem;
    }
    
    .config-form {
        padding: 1.5rem;
    }
    
    .section-header {
        padding: 1.25rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    .form-actions .btn-secondary,
    .form-actions .btn-primary {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .config-container {
        margin: 0 1rem;
    }
    
    .config-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .config-form {
        padding: 1rem;
    }
    
    .section-header {
        padding: 1rem;
    }
}

/* Verificação de código interno */
.code-check-message {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-check-message.success {
    background-color: var(--green-50, #f0f9ff);
    color: var(--green-700, #047857);
    border: 1px solid var(--green-200, #86efac);
}

.code-check-message.error {
    background-color: var(--red-50, #fef2f2);
    color: var(--red-700, #b91c1c);
    border: 1px solid var(--red-200, #fecaca);
}

.code-check-message.warning {
    background-color: var(--yellow-50, #fffbeb);
    color: var(--yellow-700, #a16207);
    border: 1px solid var(--yellow-200, #fde68a);
}

.code-check-message i {
    flex-shrink: 0;
}

/* Dashboard Estatísticas Avançadas */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

/* Garantir que SVG fallback dentro de .stat-icon use tamanho adequado */
.stat-icon svg.fa-svg-fallback {
    width: 1.75rem;
    height: 1.75rem;
    display: block;
}
/* Fallback logic: ícone <i> oculto até a fonte carregar; SVG visível sempre até isso */
.stat-icon .fa-circle-check { display: none; }
body.fa-loaded .stat-icon .fa-circle-check { display: inline-block; }
body.fa-loaded .stat-icon svg.fa-svg-fallback { display: none; }

/* Fallback se --success-color não estiver definido (algumas builds antigas) */
:root:not([data-success-color-init]) .stat-icon.approved {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.stat-icon.total {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.stat-icon.approved {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
}

.stat-icon.pending {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}


.stat-icon.finalized {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.stat-icon.finalized .fa-flag-checkered {
    font-size: 2rem;
    color: #fff;
    filter: drop-shadow(0 1px 2px #2563eb33);
}

.stat-icon.sold {
    background: linear-gradient(135deg, #059669, #047857);
}

.stat-icon.sold .fa-shopping-cart {
    font-size: 2rem;
    color: #fff;
    filter: drop-shadow(0 1px 2px #04785733);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1;
}

.stat-content p {
    color: var(--gray-600);
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Métricas de Estoque */
.stock-metrics {
    background: var(--white);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.stock-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.stock-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.stock-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-header h3 i {
    color: var(--primary-color);
}

.stock-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.stock-header small {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-style: italic;
}

.stock-header small i {
    color: var(--warning-color);
}

.stock-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.stock-card {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-right: 1px solid var(--gray-200);
    transition: all 0.2s ease;
    background: var(--white);
}

.stock-card:last-child {
    border-right: none;
}

.stock-card:hover {
    background: var(--gray-50);
}

.stock-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.stock-icon.total-value {
    background: linear-gradient(135deg, #1e40af, #2563eb);
}

.stock-icon.pix-value {
    background: linear-gradient(135deg, #059669, #047857);
}

.stock-icon.quantity {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.stock-icon.brands {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.stock-icon.average {
    background: linear-gradient(135deg, #ea580c, #dc2626);
}

.stock-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1;
}

.stock-content p {
    color: var(--gray-600);
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Gráfico dentro das métricas de estoque */
.stock-chart {
    border-top: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.stock-chart-header {
    margin-bottom: 1rem;
}

.stock-chart-header h4 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-chart-header h4 i {
    color: var(--primary-color);
}

.stock-chart-content {
    height: 250px;
    position: relative;
}

.stock-chart-content canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== Status de Carcaça (Estoque) ===== */
.carcaca-status-distribution {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: .5rem;
}

.carcaca-status-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: .75rem;
    padding: .75rem .85rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
    overflow: hidden;
}

.carcaca-status-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.carcaca-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .65rem;
    border-radius: .5rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    position: relative;
}

.carcaca-status-badge i {
    font-size: .7rem;
    margin-right: .35rem;
    opacity: .9;
}

.carcaca-status-body h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gray-900);
}

.carcaca-status-body p {
    margin: .2rem 0 .4rem;
    font-size: .7rem;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: .5px;
}

.carcaca-status-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.carcaca-status-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}

@media (max-width: 620px) {
    .carcaca-status-distribution { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .carcaca-status-body h5 { font-size: 1rem; }
}

/* Controles do Dashboard */
.dashboard-controls {
    margin-bottom: 2rem;
}

.dashboard-controls .header-controls {
    background: var(--white);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Gráficos */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--white);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}

.chart-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header h3 i {
    color: var(--primary-color);
}

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

.chart-content {
    padding: 1.5rem;
    height: 300px;
    position: relative;
}

.chart-content canvas {
    max-height: 100%;
}

/* Tabelas de Estatísticas */
.dashboard-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.table-container {
    background: var(--white);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.table-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-header h3 i {
    color: var(--primary-color);
}

.table-content {
    padding: 0;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.stats-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900);
    font-size: 0.875rem;
}

.stats-table tbody tr:hover {
    background: var(--gray-50);
}

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

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.loading-spinner p {
    margin: 0;
    font-weight: 500;
}

/* Form Select */
.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: var(--white);
    color: var(--gray-900);
    font-size: 0.875rem;
    min-width: 140px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 43, 109, 0.1);
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .stats-overview {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .stock-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stock-card {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .stock-card:nth-child(2n) {
        border-right: 1px solid var(--gray-200);
    }
    
    .stock-card:nth-child(3),
    .stock-card:nth-child(4) {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stock-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stock-card {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .stock-card:nth-child(2n) {
        border-right: 1px solid var(--gray-200);
    }
    
    .stock-card:nth-child(3),
    .stock-card:nth-child(4) {
        border-bottom: none;
    }
    
    .dashboard-controls .header-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .stock-chart-content {
        height: 200px;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-tables {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-content {
        height: 250px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-overview {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stock-cards {
        grid-template-columns: 1fr;
    }
    
    .stock-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stock-card {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding: 1rem;
    }
    
    .stock-card:last-child {
        border-bottom: none;
    }
    
    .stock-content h4 {
        font-size: 1.25rem;
    }
    
    .dashboard-controls .header-controls {
        padding: 1rem;
    }
    
    .stock-chart {
        padding: 1rem;
    }
    
    .stock-chart-content {
        height: 180px;
    }
    
    .chart-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .chart-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
}

/* ===== TELA DE CARREGAMENTO MODO EDIÇÃO ===== */
.edit-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.edit-loading-container {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: white;
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.edit-loading-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.edit-loading-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.edit-loading-content h3 i {
    font-size: 2rem;
    color: #93c5fd;
}

.edit-loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    gap: 0.3rem;
}

.spinner-ring {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
}

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

.edit-loading-text p {
    margin: 1rem 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.edit-loading-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.edit-loading-steps {
    text-align: left;
    margin-top: 2rem;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    opacity: 0.4;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.loading-step.active {
    opacity: 1;
    color: #93c5fd;
    transform: translateX(5px);
}

.loading-step.completed {
    opacity: 0.7;
    color: #60a5fa;
}

.loading-step i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

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

/* ===================================================== */
/* POPUP DE APROVAÇÃO */
/* ===================================================== */

.approval-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.approval-popup-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
}

.approval-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease;
}

.approval-popup h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
}

.approval-popup p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.approval-timer-container {
    margin: 1.5rem 0;
}

.approval-timer-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.approval-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    width: 100%;
    transform-origin: left;
    animation: timerCountdown 3s linear forwards;
}

.approval-timer-text {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.approval-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.approval-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

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

@keyframes timerCountdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ===================================================== */
/* Mini upgrade chips (publish modal) */
/* ===================================================== */
.chip-upg-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.chip-upg{
    display:inline-flex;
    align-items:center;
    gap:10px;
    position: relative;
    border:1px solid var(--gray-200);
/* Evitar que uma área maior do label acione o :hover do botão */
label.label-with-gear .label-text-tipo { position: relative; z-index:0; }
    background: var(--white);
    color: var(--gray-900);
    padding:8px 12px;
    border-radius:999px;
    font-size:14px;
    cursor:pointer;
    transition:background .15s ease,border-color .15s ease, box-shadow .15s ease;
}
.chip-upg:hover{ background: var(--gray-100); border-color: var(--gray-300); }
.chip-upg .chip-left{ font-weight:700; color: var(--gray-900); }
.chip-upg .chip-right{ color:#166534; font-weight:700; }

/* Larger size for upgrade chips */
.chip-upg-lg{ padding:10px 14px; font-size:15px; }

/* Primary chip (Preço principal) */
.chip-upg-primary{
    background: #f0f9ff;
    border-color: #bae6fd;
    box-shadow: 0 1px 0 rgba(2,132,199,0.06);
}

/* RAM type badge */
.badge-ram {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.badge-ram-ddr4 {
    background: #f1f5f9; /* slate-100 */
    color: #0f172a;      /* slate-900 */
    border: 1px solid #cbd5e1; /* slate-300 */
}
.badge-ram-ddr5 {
    background: #e0f2fe; /* sky-100 */
    color: #0369a1;      /* sky-700 */
    border: 1px solid #bae6fd; /* sky-200 */
}
.chip-upg-primary .chip-left{ color:#075985; }
.chip-upg-primary .chip-right{ color:#0c4a6e; }

/* ===================================================== */
/* MODAL AND FORM RESPONSIVENESS */
/* ===================================================== */
@media (max-width: 768px) {
    .modal {
        padding: 1rem 0.5rem;
    }
    
    .modal-content {
        max-width: 95vw;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-footer .btn-danger {
        order: 2;
        margin-right: 0;
    }
    
    .modal-footer .btn-outline {
        order: 3;
    }
    
    .modal-footer .btn-primary {
        order: 1;
        margin-left: 0;
    }
}

/* ===================================================== */
/* PHOTO CONFIRMATION MODAL */
/* ===================================================== */
#photoConfirmModal .notebook-info {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#photoConfirmModal .notebook-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--gray-900);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#photoConfirmModal .notebook-info p {
    margin: 0.25rem 0;
    color: var(--gray-700);
    font-size: 0.875rem;
}

#photoConfirmModal .notebook-info .code-badge {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

#photoConfirmModal .photo-question {
    text-align: center;
    margin-bottom: 1rem;
}

#photoConfirmModal .photo-question p {
    margin: 0.5rem 0;
}

#photoConfirmModal .photo-question p:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

#photoConfirmModal .photo-question .text-secondary {
    font-size: 0.875rem;
    color: var(--gray-600);
}

#photoConfirmModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

#photoConfirmModal .modal-footer .btn {
    min-width: 120px;
    white-space: nowrap;
    flex: 1;
    max-width: 150px;
    height: 44px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#photoConfirmModal .modal-footer #btnWithoutPhoto {
    background: var(--danger-color);
    color: var(--white);
    border: 1px solid var(--danger-color);
}

#photoConfirmModal .modal-footer #btnWithoutPhoto i {
    color: var(--white);
    font-size: 0.875rem;
}

#photoConfirmModal .modal-footer #btnWithoutPhoto:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

#photoConfirmModal .modal-footer #btnWithPhoto {
    background: var(--success-color);
    color: var(--white);
    border: 1px solid var(--success-color);
}

#photoConfirmModal .modal-footer #btnWithPhoto i {
    color: var(--white);
    font-size: 0.875rem;
}

#photoConfirmModal .modal-footer #btnWithPhoto:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    #photoConfirmModal .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #photoConfirmModal .modal-footer .btn {
        margin: 0;
        width: 100%;
    }
}
