/* styles.css - Folha de estilo premium Rose Gold & Cream para Nailly */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #d99a8c;
    --primary-light: #f5eae6;
    --primary-dark: #b87567;
    --secondary: #3d3130;
    --accent: #d4af37; /* Metallic Gold */
    --accent-light: #f7eec8;
    
    --bg-base: #faf8f5;
    --bg-card: #ffffff;
    --bg-dark-card: #2d2423;
    
    --text-main: #332928;
    --text-muted: #807270;
    --text-light: #ffffff;
    
    --border: #ece6e4;
    --border-hover: #d9cac7;
    
    --success: #52a478;
    --success-light: #e6f4ed;
    --warning: #dfa03a;
    --warning-light: #fdf5e7;
    --danger: #cf6666;
    --danger-light: #fbebeb;
    
    --shadow-sm: 0 2px 8px rgba(61, 49, 48, 0.04);
    --shadow-md: 0 8px 24px rgba(61, 49, 48, 0.08);
    --shadow-lg: 0 16px 40px rgba(61, 49, 48, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-inter);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-outfit);
    font-weight: 600;
    color: var(--secondary);
}

/* Layout Estrutural */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar para Desktop */
.sidebar {
    width: 280px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.25rem;
    font-family: var(--font-outfit);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(217, 154, 140, 0.3);
}

.logo-text {
    font-size: 1.5rem;
    font-family: var(--font-outfit);
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-outfit);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.nav-item a svg {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
    transition: var(--transition);
}

.nav-item.active a,
.nav-item a:hover {
    color: var(--primary-dark);
    background-color: var(--primary-light);
}

.nav-item.active a svg,
.nav-item a:hover svg {
    stroke: var(--primary-dark);
    transform: scale(1.1);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.profile-name {
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Área de Conteúdo Principal */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
    background-color: var(--bg-base);
    min-height: 100vh;
    transition: var(--transition);
}

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

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

/* Cabeçalho da Página */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
}

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

/* Botões Customizados */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-light);
    box-shadow: 0 4px 16px rgba(217, 154, 140, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(217, 154, 140, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-light);
}

.btn-success:hover {
    background-color: #438f67;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Dashboard Home */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.revenue {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.stat-icon.appts {
    background-color: var(--accent-light);
    color: var(--accent);
}

.stat-icon.reminders {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-icon.clients {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-outfit);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Duas Colunas do Dashboard */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title-bar h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--secondary);
}

/* Tabela e Listas Premium */
.custom-table-container {
    overflow-x: auto;
}

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

.custom-table th {
    font-family: var(--font-outfit);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.custom-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

.custom-table tr:hover td {
    background-color: #faf9f7;
}

/* Status Tags */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-tag.scheduled {
    background-color: var(--accent-light);
    color: #967414;
}

.status-tag.confirmed {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.status-tag.completed {
    background-color: var(--success-light);
    color: var(--success);
}

.status-tag.cancelled {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Recorrência Status Tags (Clientes) */
.recurrence-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.recurrence-badge.ok {
    background-color: var(--success-light);
    color: var(--success);
}

.recurrence-badge.alerta {
    background-color: var(--warning-light);
    color: var(--warning);
}

.recurrence-badge.atrasado {
    background-color: var(--danger-light);
    color: var(--danger);
}

.recurrence-badge.sem_historico {
    background-color: #eee;
    color: #666;
}

/* Lista de Remembras de Manutenção */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-base);
    transition: var(--transition);
}

.reminder-item:hover {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.reminder-client {
    display: flex;
    flex-direction: column;
}

.reminder-client-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.reminder-client-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reminder-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.reminder-status-dot.atrasado { background-color: var(--danger); }
.reminder-status-dot.alerta { background-color: var(--warning); }

/* Calendário View */
.calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-header-day {
    text-align: center;
    font-weight: 600;
    font-family: var(--font-outfit);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.calendar-day {
    min-height: 90px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.calendar-day.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    border: 2px solid var(--primary-dark);
    background-color: #faf6f5;
}

.calendar-day-num {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-outfit);
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    overflow-y: auto;
}

.calendar-event {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.scheduled { background-color: var(--accent-light); color: #967414; }
.calendar-event.confirmed { background-color: var(--primary-light); color: var(--primary-dark); }
.calendar-event.completed { background-color: var(--success-light); color: var(--success); }

/* Financeiro: Gráficos */
.finance-summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.finance-chart-container {
    height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: flex-end;
    width: 40px;
}

.chart-bar {
    width: 24px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(to top, var(--primary-dark), var(--primary));
    min-height: 4px;
}

.chart-bar.despesa {
    background: linear-gradient(to top, #cf6666, #e69d9d);
}

.chart-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.finance-kpis {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kpi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-title svg {
    width: 18px;
    height: 18px;
}

.kpi-value {
    font-family: var(--font-outfit);
    font-size: 1.25rem;
    font-weight: 700;
}

.kpi-value.receitas { color: var(--success); }
.kpi-value.despesas { color: var(--danger); }
.kpi-value.lucro { color: var(--secondary); }

/* Recibos View */
.receipt-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.receipt-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-base);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 450px;
}

.receipt-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    position: relative;
    border: 1px solid var(--border);
    background-image: 
        radial-gradient(circle at 0% 50%, transparent 12px, var(--bg-card) 12px),
        radial-gradient(circle at 100% 50%, transparent 12px, var(--bg-card) 12px);
    background-position: left, right;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.receipt-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    border-bottom: 2px dashed var(--border);
    transform: translateY(-50%);
}

.receipt-top {
    text-align: center;
    margin-bottom: 3.5rem;
}

.receipt-logo {
    font-family: var(--font-outfit);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.receipt-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.receipt-bottom {
    margin-top: 3.5rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.receipt-row.total {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.receipt-row.total .receipt-val {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.receipt-lbl {
    color: var(--text-muted);
}

.receipt-val {
    font-weight: 600;
    color: var(--secondary);
}

.receipt-barcode {
    height: 40px;
    background: linear-gradient(90deg, 
        #000 2px, transparent 2px, 
        #000 6px, transparent 6px, 
        #000 7px, transparent 7px, 
        #000 12px, transparent 12px, 
        #000 14px, transparent 14px, 
        #000 17px, transparent 17px, 
        #000 22px, transparent 22px
    );
    background-size: 35px 100%;
    opacity: 0.15;
    margin-top: 2rem;
    text-align: center;
}

.receipt-date {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(61, 49, 48, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    padding: 2.25rem;
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

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

/* Formulários */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-outfit);
    color: var(--secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-inter);
    font-size: 0.95rem;
    background-color: var(--bg-base);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-light);
}

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

/* Barra de Pesquisa e Filtros */
.filter-bar {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding-left: 2.75rem;
}

/* Menu Mobile */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    height: 70px;
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-outfit);
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-item.active {
    color: var(--primary-dark);
}

.mobile-nav-item.active svg {
    stroke: var(--primary-dark);
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos de Impressão */
@media print {
    body * {
        visibility: hidden;
    }
    .receipt-preview-container, 
    .receipt-preview-container .receipt-card, 
    .receipt-preview-container .receipt-card * {
        visibility: visible;
    }
    .receipt-preview-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        background: transparent;
        padding: 0;
    }
    .receipt-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Responsividade Geral */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .receipt-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .mobile-nav-bar {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem 1.5rem 90px 1.5rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-actions {
        width: 100%;
    }
    .header-actions button {
        flex-grow: 1;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    .stat-value {
        font-size: 1.35rem;
    }
    .filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    .search-input-wrapper {
        max-width: 100%;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .finance-summary-grid {
        grid-template-columns: 1fr;
    }
}
