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

:root {
    /* 🔹 NOVAS CORES (Baseadas na sua imagem) */
    --primary-color: #0d5c75;
    /* Azul Profundo (Topo/Sidebar) */
    --primary-hover: #1d7ea3;
    /* Azul Turquesa (Hover/Gradientes) */
    --primary-light: #e0f2fe;

    --secondary-color: #95c044;
    /* Verde Limão (Botões de destaque) */
    --secondary-hover: #7fa836;
    /* Verde um pouco mais escuro para hover */

    /* 🔹 Cores de fundo e texto */
    --background-color: #f8fafc;
    /* Fundo geral claro */
    --sidebar-color: #0d5c75;
    /* Sidebar agora usa o Azul Profundo */
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* 🔹 Cores de feedback (mantidas ou ajustadas) */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* 🔹 Sombras e Bordas (mantidas intactas) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-color);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem 2rem 0.75rem;
}

.logo-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.sidebar-item a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-item.active a {
    background: linear-gradient(135deg, var(--primary-color), #0369a1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.sidebar-user {
    margin-top: auto;
    padding: 1rem 0.75rem 0 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

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

.user-role {
    font-size: 0.75rem;
    color: #38bdf8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-logout {
    background-color: #2d3748;
    /* Cinza azulado escuro */
    color: #ffffff;
    border: 1px solid #2d3748;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    /* Caso queira que o botão ocupe toda a largura disponível */
}

.btn-logout:hover {
    background-color: #1a202c;
    /* Escurece mais no hover */
    border-color: #1a202c;
}

/* Área de Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
}

.page-title p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Cards e Painéis --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
}

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

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.stat-icon.success {
    background-color: #d1fae5;
    color: var(--success-color);
}

.stat-icon.warning {
    background-color: #fef3c7;
    color: var(--warning-color);
}

/* Cartões Padrão */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.card-body {
    padding: 1.5rem;
}

/* --- Tabelas --- */
.table-responsive {
    overflow-x: auto;
}

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

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

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

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

/* Badges / Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-process {
    background-color: #e0f2fe;
    color: #0284c7;
}

.badge-ready {
    background-color: #e0f2fe;
    color: var(--secondary-color);
}

/* Teal */
.badge-delivered {
    background-color: #d1fae5;
    color: var(--success-color);
}

.badge-cancelled {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.badge-role-admin {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.badge-role-manager {
    background-color: #fef3c7;
    color: var(--warning-color);
}

.badge-role-staff {
    background-color: #e0f2fe;
    color: var(--primary-color);
}

/* --- Botões --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background-color: var(--secondary-color);
    /* Agora aponta para o Verde Limão (#95c044) */
    color: #ffffff;
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    /* Verde mais escuro ao passar o mouse */
    border-color: var(--secondary-hover);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-danger {
    background-color: #2d3748;
    /* Cinza Azulado Escuro (Paleta neutra e elegante) */
    color: #ffffff;
    border: 1px solid #2d3748;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #1a202c;
    /* Um tom ainda mais escuro ao passar o mouse */
    border-color: #1a202c;
}

.btn-success {
    background-color: var(--success-color);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

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

/* Alert Notification */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* --- Tela de Login Legada (LavWeb / Decorlave) --- */
.login-page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #00a2e8;
    font-family: 'Outfit', Arial, sans-serif;
}

.login-topbar {
    background-color: #006097;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #005080;
    min-height: 90px;
}

.login-topbar-left img {
    max-height: 70px;
    width: auto;
    display: block;
}

.login-topbar-right {
    text-align: right;
    color: #ffffff;
    line-height: 1.3;
}

.login-topbar-right .subtitle-1 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.login-topbar-right .subtitle-2 {
    font-size: 1.3rem;
    font-weight: bold;
    color: #9cdffd;
}

.login-subbar {
    background-color: #d5d5d5;
    padding: 0.5rem 2rem;
    font-size: 0.85rem;
    font-weight: bold;
    color: #4b6224;
    border-bottom: 1px solid #c0c0c0;
}

.login-main-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-banner-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1296px;
    height: 519px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    overflow: hidden;
    background-color: #00a2e8;
}

.login-left-column {
    width: 648px;
    height: 519px;
    background-image: url('../imagens/fundocima.png');
    background-size: cover;
    background-position: center;
}

.login-right-column {
    width: 648px;
    height: 519px;
    background-image: url('../imagens/fundobaixo.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box-overlay {
    width: 380px;
    background-color: rgba(212, 237, 250, 0.82);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.login-box-overlay .form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.login-box-overlay label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.login-box-overlay .form-control {
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    border-radius: 4px;
    padding: 0.6rem 2.5rem 0.6rem 0.8rem;
    /* Espaço para o ícone de olho */
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-box-overlay .form-control:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #0f172a;
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.btn-login-submit {
    background-color: #ffffff;
    color: #000000;
    border: 1.5px solid #000000;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    padding: 0.65rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-login-submit:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Responsividade do Login */
@media (max-width: 1320px) {
    .login-banner-wrapper {
        max-width: 960px;
        height: 450px;
    }

    .login-left-column,
    .login-right-column {
        width: 480px;
        height: 450px;
    }
}

@media (max-width: 980px) {
    .login-banner-wrapper {
        max-width: 440px;
        height: auto;
    }

    .login-left-column {
        display: none;
    }

    .login-right-column {
        width: 100%;
        height: auto;
        padding: 3rem 1.5rem;
        background-image: none;
        background-color: #00a2e8;
    }

    .login-box-overlay {
        width: 100%;
        background-color: rgba(212, 237, 250, 0.95);
    }
}

@media (max-width: 768px) {
    .login-topbar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }

    .login-topbar-right {
        text-align: center;
    }
}

/* --- Layout da Tela PDV (`pdv.php`) --- */
.pdv-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .pdv-layout {
        grid-template-columns: 1fr;
    }
}

.client-search-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.search-item:hover {
    background-color: #f1f5f9;
}

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

.selected-client-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-light);
    color: var(--primary-hover);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-top: 0.5rem;
}

.service-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem;
}

.service-item-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.service-item-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.service-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.service-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Cupom / Carrinho */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.cart-item-name {
    font-weight: 500;
    color: #1e293b;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

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

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
}

.cart-total-row.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

/* --- Erro e Negados --- */
.error-card {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 500px;
    margin: 4rem auto;
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.card-actions {
    margin-top: 1.5rem;
}

/* --- Impressão (Recibo) --- */
@media print {
    body {
        background-color: #ffffff;
        color: #000000;
    }

    .sidebar,
    .topbar,
    .btn,
    .main-content-header {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .receipt-print {
        width: 100% !important;
        max-width: 80mm !important;
        /* Otimizado para cupom térmico */
        margin: 0 auto;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12px;
        line-height: 1.2;
    }

    .receipt-print .no-print {
        display: none !important;
    }
}