:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #333333;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #16a34a;
    --danger: #ef4444;
    
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* ======== PULL TO REFRESH ======== */
#pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    pointer-events: none;
    transform: translateY(-100%);
    transition: transform 0.2s ease;
}

#pull-to-refresh.visible {
    transform: translateY(0);
}

.ptr-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
}

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

/* ======== CUSTOM DIALOGS ======== */
.dialog-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.dialog-overlay.active {
    opacity: 1;
}

.dialog-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dialog-overlay.active .dialog-box {
    transform: scale(1);
}

.dialog-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.dialog-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.dialog-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    outline: none;
    transition: var(--transition);
}

.dialog-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dialog-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

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

.dialog-btn-cancel {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

.dialog-btn-confirm {
    background: var(--primary);
    color: white;
}

.dialog-btn-danger {
    background: var(--danger);
    color: white;
}

/* ======== HEADER ======== */
.app-header {
    background-color: #000 !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    box-shadow: 0 1px 10px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.user-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    z-index: 200;
}

.user-dropdown.active {
    display: flex;
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropdown-item {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

.dropdown-item.danger {
    color: var(--danger);
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 32px;
}

.logo-container h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Theme Switcher */
.theme-switcher select {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
}

/* ======== MAIN ======== */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ======== CARDS ======== */
.card, .car-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.car-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    position: relative; /* Para o ícone de edição flutuar no card */
}

.car-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.car-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #2d2d2d;
    border-bottom: 1px solid var(--border-color);
}

.car-card-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.car-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.car-card-plate {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: #2d2d2d;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: max-content;
    margin-bottom: 1rem;
}

/* ======== SEARCH BAR OPTIMIZED ======== */
.search-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

.search-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.search-container-optimized {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 0 0.5rem 0 1rem;
    height: 40px;
    width: 300px; /* Largura padrão PC */
    max-width: 400px;
    box-sizing: border-box;
    animation: expandSearch 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Otimização Mobile para o Cabeçalho (v2.4.9) */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .dashboard-header > div {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: space-between !important;
    }

    .filter-group {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .search-wrapper {
        flex: 1;
        justify-content: flex-start;
    }

    .search-container-optimized {
        width: 100% !important;
        max-width: none !important;
        position: relative !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }

    .search-input-optimized {
        width: 100%;
    }

    #btn-open-modal {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
        flex: 0 0 auto;
    }
}

/* ======== APP FOOTER & VERSIONING ======== */
.app-footer {
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.app-version {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: monospace;
    opacity: 0.6;
}

.btn-refresh {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-refresh i {
    font-size: 0.9rem;
    transition: transform 0.5s ease;
}

.btn-refresh:active i {
    transform: rotate(360deg);
}

.btn-refresh.loading i {
    animation: spin 1s linear infinite;
}

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

@keyframes expandSearch {
    from { opacity: 0; transform: scaleX(0.8); transform-origin: right center; }
    to { opacity: 1; transform: scaleX(1); transform-origin: right center; }
}

.search-input-optimized {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    outline: none !important;
    box-shadow: none !important;
    height: 100%;
}

.search-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

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

/* ======== STUCK IN STOCK ======== */
@keyframes amberGlow {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.3); border-color: rgba(245, 158, 11, 0.7); }
    100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
}

.stuck-card {
    border: 2px solid #f59e0b !important;
    animation: amberGlow 2.5s infinite ease-in-out;
    position: relative;
}

.stuck-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f59e0b;
    color: #000;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 900;
    border-radius: 4px;
    z-index: 5;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

/* ======== COMPACT CARD (STOCK) ======== */
.car-card.compact {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0.75rem !important;
    gap: 1rem;
    min-height: 110px;
    overflow: hidden;
}

.car-card.compact .car-card-img {
    width: 110px;
    min-width: 110px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    align-self: stretch;
}

/* Ajuste card maior e fontes no PC (v2.4.3) */
@media (min-width: 769px) {
    .car-card.compact {
        padding: 1rem !important;
        gap: 1.25rem !important;
        min-height: 160px;
    }
    .car-card.compact .car-card-img {
        width: 160px;
        min-width: 160px;
    }
    .car-card.compact .car-card-title {
        font-size: 1.4rem;
        margin-bottom: 5px;
        white-space: normal; /* Permitir quebra em 2 colunas */
    }
    .car-card.compact .car-card-plate {
        font-size: 1rem;
    }
    .car-card.compact .stock-days {
        font-size: 0.95rem !important;
    }
    .car-card.compact .car-card-price {
        font-size: 1.35rem !important;
        white-space: nowrap;
        color: var(--success);
    }
    .car-card.compact .compact-bottom {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-top: 10px;
    }
    .car-card.compact .btn-sell-action {
        width: 100% !important;
        padding: 0.6rem !important;
        font-size: 0.9rem !important;
    }
}

.car-card.compact .car-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    min-width: 0; /* prevent text overflow */
}

/* Top section: name + plate */
.car-card.compact .compact-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.car-card.compact .car-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-card.compact .car-card-plate {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    width: fit-content;
}

/* Bottom section: days then button stacked */
.car-card.compact .compact-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.car-card.compact .stock-days {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.car-card.compact .btn-sell-action {
    width: 100% !important;
    padding: 0.45rem 0.5rem !important;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    text-align: center;
}

.car-card.compact .btn-sell-action:hover {
    background: rgba(34, 197, 94, 0.1) !important;
}

@media (max-width: 380px) {
    .car-card.compact .car-card-img {
        width: 85px;
        min-width: 85px;
    }
    .car-card.compact .car-card-title {
        font-size: 0.9rem;
    }
}
.car-card-info p {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.car-card-info p:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.car-card-info strong {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Status Vendido */
.car-card.sold {
    border: 2px solid var(--success);
}

.car-card.sold .car-card-img {
    filter: grayscale(80%);
    opacity: 0.8;
}

.sold-badge {
    background-color: var(--success) !important;
    color: white !important;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Botão de Editar no Card (Lápis) */
.btn-edit-card {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

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

.btn-edit-card:hover {
    background: var(--primary-color);
    transform: scale(1.15) rotate(10deg);
    border-color: var(--primary-color);
}

/* Tabela de Informações (Visualização) */
.info-table {
    margin-top: 1rem;
}

.info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.info-label {
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 40%;
}

.info-value {
    padding: 12px 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: right;
}

.plate-style {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'monospace';
    letter-spacing: 1px;
    font-weight: 700;
}

/* ======== GRIDS ======== */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Layout de duas colunas no PC (v2.4.2) */
@media (min-width: 769px) {
    .cars-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 1200px;
        margin: 0 auto;
    }
}

.row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1.25rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}
.flex-grow { flex: 2; }
.w-small { flex: 0.5; min-width: 120px; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }

/* ======== INPUTS ======== */
label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 4px;
    width: 100%;
    transition: var(--transition);
}

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

/* ======== BUTTONS ======== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: var(--transition);
}

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

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

.secondary-btn {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.secondary-btn:hover {
    background-color: var(--bg-color);
}

.danger-btn {
    background-color: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

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

.rectangular {
    /* override any special transformations */
    text-transform: none;
    letter-spacing: normal;
}

.text-btn {
    background: transparent !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    box-shadow: none !important;
    text-decoration: underline;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.text-btn:hover {
    color: var(--text-primary) !important;
    background: transparent !important;
}

/* Confirmar Venda / Sell Button override */
.btn-sell-action {
    width: 100%;
    margin-top: auto;
    border-color: var(--success) !important;
    color: var(--success) !important;
    background-color: transparent;
}

.btn-sell-action:hover {
    background-color: var(--success) !important;
    color: white !important;
}

/* ======== DETAILS VIEW ======== */
.details-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

#btn-back {
    padding: 0.5rem 1rem;
}

.car-info-card {
    padding: 2rem;
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.car-photo {
    flex: 1;
    min-width: 300px;
}

.car-photo img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.car-stats {
    flex: 1.5;
    display: flex;
    flex-direction: column;
}

.financial-summary {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.financial-summary > div {
    flex: 1;
    background-color: #2d2d2d;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.expense-total-box h3, .profit-box h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.total-amount {
    font-size: 1.75rem;
    font-weight: 700;
}

.highlight {
    color: var(--success);
}

/* ======== EXPENSES ======== */
.expenses-section {
    padding: 2rem;
}

.expenses-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.expenses-list-container {
    margin-top: 2rem;
}

.expenses-list-container h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.expenses-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
}

.expense-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    gap: 0.5rem;
    transition: box-shadow 0.2s;
}

.expense-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.expense-item-desc {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.expense-item-val {
    color: var(--danger);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ======== MODALS ======== */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--text-primary);
}

#modal-sell-car .row {
    margin-bottom: 1rem;
}

#btn-sell-advertised {
    background-color: rgba(22, 163, 74, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

#btn-sell-advertised:hover {
    background-color: var(--success);
    color: white;
}

#btn-sell-advertised span {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

#btn-sell-advertised strong {
    font-size: 1.25rem;
}

#btn-sell-advertised:hover span,
#btn-sell-advertised:hover strong {
    color: white;
}

@media (max-width: 768px) {
    .car-info-card { flex-direction: column; }
    .financial-summary { flex-direction: column; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .app-header > div { flex-direction: column; gap: 1rem; align-items: stretch; }
    .theme-switcher { flex-direction: column; align-items: stretch; }
    /* Configuração perfeita para formulários lado a lado no celular */
    .form-group.row { 
        flex-wrap: nowrap !important; 
        gap: 0.8rem; 
    }
    .form-group.row .input-field {
        min-width: 0;
    }
    input[type="text"],
    input[type="number"],
    input[type="date"] {
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }
}
