/*
|--------------------------------------------------------------------------
| ARQUIVO DE ESTILO PRINCIPAL (style.css)
|--------------------------------------------------------------------------
|
| Este arquivo centraliza todos os estilos do sistema.
| Ele está organizado em:
| 1. Blocos Principais: Estilos globais e componentes reutilizáveis.
| 2. Blocos de Módulos: Estilos específicos para cada página/módulo.
|
*/


/*
|--------------------------------------------------------------------------
| BLOCOS PRINCIPAIS
|--------------------------------------------------------------------------
*/

/* ### INICIO BLOCO PRINCIPAL: GLOBAIS E VARIÁVEIS (:root) ### */
:root {
    font-size: 14px;
    --primary-color: #3498db;
    --primary-color-darker: #2980b9;
    --secondary-color: #95a5a6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-gray: #f8f9fa;
    --dark-blue: #2c3e50;
    --text-color: #343a40;
    --border-color: #ddd;
    --whatsapp-color: #25D366;
    
    --danger-color-background: #fdeded;
    --success-color-background: #eaf8f0;
    --info-color-background: #e3f2fd;

    --button-height: 38px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-gray);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open, body.menu-open {
    overflow: hidden;
}

.content-container {
    max-width: 1300px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    flex-grow: 1;
    width: 100%;
}
/* ### FIM BLOCO PRINCIPAL: GLOBAIS E VARIÁVEIS (:root) ### */


/* ### INICIO BLOCO PRINCIPAL: COMPONENTES GERAIS (Botões, Formulários, Títulos) ### */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    color: var(--dark-blue);
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.page-title i {
    margin-right: .8rem;
    color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    height: var(--button-height);
    line-height: normal;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-color-darker); }
.btn-secondary { background-color: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background-color: #7f8c8d; }
.btn-success { background-color: var(--success-color); color: #fff; }
.btn-success:hover { background-color: #27ae60; }
.btn-block { width: 100%; }
.btn i { margin-right:.5rem; }

.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fff;
    height: var(--button-height);
    box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, .2);
}

.message-box {
    text-align: center;
    padding: 2.5rem 1rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid transparent;
    background-color: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .06);
}
.message-box i { font-size: 2.8rem; margin-bottom: 1.2rem; display: block; }
.message-box p { font-size: 1.15rem; margin: 0; line-height: 1.7; }
.empty-message { border-color: #eee; color: #7f8c8d; }
.empty-message i { color: #95a5a6; }
.error-message { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.error-message i { color: #721c24; }

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* ### FIM BLOCO PRINCIPAL: COMPONENTES GERAIS ### */


/* ### INICIO BLOCO PRINCIPAL: MENU DE NAVEGAÇÃO ### */
.menu-container {
    background-color: var(--dark-blue);
    color: #fff;
    padding: .75rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.menu-wrapper { display: flex; justify-content: space-between; align-items: center; max-width: 1300px; margin: 0 auto; }
.logo img { vertical-align: middle; max-height: 40px; width: auto; }
.menu-toggle { display: none; background: transparent; border: none; color: #fff; font-size: 1.75rem; cursor: pointer; padding: .5rem; }
.nav-menu { display: flex; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-menu li { margin-left: 1.5rem; }
.nav-menu a { color: #ecf0f1; text-decoration: none; padding: .5rem 0; transition: color .3s ease; font-weight: 500; display: flex; align-items: center; }
.nav-menu a:hover, .nav-menu a:focus { color: var(--primary-color); outline: 0; }
.nav-menu a i { margin-right: .6rem; }
.nav-menu a.logout { background-color: var(--danger-color); color: #fff !important; padding: .4rem .8rem !important; border-radius: 4px; transition: background-color .3s; }
.nav-menu a.logout:hover { background-color: #c0392b; }
.nav-menu a i, .nav-menu button i { margin-right: 0.6rem; width: 1.25rem; text-align: center; }
.nav-menu a.active { color: var(--primary-color) !important; font-weight: bold; }
.has-dropdown { position: relative; }
.dropdown-toggle {
    background: transparent; border: none; padding: 0; margin: 0;
    display: flex; align-items: center; width: 100%;
    font-family: inherit; font-size: inherit; color: inherit;
    cursor: pointer; text-align: left;
}
.dropdown-arrow { font-size: 0.7em; margin-left: 0.5rem; transition: transform 0.3s ease; }
.has-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background-color: #343a40; padding: 0.5rem 0; margin: 0.2rem 0 0;
    list-style: none; border-radius: 4px; min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); z-index: 1010;
}
.has-dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu li a { padding: 0.6rem 1.2rem !important; display: block; white-space: nowrap; color: #f8f9fa; }
.dropdown-menu li a:hover { background-color: rgba(255, 255, 255, 0.08); }

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-menu { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background-color: #314458; z-index: 1000; padding: 0; box-shadow: 0 5px 10px rgba(0, 0, 0, .1); border-top: 1px solid rgba(255, 255, 255, .1); }
    .nav-menu.active { display: flex; }
    .nav-menu li { margin: 0; width: 100%; }
    .nav-menu li a { padding: .9rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, .05); justify-content: flex-start; }
    .nav-menu li:last-child a { border-bottom: none; }
    .nav-menu a.logout { padding: .9rem 1.5rem !important; margin: .5rem 0; border-radius: 0; background-color: transparent !important; color: var(--danger-color) !important; font-weight: 600 }
    .nav-menu a.logout:hover { background-color: rgba(231, 76, 60, .1) !important }
    .dropdown-menu {
        position: static; width: 100%; box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2); padding: 0.5rem 0 0.5rem 2rem;
        margin-top: 0; border-radius: 0; border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
}
/* ### FIM BLOCO PRINCIPAL: MENU DE NAVEGAÇÃO ### */


/* ### INICIO BLOCO PRINCIPAL: MODAIS ### */
.modal {
    display: none; position: fixed; z-index: 1050;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    justify-content: center; align-items: center;
    padding: 2rem 1rem; overflow-y: auto;
}
.modal-content {
    background-color: #fff; margin: 5% auto; padding: 0; border-radius: 8px;
    width: 90%; max-width: 850px; position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .15); animation: fadeInModal .3s ease-out;
    display: flex; flex-direction: column;
}
.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.6rem; color: var(--dark-blue); font-weight: 600; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal .close { font-size: 2.2rem; font-weight: 300; line-height: 1; cursor: pointer; color: #aaa; transition: color .3s, transform .2s; padding: 0 .5rem; background: 0 0; border: none; }
.modal .close:hover { color: var(--danger-color); transform: scale(1.1); }
@keyframes fadeInModal { 0% { opacity: 0; transform: translateY(-20px) } to { opacity: 1; transform: translateY(0) } }

@media (max-width: 768px) {
    .modal-content { width: 95%; padding: 0; }
    .modal-body { padding: 1.2rem; }
}
/* ### FIM BLOCO PRINCIPAL: MODAIS ### */


/*
|--------------------------------------------------------------------------
| BLOCOS DE MÓDULOS
|--------------------------------------------------------------------------
*/

/* ### INICIO MÓDULO: LOGIN E RESET DE SENHA ### */
.login-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 2rem); width: 100%; }
.login-logo { max-width: 250px; margin-bottom: 2rem; }
.login-container { background-color: #fff; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); padding: 2rem; width: 100%; max-width: 400px; }
.login-title { color: var(--dark-blue); font-size: 1.5rem; margin: 0 0 1.5rem 0; text-align: center; font-weight: 600; }
.login-error { background-color: var(--danger-color-background); color: var(--danger-color); border: 1px solid var(--danger-color); border-radius: 6px; padding: 0.8rem 1rem; margin-bottom: 1.5rem; font-size: 0.9rem; text-align: center; display: flex; align-items: center; justify-content: center; }
.login-error i { margin-right: 0.5rem; }
.login-links { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.login-links a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
.login-links a:hover { color: var(--primary-color-darker); text-decoration: underline; }
.password-toggle { position: absolute; top: calc(var(--button-height) / 2 + 12px); right: 12px; transform: translateY(-50%); cursor: pointer; color: #95a5a6; transition: color 0.2s; }
.password-toggle:hover { color: var(--primary-color); }
/* ### FIM MÓDULO: LOGIN E RESET DE SENHA ### */


/* ### INICIO MÓDULO: PAINEL DE CONTROLE ### */
.control-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.5rem; }
.panel-card {
    background-color: #fff; border-radius: 8px; padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); border: 1px solid #e0e0e0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; text-decoration: none; color: var(--dark-blue);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    aspect-ratio: 1 / 1;
}
.panel-card:hover, .panel-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.2);
    color: var(--primary-color);
    outline: none;
}
.panel-card .card-icon { font-size: 2.8rem; margin-bottom: 1rem; line-height: 1; }
.panel-card .card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }

@media (max-width: 768px) {
    .control-panel-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
    .panel-card { padding: 1rem; }
    .panel-card .card-icon { font-size: 2.2rem; }
    .panel-card .card-title { font-size: 0.85rem; }
}
/* ### FIM MÓDULO: PAINEL DE CONTROLE ### */


/* ### INICIO MÓDULO: CLIENTES (LISTAGEM E FILTROS) ### */
.filtros-container { background-color: #fff; border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,.06); padding: 1.5rem 2rem; margin-bottom: 2rem; }
.filtros-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 1.5rem; align-items: end; }
.buttons-group { display:flex; gap:.75rem; align-items:center; grid-column:1 / -1; margin-top:1rem; flex-wrap:wrap; }
.registros-count { display:inline-flex; align-items:center; padding:0 1.2rem; margin-left:auto; background-color:#e9ecef; border:1px solid #ced4da; border-radius:6px; font-size:.9rem; font-weight:600; color:#495057; white-space:nowrap; height:var(--button-height); box-sizing:border-box; }
.registros-count i { margin-right:.5rem; color:#6c757d; }
.table-responsive { overflow-x:auto; background-color:#fff; border-radius:8px; box-shadow:0 3px 12px rgba(0,0,0,.06); }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
thead { border-bottom:2px solid #dee2e6; }
th, td { padding:1rem 1.1rem; text-align:left; border-bottom:1px solid #eee; vertical-align:middle; white-space:nowrap; }
th.wrap, td.wrap { white-space:normal; }
th { background-color:var(--light-gray); font-weight:600; color:var(--dark-blue); }
tbody tr:hover { background-color:#f1f3f5; }
.actions-cell { text-align:right; white-space:nowrap; padding-right:.5rem; }
.action-icon { display:inline-block; color:#777; margin:0 .2rem; font-size:1.1rem; cursor:pointer; transition:color .2s ease,transform .2s ease; text-decoration:none; padding:.5rem; line-height:1; vertical-align:middle; border-radius:4px; background-color:transparent; }
.action-icon:hover:not(.disabled) { transform:scale(1.15); background-color:rgba(0,0,0,.05); }
.action-icon.disabled { color:#ccc!important; cursor:not-allowed; opacity:.6; }
.action-icon.details-icon:hover:not(.disabled) { color:var(--primary-color); }
.action-icon.block-icon:hover:not(.disabled) { color:var(--danger-color); }
.action-icon.unblock-icon:hover:not(.disabled) { color:var(--success-color); }
.action-icon.edit-icon:hover:not(.disabled) { color:var(--warning-color); }
.block-icon.blocked { color: var(--danger-color); }
.unblock-icon.active { color: var(--success-color); }
td a[href*="wa.me"] { color:#333; text-decoration:none; display:inline-flex; align-items:center; transition:color .2s; }
td a[href*="wa.me"]:hover { color:var(--whatsapp-color); }
td a[href*="wa.me"] i.fa-whatsapp { color:var(--whatsapp-color); font-size:1.1em; margin-right:.4rem; }
.pagination { display:flex; justify-content:center; align-items:center; margin:2.5rem 0; flex-wrap:wrap; gap:.4rem; padding-bottom:2rem; }
.pagination a,.pagination span { padding:.6rem .9rem; border-radius:4px; text-decoration:none; min-width:2.8rem; text-align:center; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--border-color); font-size:.9rem; transition:all .2s; background-color:#fff; color:var(--primary-color); }
.pagination a:hover { background-color:#e9ecef; border-color:#adb5bd; }
.pagination span.current { background-color:var(--primary-color); color:#fff; border-color:var(--primary-color); font-weight:700; z-index:2; }
.pagination span.disabled { opacity:.5; pointer-events:none; }
.pagination span.ellipsis { background:0 0; border:none; color:#6c757d; }
.pagination-summary { font-size:.9em; color:#6c757d; text-align:center; margin-top:-1.5rem; padding-bottom:2rem; }

/* Estilos específicos para o Modal de Clientes */
.modal-foto-wrapper { text-align: center; margin-bottom: 1.8rem; }
.modal-foto-wrapper img { display: block; margin: 0 auto; border-radius: 50%; width: 130px; height: 130px; object-fit: cover; border: 4px solid #eee; box-shadow: 0 3px 8px rgba(0,0,0,.1); background-color: #f0f0f0; cursor: pointer; }
.modal-foto-wrapper .fa-user-circle { font-size: 130px; color: #ccc; }
.modal-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-info { display:flex; align-items:baseline; font-size:1rem; padding-bottom: .8rem; border-bottom: 1px dotted #eee; }
.modal-info strong { min-width:120px; color:#555; font-weight:600; margin-right:.8rem; flex-shrink:0; display:inline-flex; align-items:center; }
.modal-info strong i { margin-right:.7rem; color:var(--primary-color); width:20px; text-align:center; font-size:1em; }
.modal-info span { word-break:break-word; color:#333; }
.modal-tabs { display: flex; border-bottom: 1px solid #dee2e6; background-color: #f8f9fa; padding: 0 1.5rem; }
.tab-link { padding: 1rem 1.2rem; cursor: pointer; border: none; background: none; font-size: 1rem; font-weight: 600; color: #6c757d; transition: all 0.2s ease-in-out; border-bottom: 3px solid transparent; }
.tab-link:hover { color: var(--dark-blue); }
.tab-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { /*display: none;*/ padding-top: 1rem;}
.tab-content.active { display: block; animation: fadeInTab 0.4s; }
@keyframes fadeInTab { from { opacity: 0; } to { opacity: 1; } }
.edit-layout { display: flex; gap: 2rem; flex-wrap: wrap; }
.edit-foto-section { flex: 1 1 150px; text-align: center; min-width: 150px; }
.edit-foto-section img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #eee; cursor: pointer; margin: 0 auto; }
.edit-foto-section .fa-user-circle { font-size: 120px; color: #ccc; }
.edit-foto-section button { margin-top: 1rem; }
.edit-form-section { flex: 2 1 300px; min-width: 300px; }
.info-facial { background-color: #eaf5ff; border: 1px solid #bde0ff; border-radius: 6px; padding: 0.8rem; font-size: 0.85em; margin-top: 1rem; color: #004085; }
.info-facial i { margin-right: 0.5rem; }

/* Responsividade específica do Módulo Clientes */
@media (max-width:768px) {
    .table-responsive { background:0 0; box-shadow:none; }
    table,tbody,thead,tr { display:block; }
    thead { display:none; }
    tr { background-color:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,.07); margin-bottom:1.5rem; padding:1.2rem; }
    td { display:flex; justify-content:space-between; align-items:center; border:none; border-bottom:1px dashed #eee; padding:.8rem 0; text-align:right; white-space:normal; }
    td:last-child { border-bottom:none; }
    td::before { content:attr(data-label); font-weight:600; color:var(--dark-blue); text-align:left; margin-right:1rem; }
    .actions-cell::before { display:none; }
    .modal-info-grid { grid-template-columns:1fr; }
    .edit-layout { flex-direction: column; align-items: center; }
    .edit-form-section { width: 100%; }
}
/* ### FIM MÓDULO: CLIENTES (LISTAGEM E FILTROS) ### */
