/*
Theme Name: Essenza CRM
Author: Hostinger User
Description: Tema CRM personalizado estilo App Mobile.
Version: 1.0
*/

:root {
    --bg-color: #F8F9FA;
    --card-white: #FFFFFF;
    --text-main: #111111;
    --text-muted: #888888;
    --brand-black: #000000;
    --brand-gold: #FFC107; /* Ajustado para o CRM da imagem */
    --brand-gold-light: #FFF8DC; /* Fundo do card de vendas */
    --success-green: #00A86B;
    --radius: 20px;
    --shadow: 0 4px 20px rgba(0,0,0,0.03);
    --container-width: 800px; /* Limite para parecer app no desktop */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif; /* Vamos carregar no functions */
    color: var(--text-main);
    padding-bottom: 90px; /* Espaço para o menu inferior */
}

/* Container Centralizado */
.app-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER --- */
.app-header {
    background-color: var(--card-white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: black; }
.logo span { color: var(--brand-gold); }

.avatar {
    width: 35px; height: 35px;
    background: #F4E8C1; color: #8B8000;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px;
}

/* --- DASHBOARD --- */
.page-header { margin: 30px 0; }
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 5px; }
.page-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* Grid de Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Colunas como na imagem */
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

/* Estilos Específicos dos Cards */
.card-total { background-color: var(--brand-black); color: white; }
.card-total .label, .card-total .sub { color: rgba(255,255,255,0.7); }
.card-total .value { color: white; }

.card-sales { background-color: var(--brand-gold-light); }

.label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 15px; color: var(--brand-gold); }
.card-total .label { color: var(--brand-gold); } /* Ícone dourado no fundo preto */
.card-sales .label { color: #BFA15F; }

.value { font-size: 1.8rem; font-weight: 800; margin-bottom: 5px; }

.sub { font-size: 0.8rem; color: var(--text-muted); }
.text-green { color: var(--success-green); font-weight: 600; }

/* Gráfico Placeholder */
.chart-section {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    min-height: 200px;
}
.chart-title { font-weight: 700; margin-bottom: 20px; }

/* --- FOOTER MENU --- */
.app-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    padding: 15px 0;
    border-top: 1px solid #eee;
    z-index: 100;
}

.footer-nav {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.nav-item {
    font-size: 1.5rem;
    color: #ccc;
    text-decoration: none;
}
.nav-item.active { color: var(--text-main); }

/* Responsividade Mobile */
@media (max-width: 600px) {
    .kpi-grid {
        grid-template-columns: 1fr; /* 1 Coluna no celular */
    }
}

/* --- BOTÃO FLUTUANTE (FAB) --- */
.fab-btn {
    position: fixed;
    bottom: 10%;
    left: 88%;
    transform: translateX(-60%);
    width: 50px;
    height: 50px;
    background-color: var(--brand-black);
    color: var(--brand-gold);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.fab-btn:active { transform: translateX(-50%) scale(0.9); }

/* --- MODAL (POPUP) --- */
.modal-overlay {
    display: none; /* Escondido por padrão */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* Fundo escuro */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: var(--radius);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.5rem; }
.close-btn { background: none; border: none; font-size: 2rem; cursor: pointer; }

/* --- INPUTS DO FORMULÁRIO --- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }

.input-app {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    background: #f9f9f9;
}
.input-app:focus { border-color: var(--brand-black); outline: none; background: white; }

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--brand-black);
    color: var(--brand-gold);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

/* --- PÁGINA DE PRODUTOS --- */

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-icon-add {
    width: 40px; height: 40px;
    background: var(--brand-black);
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Barra de Pesquisa */
.search-bar {
    background: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    color: var(--text-muted);
}
.search-bar input { border: none; outline: none; width: 100%; font-size: 1rem; }

/* Grid de Produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Colunas (igual ao vídeo) */
    gap: 15px;
    padding-bottom: 20px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.product-card:active { transform: scale(0.98); }

.product-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.product-info { padding: 12px; }

.product-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--brand-gold);
    font-weight: 700;
    display: block; margin-bottom: 4px;
}

.product-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-black);
}

/* Botão de Upload de Foto */
.file-upload-label {
    display: block;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.3s;
}
.file-upload-label:hover { border-color: var(--brand-black); color: var(--brand-black); }



/* --- LISTA DE CLIENTES --- */
.clients-list {
    background: white;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
}

.client-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.client-item:last-child { border-bottom: none; }
.client-item:active { background-color: #f9f9f9; }

.client-avatar {
    width: 50px; height: 50px;
    background-color: #eee;
    color: #666;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    font-size: 1.2rem;
}

.client-info { flex: 1; }
.client-name { font-size: 1rem; margin-bottom: 4px; }
.client-phone { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.client-action { color: #ccc; font-size: 1.5rem; }

/* --- PERFIL DO CLIENTE (SINGLE) --- */
.profile-avatar-lg {
    width: 100px; height: 100px;
    background-color: #eee;
    color: #555;
    border-radius: 50%;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    background-size: cover;
    background-position: center;
    border: 4px solid white;
    box-shadow: var(--shadow);
}

.btn-circle-action {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-black);
    text-decoration: none;
    font-size: 1.2rem;
}

.btn-circle-action.whatsapp { color: #25D366; }

.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-row i { font-size: 1.4rem; color: var(--brand-gold); }
.sub-label { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

.divider { height: 1px; background: #f0f0f0; margin: 15px 0 15px 40px; }




/* --- PÁGINA DE RELATÓRIOS --- */

/* Abas de Filtro */
.filter-tabs {
    display: flex;
    background: #EAEAEA;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 15px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: var(--brand-black);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 700;
}

/* Botão de Download */
.btn-download {
    width: 100%;
    background-color: var(--success-green);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background 0.2s;
}

.btn-download:hover { background-color: #008f5b; }

/* Ajuste para Impressão (Quando clica em Baixar PDF) */
@media print {
    .app-header, .app-footer, .filter-tabs, .btn-download, .fab-btn {
        display: none !important; /* Esconde menu e botões na impressão */
    }
    .app-container { max-width: 100%; }
    body { background: white; }
}



/* --- BOTÃO DE EXCLUIR PRODUTO --- */
.btn-delete-icon {
    position: absolute;
    top: 10px; right: 10px;
    background: white;
    color: #ff4444;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    text-decoration: none;
}

/* --- PÁGINA PERFIL (HERO) --- */
.profile-hero {
    background: var(--brand-black);
    color: white;
    padding: 40px 20px 60px 20px; /* Padding extra embaixo pro card subir */
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
    margin: -30px -20px 0 -20px; /* Quebra margens do container pra encostar no topo */
}

.user-avatar-xl {
    width: 80px; height: 80px;
    background: var(--brand-gold);
    color: var(--brand-black);
    font-size: 2rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px auto;
    border: 4px solid rgba(255,255,255,0.1);
}

.user-role {
    background: rgba(255,255,255,0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #ccc;
}

/* --- LISTA DE CONFIGURAÇÕES --- */
.settings-list {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
}
.settings-item:last-child { border-bottom: none; }

.icon-box {
    width: 40px; height: 40px;
    background: #f4f4f4;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 15px;
    color: var(--brand-black);
    font-size: 1.2rem;
}

.arrow { margin-left: auto; color: #ccc; }

/* --- PRODUTO DETALHES --- */

.size-badge {
    position: absolute;
    bottom: 5px; right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.hero-badge {
    position: absolute;
    bottom: 20px; right: 20px;
    background: var(--brand-black);
    color: var(--brand-gold);
    font-weight: 700;
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.price-tag-lg {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-black);
    background: var(--brand-gold-light);
    padding: 10px 15px;
    border-radius: 12px;
}

.detail-section {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.detail-section h3 { font-size: 1.1rem; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.detail-section p { color: #555; font-size: 0.95rem; line-height: 1.6; }

.olfactory-box {
    background: #fdfdfd;
    border-left: 4px solid var(--brand-gold);
    padding: 15px;
    font-style: italic;
    color: #444;
}

.btn-referral {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    width: 100%;
    padding: 18px;
    background: var(--brand-black);
    color: var(--brand-gold);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.btn-referral:hover { transform: translateY(-2px); }

/* Botões de Ação no Card (Admin) */
.btn-action-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 1rem;
    transition: transform 0.2s;
}
.btn-action-icon:hover { transform: scale(1.1); }

/* Cor Lápis */
.btn-action-icon.edit {
    background: white;
    color: var(--brand-black);
}

/* Cor Lixeira */
.btn-action-icon.delete {
    background: white;
    color: #ff4444;
    text-decoration: none; /* Porque é um link <a> */
}
.btn-download-ficha {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: #ffc107;
    color: #000000;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}
/* Seletor de Status */
.status-selector {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.status-option {
    flex: 1;
    position: relative;
}

.status-option input {
    display: none; /* Esconde a bolinha do radio */
}

.status-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    height: 100%;
}

.status-btn i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* Quando selecionado (Checked) */
.status-option input:checked + .status-btn {
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Cores por Status */
.status-option input:checked + .status-btn.check { background-color: #00A86B; } /* Verde */
.status-option input:checked + .status-btn.delivery { background-color: #FFC107; color:black; } /* Amarelo */
.status-option input:checked + .status-btn.calendar { background-color: #2196F3; } /* Azul */
/* --- COMPONENTE SELECT CUSTOMIZADO --- */
.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.toggle-link {
    font-size: 0.8rem;
    color: var(--brand-gold);
    font-weight: 700;
    cursor: pointer;
}
.toggle-link.cancel-mode { color: #888; font-weight: 400; }

.custom-select-wrapper {
    position: relative;
}

.select-trigger {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
}

.custom-options {
    display: none; /* Escondido por padrão */
    position: absolute;
    top: 105%;
    left: 0; right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 100;
    border: 1px solid #eee;
    overflow: hidden;
}

.search-box {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}
.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.custom-options ul {
    list-style: none;
    padding: 0; margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s;
}
.dropdown-item:hover { background: #f5f5f5; }

.item-img {
    width: 36px; height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
}

.item-info { display: flex; flex-direction: column; }
.item-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.item-sub { font-size: 0.75rem; color: #999; }

.dropdown-loading, .dropdown-empty {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}
/* --- PÁGINA VENDAS: FILTROS E ABAS --- */

/* Scroll Horizontal para Filtros de Tempo */
.time-filters {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 15px;
    margin-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.time-filters::-webkit-scrollbar { display: none; } /* Chrome */

.filter-pill {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: 0.2s;
}
.filter-pill.active {
    background: var(--brand-black);
    color: var(--brand-gold);
    border-color: var(--brand-black);
    font-weight: 600;
}

/* Abas de Status */
.status-tabs-wrapper {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.status-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #999;
    position: relative;
    font-weight: 600;
}

.status-tab.active {
    color: var(--brand-black);
}

.status-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; width: 100%;
    height: 3px;
    background: var(--brand-gold);
}

.filter-summary {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}
.filter-summary span {
    font-weight: 800;
    color: var(--brand-black);
}

/* --- CARTÃO DE VENDA LISTAGEM --- */
.sale-card-item {
    background: white;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    gap: 15px;
    animation: fadeIn 0.3s ease;
}

.sale-icon {
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sale-info { flex: 1; }

.sale-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.sale-client { font-weight: 700; color: #333; font-size: 0.95rem; }
.sale-price { font-weight: 800; color: var(--brand-black); }

.sale-bottom {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: #888;
    margin-bottom: 10px;
}

.sale-footer {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #f5f5f5;
    padding-top: 8px;
}

/* Badges e Cores */
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-success-bg { background: #E8F5E9; color: #2E7D32; }

.badge-warning { background: #FFF8E1; color: #F57F17; }
.badge-warning-bg { background: #FFF8E1; color: #F57F17; }

.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-info-bg { background: #E3F2FD; color: #1565C0; }

.badge-default { background: #eee; color: #666; }

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-cancel-mini {
    background: none; border: none;
    color: #ff4444; cursor: pointer;
    font-size: 0.75rem;
    display: flex; align-items: center; gap: 4px;
    padding: 5px;
}
.btn-cancel-mini:hover { background: #fff0f0; border-radius: 4px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}
.empty-state i { font-size: 3rem; margin-bottom: 10px; display: block; }
/* --- MODAL DE DETALHES (TIPO IFOOD/UBER) --- */

.modal-content-card {
    background: white;
    width: 100%;
    max-width: 400px; /* Largura de celular */
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    margin: 20px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Hero Image (Topo) */
.modal-hero {
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent, rgba(0,0,0,0.1));
}

/* Botão Fechar Flutuante */
.modal-close-floating {
    position: absolute;
    top: 15px; right: 15px;
    background: white;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #333;
}

/* Badge de Status Flutuante */
.modal-status-badge {
    position: absolute;
    bottom: 15px; left: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.bg-green { background: #00C853; }
.bg-blue { background: #2962FF; }
.bg-yellow { background: #FFD600; color: black; }

/* Corpo do Modal */
.modal-body-content {
    padding: 25px;
}

.detail-cat {
    font-size: 0.75rem;
    color: var(--brand-gold);
    font-weight: 800;
    text-transform: uppercase;
    display: block; margin-bottom: 5px;
}

.detail-title {
    font-size: 1.6rem;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.detail-code {
    color: #999;
    font-size: 0.9rem;
    display: block; margin-bottom: 20px;
}

/* Grid de Preço */
.price-grid-box {
    display: flex;
    background: #F8F9FA;
    border-radius: 16px;
    padding: 15px;
    justify-content: space-between;
    margin-bottom: 25px;
}

.price-col { display: flex; flex-direction: column; }
.price-col.center { align-items: center; }
.price-col.right { align-items: flex-end; }

.price-col .lbl { font-size: 0.65rem; color: #888; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.price-col .val { font-size: 1rem; font-weight: 700; color: #333; }
.price-col .val.big { font-size: 1.2rem; }

/* Card Cliente */
.client-card-link {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.client-card-link:hover { background: #f9f9f9; border-color: #ddd; }
.client-card-link.disabled { background: #f5f5f5; opacity: 0.7; pointer-events: none; }

.client-avatar-small {
    width: 40px; height: 40px;
    background: #FFE082; /* Amarelo clarinho */
    color: #F57F17;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    margin-right: 12px;
}

.client-info-small { flex: 1; display: flex; flex-direction: column; }
.client-info-small strong { font-size: 0.95rem; }
.client-info-small span { font-size: 0.8rem; color: #999; margin-top: 2px; }

.arrow-icon { color: #ccc; }

/* Obs Box */
.obs-box {
    background: #FFFDE7; /* Amarelo Post-it bem claro */
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex; gap: 10px;
    border: 1px solid #FFF59D;
}
.obs-box i { color: #FBC02D; font-size: 1.2rem; }
.obs-box strong { font-size: 0.75rem; color: #F9A825; display: block; margin-bottom: 3px; }
.obs-box p { font-size: 0.9rem; color: #555; margin: 0; line-height: 1.4; }

.detail-divider { border: 0; border-top: 1px solid #eee; margin: 20px 0; }

.detail-footer-date {
    text-align: center;
    color: #ccc;
    font-size: 0.8rem;
    margin-top: 25px;
}

/* --- MODAL DE DETALHES (RESPONSIVO COM SCROLL INTERNO) --- */

/* O Fundo Escuro */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center; /* Centraliza verticalmente */
    justify-content: center; /* Centraliza horizontalmente */
    backdrop-filter: blur(5px);
    padding: 20px; /* Margem de segurança para não colar na borda do celular */
}

/* O Cartão Branco */
.modal-content-card {
    background: white;
    width: 100%;
    max-width: 380px; /* Largura ideal de celular */
    
    /* --- SEGREDO DO SCROLL INTERNO --- */
    max-height: 85vh; /* Ocupa no máximo 85% da altura da tela */
    display: flex;    /* Transforma o cartão num container flexível */
    flex-direction: column; /* Organiza itens um embaixo do outro */
    
    border-radius: 24px;
    overflow: hidden; /* Garante que nada saia das bordas arredondadas */
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: zoomIn 0.3s ease;
    position: relative;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 1. TOPO (IMAGEM) - NÃO ROLA */
.modal-hero {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0; /* Impede que a imagem encolha */
}

.modal-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent, rgba(0,0,0,0.1));
}

/* Botão Fechar */
.modal-close-floating {
    position: absolute;
    top: 15px; right: 15px;
    background: white;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #333;
    transition: transform 0.2s;
}
.modal-close-floating:active { transform: scale(0.9); }

/* Badge de Status */
.modal-status-badge {
    position: absolute;
    bottom: 15px; left: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 800;
    font-size: 0.7rem;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bg-green { background: #00C853; }
.bg-blue { background: #2962FF; }
.bg-yellow { background: #FFD600; color: black; }

/* 2. CORPO (TEXTO) - ESTE ROLA (SCROLL) */
.modal-body-content {
    padding: 25px;
    overflow-y: auto; /* Ativa o scroll vertical APENAS aqui */
    flex-grow: 1;     /* Ocupa todo o espaço restante */
    
    /* Estilo da barra de rolagem (Fica bonita no Chrome/Android) */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

/* Estilo Scrollbar Webkit */
.modal-body-content::-webkit-scrollbar { width: 6px; }
.modal-body-content::-webkit-scrollbar-track { background: transparent; }
.modal-body-content::-webkit-scrollbar-thumb { background-color: #ddd; border-radius: 20px; }

/* Tipografia e Elementos Internos */
.detail-cat {
    font-size: 0.7rem; color: var(--brand-gold); font-weight: 800;
    text-transform: uppercase; display: block; margin-bottom: 5px;
}

.detail-title {
    font-size: 1.5rem; margin: 0 0 5px 0; line-height: 1.2; color: #111;
}

.detail-code { color: #999; font-size: 0.85rem; display: block; margin-bottom: 20px; }

/* Grid de Preço */
.price-grid-box {
    display: flex;
    background: #F8F9FA;
    border-radius: 16px;
    padding: 15px;
    justify-content: space-between;
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}

.price-col { display: flex; flex-direction: column; }
.price-col.center { align-items: center; }
.price-col.right { align-items: flex-end; }
.price-col .lbl { font-size: 0.6rem; color: #888; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.price-col .val { font-size: 0.95rem; font-weight: 700; color: #333; }
.price-col .val.big { font-size: 1.2rem; }

/* Card Cliente */
.client-card-link {
    display: flex; align-items: center; padding: 12px;
    border: 1px solid #eee; border-radius: 12px;
    text-decoration: none; color: inherit; transition: background 0.2s;
}
.client-card-link:hover { background: #f9f9f9; border-color: #ddd; }

.client-avatar-small {
    width: 36px; height: 36px;
    background: #FFF8E1; color: #FFB300;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; margin-right: 12px; font-size: 0.9rem;
}

.client-info-small { flex: 1; display: flex; flex-direction: column; }
.client-info-small strong { font-size: 0.9rem; }
.client-info-small span { font-size: 0.75rem; color: #999; margin-top: 2px; }

/* Obs Box */
.obs-box {
    background: #FFFDE7; padding: 12px; border-radius: 12px;
    margin-bottom: 20px; display: flex; gap: 10px; border: 1px solid #FFF59D;
}
.obs-box i { color: #FBC02D; font-size: 1.1rem; }
.obs-box strong { font-size: 0.7rem; color: #F9A825; display: block; margin-bottom: 2px; }
.obs-box p { font-size: 0.85rem; color: #555; margin: 0; line-height: 1.4; }

.detail-divider { border: 0; border-top: 1px solid #f0f0f0; margin: 20px 0; }
.detail-footer-date { text-align: center; color: #ccc; font-size: 0.75rem; margin-top: 15px; }

/* --- RESPONSIVIDADE EXTREMA (Celulares Pequenos) --- */
@media (max-height: 600px) {
    .modal-hero { height: 140px; } /* Diminui a foto se a tela for muito baixa */
    .detail-title { font-size: 1.3rem; }
}
/* --- MODAL DE STATUS --- */
.status-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-status-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    color: white;
}

.btn-status-option:active { transform: scale(0.98); }
.btn-status-option i { font-size: 1.2rem; }

/* Cores Específicas */
.btn-status-option.green { background-color: #00C853; box-shadow: 0 4px 10px rgba(0,200,83,0.3); }
.btn-status-option.blue { background-color: #2962FF; box-shadow: 0 4px 10px rgba(41,98,255,0.3); }
.btn-status-option.yellow { background-color: #FFD600; color: black; box-shadow: 0 4px 10px rgba(255,214,0,0.3); }

.btn-cancel-text {
    background: none; border: none;
    width: 100%;
    padding: 15px;
    color: #999;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 5px;
}

/* Ajuste no Badge do Modal de Detalhes para parecer clicável */
.modal-status-badge {
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    display: flex; align-items: center;
}
.modal-status-badge:active { transform: scale(0.9); }