/* Arquivo codificado em UTF-8 */

/* ==========================================================================
   1. VARIÁVEIS GLOBAIS E RESET
   ========================================================================== */

:root {
    /* Paleta de Cores */
    --color-primary: #ff7f27;
    --color-primary-dark: #e66d1f;
    --color-success: #4caf50;
    --color-success-dark: #43a047;
    --color-danger: #e53935;
    --color-danger-dark: #c62828;
    --color-warning: #ff9800;
    --color-warning-dark: #f57c00;
    --color-info: #2196F3;
    --color-info-dark: #1976D2;
    --color-secondary: #607d8b;
    --color-secondary-dark: #546E7A;
    --color-purple: #9C27B0;
    --color-purple-dark: #7B1FA2;
    --color-teal: #009688;

    /* Cores de Texto e Fundo */
    --color-text: #333;
    --color-text-muted: #666;
    --color-white: #fff;
    --color-black: #000;
    --color-bg: #f5f5f5;
    --color-bg-light: #fafafa;
    --color-border: #ddd;
    --color-bg-light-purple: #f3e5f5;


    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.18);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.22);

    /* Bordas */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
}

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

html {
    overscroll-behavior-y: contain;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    color: var(--color-text);
}

/* ==========================================================================
   2. CLASSES DE COMPONENTES BASE (OS "MARCADORES")
   ========================================================================== */

/* --- Cabeçalho --- */
.main-header {
    color: var(--color-white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    padding: 18px 15px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 28px;
    width: 28px;
    vertical-align: middle;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.header-title {
    vertical-align: middle;
}

/* --- Botões --- */
.btn {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Botões do Topo (Voltar/Sair) --- */
.btn-top {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    width: 42px;
    height: 42px;
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-top.voltar {
    left: 15px;
    font-size: 28px;
}

.btn-top.sair {
    right: 15px;
}

/* --- Cards --- */
.card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 25px;
}

/* --- Tags de Status --- */
.status-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

/* --- Formulários --- */
.form-input {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    font-size: 15px;
    background-color: var(--color-white);
    font-family: 'Segoe UI', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 3px rgba(255, 127, 39, 0.4);
}

/* --- Tabelas --- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.table th,
.table td {
    border-bottom: 1px solid var(--color-border);
    padding: 12px 10px;
    text-align: left;
}

.table th {
    color: var(--color-white);
    font-weight: 600;
}

.table tr:hover {
    background-color: #f9f9f9;
}

/* --- Chips --- */
.chip {
    background-color: #e0e0e0;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 14px;
    color: var(--color-text);
}

/* ==========================================================================
   3. CLASSES DE UTILIDADE (ATÔMICAS)
   ========================================================================== */

/* --- Cores de Fundo --- */
.bg-primary {
    background-color: var(--color-primary);
}

.bg-success {
    background-color: var(--color-success);
}

.bg-danger {
    background-color: var(--color-danger);
}

.bg-warning {
    background-color: var(--color-warning);
}

.bg-info {
    background-color: var(--color-info);
}

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

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

.bg-purple {
    background-color: var(--color-purple);
}

.bg-teal {
    background-color: var(--color-teal);
}

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

.bg-light {
    background-color: var(--color-bg-light);
}

.bg-light-green {
    background-color: #e8f5e9;
}

.bg-light-yellow {
    background-color: #fffbe6;
}

.bg-danger\/10 {
    background-color: rgba(229, 57, 53, 0.1);
}

.bg-light-purple {
    background-color: var(--color-bg-light-purple);
}



.bg-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
}

.bg-success:hover:not(:disabled) {
    background-color: var(--color-success-dark);
}

.bg-danger:hover:not(:disabled) {
    background-color: var(--color-danger-dark);
}

.bg-warning:hover:not(:disabled) {
    background-color: var(--color-warning-dark);
}

.bg-info:hover:not(:disabled) {
    background-color: var(--color-info-dark);
}

.bg-secondary:hover:not(:disabled) {
    background-color: var(--color-secondary-dark);
}


/* --- Cores de Texto --- */
.text-primary {
    color: var(--color-primary);
}

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

.text-success-dark {
    color: var(--color-success-dark);
}

.text-danger {
    color: var(--color-danger);
}

.text-danger-dark {
    color: var(--color-danger-dark);
}

.text-warning-dark {
    color: var(--color-warning-dark);
}

.text-info-dark {
    color: var(--color-info-dark);
}

.text-info {
    color: var(--color-info);
}

.text-white {
    color: var(--color-white);
}

.text-black {
    color: var(--color-black);
}

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

.text-purple-dark {
    color: var(--color-purple-dark);
}

/* --- Tipografia --- */
.text-sm {
    font-size: 14px;
}

.text-base {
    font-size: 16px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 22px;
}

.text-2xl {
    font-size: 24px;
}

.text-5xl {
    font-size: 2.25rem;
}

.text-10xl {
    font-size: 40px;
}

.font-bold {
    font-weight: bold;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: 'Courier New', Courier, monospace;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
}

.no-underline {
    text-decoration: none;
}

.line-through {
    text-decoration: line-through;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Layout (Display, Flex, Grid) --- */
.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.flex-col {
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 10px;
}

.gap-3 {
    gap: 15px;
}

.gap-4 {
    gap: 20px;
}

.gap-5 {
    gap: 25px;
}

/* --- Espaçamento (Padding & Margin) --- */
.p-0 {
    padding: 0;
}

.p-1 {
    padding: 8px;
}

.p-2 {
    padding: 12px;
}

.p-3 {
    padding: 15px;
}

.p-4 {
    padding: 20px;
}

.p-5 {
    padding: 25px;
}

.px-2 {
    padding-left: 12px;
    padding-right: 12px;
}

.py-2 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.m-auto {
    margin: auto;
}

.my-2 {
    margin-top: 10px;
    margin-bottom: 10px;
}

.my-3 {
    margin-top: 15px;
    margin-bottom: 15px;
}

.my-4 {
    margin-top: 20px;
    margin-bottom: 20px;
}

.my-5 {
    margin-top: 25px;
    margin-bottom: 25px;
}

.my-6 {
    margin-top: 30px;
    margin-bottom: 30px;
}

.my-7 {
    margin-top: 35px;
    margin-bottom: 35px;
}

.my-8 {
    margin-top: 40px;
    margin-bottom: 40px;
}

.my-9 {
    margin-top: 45px;
    margin-bottom: 45px;
}

.my-10 {
    margin-top: 50px;
    margin-bottom: 50px;
}

.my-pz {
    margin-top: 70px;
    margin-bottom: 20px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mt-4 {
    margin-top: 20px;
}

.mt-5 {
    margin-top: 25px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 15px;
}

.mb-4 {
    margin-bottom: 20px;
}

.mb-5 {
    margin-bottom: 25px;
}

/* --- Sizing --- */
.w-full {
    width: 100%;
}

.max-w-sm {
    max-width: 360px;
}

.max-w-md {
    max-width: 480px;
}

.max-w-lg {
    max-width: 600px;
}

.max-w-xl {
    max-width: 700px;
}

.max-w-2xl {
    max-width: 900px;
}

.max-w-3xl {
    max-width: 1200px;
}

/* --- Height --- */
.btn-h-lg {
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 15px;
}

/* --- Bordas e Sombras --- */
.rounded-sm {
    border-radius: var(--border-radius-sm);
}

.rounded-md {
    border-radius: var(--border-radius-md);
}

.rounded-lg {
    border-radius: var(--border-radius-lg);
}

.rounded-full {
    border-radius: 9999px;
}

.rounded-t-md {
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
}

.rounded-b-md {
    border-bottom-left-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.border {
    border: 1px solid var(--color-border);
}

.border-t {
    border-top: 1px solid var(--color-border);
}

.border-b {
    border-bottom: 1px solid var(--color-border);
}

.border-2 {
    border-width: 2px;
}

.border-none {
    border: none;
}

.border-l-4 {
    border-left-width: 4px;
}

.border-primary {
    border-color: var(--color-primary);
}

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

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

.border-warning-dark {
    border-color: var(--color-warning-dark);
}

.border-secondary-dark {
    border-color: var(--color-secondary-dark);
}

/* --- Outros --- */
.opacity-60 {
    opacity: 0.6;
}

.cursor-pointer {
    cursor: pointer;
}

/* ==========================================================================
   4. ESTILOS DE COMPONENTES ESPECÍFICOS (Não-atômicos)
   ========================================================================== */

/* --- Rodapé --- */
footer {
    text-align: center;
    color: #999;
    margin: 40px 0;
    font-size: 13px;
}

/* --- Painel de Módulos --- */
.container-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin: 40px auto;
    padding: 0 15px;
}

.module {
    padding: 35px 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 38px;
}

.module h3 {
    margin-top: 18px;
    font-size: 17px;
    color: var(--color-text);
}

.module.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.module.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}


/* --- Cabeçalho de Status para Cards Mobile --- */
.card-status-header {
    height: 16px;
    padding: 0;
    border-radius: 12px 12px 0 0;
}

/* --- Campo de Senha com Ícone --- */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: #777;
    stroke-width: 2;
    fill: none;
}

.toggle-password .eye-slash {
    display: none;
}

.toggle-password.is-toggled .eye-slash {
    display: block;
}

.toggle-password.is-toggled .eye-open {
    display: none;
}

/* --- Animações --- */
.pulse-orange {
    animation: pulse-orange 1.5s infinite;
}

.pulse-blue {
    animation: pulse-blue 1.5s infinite;
}

.pulse-green {
    animation: pulse-green 1.5s infinite;
}

.pulse-purple {
    animation: pulse-purple 1.5s infinite;
}

.pulse-red {
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 127, 39, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 127, 39, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 127, 39, 0);
    }
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes pulse-purple {
    0% {
        box-shadow: 0 0 0 0 rgba(156, 39, 176, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(156, 39, 176, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(156, 39, 176, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229, 57, 53, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Card de Item (Cardápio) --- */
.item-card {
    border: 2px solid var(--color-border);
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.item-card:hover {
    border-color: var(--color-success);
    transform: scale(1.02);
}

.item-card.selecionado {
    background-color: #e8f5e9;
    border-color: var(--color-info);
}

.item-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.item-card-counter {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--color-info);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 0 8px 0 8px;
    box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.3);
    min-width: 40px;
}

/* IA-COMMENT: Botão de remoção rápida (-1) no canto oposto ao contador */
.item-card-remove-btn {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--color-danger);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 8px 0 8px 0;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    min-width: 40px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
    user-select: none;
}

.item-card-remove-btn:hover {
    background-color: #c82333;
}

.item-card-remove-btn:active {
    transform: scale(0.95);
}

/* --- Checkbox Grid (Ingredientes/Produtos) --- */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.ing-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 8px;
    background-color: #f3f3f3;
    padding: 8px 10px;
    cursor: pointer;
}

.ing-item:hover {
    background-color: #eaeaea;
}

.ing-item input[type="checkbox"],
.ing-item input[type="radio"] {
    margin-top: 2px;
}

.ing-item .txt {
    white-space: normal;
    line-height: 1.4;
}

/* IA-COMMENT: Segmented Control (iOS-style) para seleção de fonte de imagem.
   Usado em produto_novo.php para escolher entre upload próprio ou banco de imagens. */
.segmented-control {
    display: inline-flex;
    background: #e8e8e8;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    user-select: none;
}

.segmented-control label:hover {
    color: #333;
}

.segmented-control input[type="radio"]:checked+label {
    background: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.btn-secondary-sm {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    background: var(--color-info);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.btn-secondary-sm:hover {
    background: #0c94d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* --- Painel de Status (TV) --- */
.status-tv-page {
    background-color: #1a1a1a;
}

.status-tv-page footer {
    display: none;
}

.status-column {
    flex: 1;
    background-color: #2b2b2b;
    border-radius: var(--border-radius-lg);
    padding: 15px;
    min-width: 0;
}

.status-column h2 {
    color: var(--color-primary);
    border-bottom: 2px solid #444;
    font-size: 2em;
}

.tv-card {
    animation: fadeIn 0.5s ease-in-out;
}

.tv-card.pronto {
    animation: pulse-blue 1.5s infinite;
}

/* --- Módulo de Mesas --- */
.mesa-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* --- Grid de Cards (Cozinha/Entregas) --- */
.card-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    justify-content: center;
    align-items: start;
    gap: 20px;
    padding: 20px;
}

.card-grid-container.two-cards-mode {
    grid-template-columns: repeat(auto-fit, 450px);
}


/* --- Formulário de Filtro de Relatórios --- */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-form-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex-grow: 1;
}

.filter-form-inputs>div {
    flex: 1 1 50px;
}

.filter-form-actions {
    flex-shrink: 0;
}

/* --- Página de Instalação --- */
body.install-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
}

.welcome-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    text-align: center;
    max-width: 600px;
    width: 90%;
    margin: auto;
}

.welcome-box h1 {
    color: #ff7f27;
    margin-top: 0;
}

.welcome-box p {
    color: #555;
    line-height: 1.6;
}

.welcome-box .options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.welcome-box .option {
    flex: 1;
}

.welcome-box .option button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid;
    cursor: pointer;
    transition: all .2s;
}

.welcome-box .option h3 {
    margin: 0 0 10px;
    color: #333;
}

.welcome-box .option p {
    font-size: 14px;
    color: #777;
    margin: 0 auto 15px;
    max-width: 300px;
}

#btn-vazio {
    background-color: #fff;
    color: #2196F3;
    border-color: #2196F3;
}

#btn-vazio:hover {
    background-color: #2196F3;
    color: #fff;
}

#btn-exemplos {
    background-color: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

#btn-exemplos:hover {
    background-color: #43a047;
    border-color: #43a047;
}

.credentials {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: left;
    display: inline-block;
}

.credentials div {
    margin-bottom: 5px;
}

.btn-login {
    display: block;
    margin-top: 15px;
    background: #ff7f27;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.error-details {
    background: #f1f1f1;
    border: 1px solid #ddd;
    text-align: left;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
}

.error-details pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (min-width:600px) {
    .welcome-box .options {
        flex-direction: row;
    }
}

/* --- Botão Grande --- */
.btn-h-lg {
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 15px;
}

/* IA-COMMENT: Adicionados estilos para o modal de confirmação. */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-content {
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: auto;
    /* IA-COMMENT: CORREÇÃO - Centraliza o modal verticalmente e permite a rolagem. */
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-message {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
}

/* IA-COMMENT: Adicionados estilos para o componente de subseção (accordion). */
.subsection {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 20px;
    overflow: hidden;
}

.subsection-header {
    background-color: #fafafa;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subsection-header h4 {
    font-size: 1.1em;
    color: var(--color-primary);
    margin: 0;
    padding: 0;
    border: none;
}

.subsection-content {
    padding: 20px;
    display: none;
    border-top: 1px solid #e0e0e0;
}

.subsection.open .subsection-content {
    display: block;
}

.subsection .arrow {
    transition: transform 0.3s;
}

.subsection.open .arrow {
    transform: rotate(180deg);
}


/* ==========================================================================
   5. RESPONSIVIDADE
   ========================================================================== */

.desktop-only {
    display: table-row;
}

.mobile-only {
    display: none;
}

@media (max-width: 700px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: table-row;
    }

    .main-header {
        font-size: 19px;
    }

    .container-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
        margin: 30px auto;
    }

    .module {
        padding: 35px 8px;
        font-size: 38px;
    }

    .module h3 {
        font-size: 17px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .table thead {
        display: none;
    }

    .card-grid-container,
    .card-grid-container.two-cards-mode {
        grid-template-columns: 1fr;
    }

    .filter-form {
        display: block;
    }

    .filter-form-inputs>div {
        margin-bottom: 1rem;
    }

    .filter-form-actions {
        text-align: right;
        margin-top: 1rem;
    }

    /* IA-COMMENT: Nova regra para empilhar os botões de ação da pizza em telas mobile. */
    .pizza-action-buttons {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* IA-COMMENT: Adicionada nova regra para telas muito pequenas (ex: iPhone SE) para garantir que os botões do painel fiquem lado a lado. */
@media (max-width: 380px) {
    .container-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .module {
        padding: 25px 5px;
        font-size: 32px;
    }

    .module h3 {
        font-size: 15px;
        margin-top: 12px;
    }
}

/* ==========================================================================
   GRID DE ADICIONAIS COM QUANTIDADES
   ========================================================================== */

/* IA-COMMENT: Grid responsivo para adicionais - 1 coluna no mobile, 2 no desktop */
.adicionais-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Desktop: 2 colunas */
@media (min-width: 768px) {
    .adicionais-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PIZZA BUILDER - STEP CARDS
   ========================================================================== */

/* IA-COMMENT: Cards coloridos para cada etapa do builder de pizza */
.pizza-step-card {
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
    position: relative;
}

/* Cores de fundo para cada etapa */
.pizza-step-card.step-1 {
    background-color: #e3f2fd;
}

/* Azul claro */
.pizza-step-card.step-2 {
    background-color: #f3e5f5;
}

/* Roxo claro */
.pizza-step-card.step-3 {
    background-color: #fff3e0;
}

/* Laranja claro */
.pizza-step-card.step-4 {
    background-color: #e8f5e9;
}

/* Verde claro */
.pizza-step-card.step-5 {
    background-color: #f5f5f5;
}

/* Cinza claro */

/* Número da etapa - apenas texto colorido */
.pizza-step-badge {
    font-weight: 600;
    margin-right: 5px;
}

/* Cores dos números */
.pizza-step-badge.badge-1 {
    color: #2196F3;
}

/* Azul */
.pizza-step-badge.badge-2 {
    color: #9C27B0;
}

/* Roxo */
.pizza-step-badge.badge-3 {
    color: #FF9800;
}

/* Laranja */
.pizza-step-badge.badge-4 {
    color: #4CAF50;
}

/* Verde */
.pizza-step-badge.badge-5 {
    color: #757575;
}

/* Cinza */

/* Label da etapa */
.pizza-step-label {
    display: inline-block;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text);
}

/* ==========================================================================
   BANCO DE IMAGENS MODAL
   ========================================================================== */

/* IA-COMMENT: Estilos para o modal de seleção de imagens do banco de imagens.
   Migrado de banco_imagens_modal.js para conformidade com padrão de CSS centralizado. */

.banco-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 1;
    animation: fadeIn 0.2s ease-in;
}

.modal-content.banco-modal {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.banco-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banco-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--color-text);
}

.banco-modal .btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.banco-modal .btn-close:hover {
    background: #f0f0f0;
    color: #333;
}

.banco-modal .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.filtros-banco {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.filtros-banco .form-input,
.filtros-banco .form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.banco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.banco-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.banco-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.banco-item img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    padding: 5px;
}

.banco-item-info {
    margin-top: 8px;
}

.banco-item-nome {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banco-item-categoria {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.banco-modal .modal-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.preview-selected {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.preview-selected img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-nome {
    margin: 10px 0;
    font-weight: 600;
    color: #333;
}

.btn-remove-preview {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-remove-preview:hover {
    background: var(--color-danger-dark);
}

/* Responsividade do Banco de Imagens */
@media (max-width: 700px) {
    .filtros-banco {
        grid-template-columns: 1fr;
    }

    .banco-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .banco-item img {
        height: 120px;
    }
}

/* ==========================================================================
   PÁGINA DE PRODUTOS - INGREDIENTES COM QUANTIDADE
   ========================================================================== */

/* IA-COMMENT: Estilo para ingredientes com campo de quantidade.
   Usado em produto_novo.php e produto_editar.php para ingredientes que permitem quantidade. */

.ing-item-with-qty {
    display: grid;
    grid-template-columns: 18px 1fr 60px;
    align-items: center;
    gap: 8px;
    background-color: #f3f3f3;
    padding: 8px 10px;
    cursor: pointer;
}

.ing-item-with-qty:hover {
    background-color: #eaeaea;
}

.ing-item-with-qty input[type="checkbox"] {
    margin-top: 0;
}

.ing-item-with-qty .txt {
    display: flex;
    align-items: center;
}

.ing-item-with-qty .qty-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.ing-item-with-qty .qty-input:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   PEDIDOS - IMAGENS DE PRODUTOS E LIGHTBOX
   ========================================================================== */

/* IA-COMMENT: Estilo para imagens de produtos no cardápio.
   Usado em pedido_novo.php e pedido_mesa.php para exibir imagens de produtos. */

.produto-imagem-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #ffffff !important;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* IA-COMMENT: Placeholder invisível para manter altura uniforme de cards.
   Usado quando uma categoria tem pelo menos um produto com imagem.
   Garante que produtos sem imagem tenham a mesma altura que os com imagem.
   Apenas em desktop - no mobile os cards ficam em coluna única. */
.produto-imagem-placeholder {
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
    visibility: hidden;
}

/* Mobile: desabilita placeholder (cards em coluna única não precisam) */
@media (max-width: 768px) {
    .produto-imagem-placeholder {
        display: none;
        height: 0;
        margin-bottom: 0;
    }
}

.produto-imagem {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.produto-imagem:hover {
    transform: scale(1.05);
}

/* IA-COMMENT: Lightbox para zoom em imagens de produtos */

#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    background-color: white;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

#lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
}

/* ==========================================================================
   PEDIDO VISUALIZAR - ANIMAÇÕES
   ========================================================================== */

/* IA-COMMENT: Estilo para animação de setas e transição do container de pedido.
   Usado em pedido_visualizar.php para collapse/expand de grupos e animações. */

.arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.group-header.group-open .arrow {
    transform: rotate(90deg);
}

#pedido-container {
    transition: opacity 0.15s ease-in-out;
}

/* ==========================================================================
   MESAS - FILTRO E LAYOUT
   ========================================================================== */

/* IA-COMMENT: Estilos para o painel de mesas (mesas.php).
   Inclui filtro de busca e controle de visibilidade de mesas. */

.mesa-hidden {
    display: none !important;
}

#filtro-mesa-wrapper {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    padding: 20px 15px 0 15px !important;
    margin-bottom: 20px;
}

/* IA-COMMENT: Ajuste de espaçamento no mobile - reduz distância do header */
@media (max-width: 700px) {
    #filtro-mesa-wrapper {
        top: 60px;
        padding: 10px 15px 0 15px !important;
    }

    #mesas-container {
        padding-top: 150px !important;
    }
}

#filtro-mesa-container {
    background: var(--color-info);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#filtro-mesa-container label {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

#filtro-mesa-container input {
    background: white;
    border: 2px solid white;
    font-size: 15px;
}

/* ==========================================================================
   PEDIDOS MENU - FILTRO DE CARDÁPIO
   ========================================================================== */

/* IA-COMMENT: Estilos compartilhados para filtro de cardápio (pedidos_menu.php).
   Inclui estilos de produtos, categorias e filtros. */

.produto-hidden {
    display: none !important;
}

.categoria-vazia {
    opacity: 0.5;
    pointer-events: none;
}

#filtro-cardapio-container {
    background: var(--color-info);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#filtro-cardapio-container label {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

#filtro-cardapio-container input {
    background: white;
    border: 2px solid white;
    font-size: 15px;
}

#filtro-cardapio-container #filtro-resultado-info {
    color: white;
    font-weight: 500;
}

/* Botão de zoom nas imagens dos produtos */
.produto-zoom-icon {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 5;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s;
}

.produto-zoom-icon:hover {
    transform: scale(1.2);
}

/* Forçar 3 colunas em desktop */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Flexbox para ancorar conteúdo na parte inferior do card */
.product-grid .item-card,
#combos-grid .item-card {
    display: flex;
    flex-direction: column;
}

/* IA-COMMENT: Flexbox para cards do MENU online também (menu/index.php) */
.categoria-grid .card.shadow-sm {
    display: flex;
    flex-direction: column;
}

.product-card-content {
    margin-top: auto;
}

/* IA-COMMENT: Classe para ancoragem no topo quando não há imagem no card.
   Sobrescreve o margin-top: auto da classe .product-card-content, permitindo
   que o nome do produto fique no topo do card quando não há imagem. */
.product-card-content-top {
    margin-top: 0;
}

/* Garantir que o contador fique acima da imagem */
.item-card-counter {
    z-index: 10;
}

/* ==========================================================================
   MENU MESA - CENTRALIZAÇÃO E BOTÕES
   ========================================================================== */

/* IA-COMMENT: Estilos para menu da mesa acessado via QR Code (menu_mesa.php).
   Centralização vertical e botões de ação. */

.menu-mesa-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    /* Desconta header, footer e card da empresa */
}

.action-button {
    font-size: 1.1rem;
    padding: 15px;
    width: 320px;
    max-width: 100%;
}

/* ==========================================================================
   FILA DE IMPRESSÃO - MODAL E FILTROS
   ========================================================================== */

/* IA-COMMENT: Estilos para modal de detalhes e filtros responsivos (fila_impressao.php) */

.details-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.details-modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.details-modal-content {
    padding: 25px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.details-modal-overlay.visible .details-modal-content {
    transform: scale(1);
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.modal-tab {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
}

.modal-tab.active {
    border-color: #ddd;
    border-bottom: 1px solid #fff;
    background-color: #fff;
    font-weight: bold;
}

.modal-tab-content {
    display: none;
}

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

@media (max-width: 768px) {
    .filter-form-inputs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .filter-form-inputs>div {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   QRCODE - OVERLAY
   ========================================================================== */

/* IA-COMMENT: Estilo para modal de visualização de QR Code (qrcode.php) */

#qrcode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
}

#qrcode-overlay img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   DEV - INDEX, LOGIN E CONSOLE
   ========================================================================== */

/* IA-COMMENT: Estilos para index.php (instalação), login.php, console.php (DEV), preferencias_programa.php */

.install-page .welcome-box,
.install-page .error-details,
.install-page pre {
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text !important;
}

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.page-console-sql .sql-shortcuts-section {
    margin-bottom: 16px;
}

.page-console-sql .sql-shortcuts-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.page-console-sql .sql-shortcuts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-console-sql .sql-shortcut-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-family: monospace;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.page-console-sql .sql-shortcut-tag:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
    transform: translateY(-1px);
}

.page-console-sql .sql-shortcut-tag.table-tag {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.page-console-sql .sql-shortcut-tag.table-tag:hover {
    background-color: #bbdefb;
    border-color: #64b5f6;
}

/* IA-COMMENT: Força seleção de texto no console, sobrescrevendo o global user-select: none */
.page-console-sql body,
.page-console-sql body *,
.page-console-sql p,
.page-console-sql pre,
.page-console-sql td,
.page-console-sql th {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
}

.page-preferencias .preferences-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.page-preferencias .full-width-section {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .page-preferencias .preferences-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MENU/INDEX E PEDIDO/INDEX - LIGHTBOX E IMAGENS
   ========================================================================== */

/* IA-COMMENT: Estilos compartilhados já foram migrados na seção PEDIDOS - IMAGENS DE PRODUTOS E LIGHTBOX */

/* ==========================================================================
   ACOMPANHAR/INDEX - CONTROLE SEGMENTADO
   ========================================================================== */

.page-acompanhar .segmented-control {
    display: flex;
    width: 100%;
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.page-acompanhar .segmented-control button {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: var(--color-white);
    color: var(--color-primary);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-size: 1rem;
}

.page-acompanhar .segmented-control button.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.page-acompanhar .segmented-control button:not(:last-child) {
    border-right: 2px solid var(--color-primary);
}

/* ==========================================================================
   PAGAMENTO - SEÇÃO DE DESCONTO
   ========================================================================== */

/* IA-COMMENT: Classes para o formulário de desconto na página de pagamento */
.desconto-fields {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.desconto-field {
    display: flex;
    gap: 4px;
    align-items: center;
}

.desconto-input {
    width: 80px;
}

@media (max-width: 640px) {
    .desconto-fields {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .desconto-field {
        width: 100%;
    }
}

/* ==========================================================================
   PREFERÊNCIAS - GRID RESPONSIVO
   ========================================================================== */

/* IA-COMMENT: Layout masonry controlado por JavaScript para eliminar espaços vazios entre cards */
.preferences-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .preferences-grid {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
    }
}

.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.masonry-column > div {
    width: 100%;
}

/* ==========================================================================
   PEDIDO EDITAR - CONVERSÃO
   ========================================================================== */

.p-compact {
    padding: 0.5rem;
}

/* ==========================================================================
   MANUAL/INDEX - SEÇÕES E BUSCA
   ========================================================================== */

/* IA-COMMENT: Manual tem CSS extenso demais (300+ linhas), mantém inline por ora */

/* ==========================================================================
   MODAL DE CARDÁPIO - PEDIDO NOVO/EDITAR
   ========================================================================== */

/* IA-COMMENT: Modal fullscreen para seleção de itens do cardápio */
.modal-cardapio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-cardapio-content {
    background: var(--color-white);
    width: 95%;
    max-width: 800px;
    height: 90vh;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-cardapio-overlay.visible .modal-cardapio-content {
    transform: translateY(0);
}

.modal-cardapio-header {
    padding: 16px;
    background: var(--color-info);
    color: var(--color-white);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-cardapio-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

.modal-close-btn:hover {
    transform: scale(1.2);
}

.modal-cardapio-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--color-bg-light);
}

.modal-cardapio-footer {
    padding: 16px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    background: var(--color-white);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* IA-COMMENT: Responsividade mobile */
@media (max-width: 640px) {
    .modal-cardapio-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }

    .modal-cardapio-header {
        border-radius: 0;
    }

    .modal-cardapio-footer {
        border-radius: 0;
    }
}

/* ==========================================================================
   AUTOCOMPLETE DE CLIENTES
   ========================================================================== */

/* IA-COMMENT: Container do dropdown de autocomplete */
.autocomplete-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: none;
    box-sizing: border-box;
}

.autocomplete-dropdown.visible {
    display: block;
}

/* IA-COMMENT: Item individual do autocomplete */
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-bg);
    transition: background-color 0.2s ease;
    box-sizing: border-box;
    max-width: 100%;
}

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

.autocomplete-item:hover {
    background-color: var(--color-bg-light);
}

/* IA-COMMENT: Conteúdo do item com quebra de linha */
.autocomplete-item-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* IA-COMMENT: Cabeçalho do item (nome + badge) */
.autocomplete-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    max-width: 100%;
}

.autocomplete-item-header strong {
    font-size: 1rem;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    line-height: 1.3;
}

/* IA-COMMENT: Detalhes do item (telefone e endereço) */
.autocomplete-item-details {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    line-height: 1.4;
    max-width: 100%;
}

/* IA-COMMENT: Mensagem quando não há resultados */
.autocomplete-empty {
    padding: 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

/* IA-COMMENT: Hint de telefone encontrado (acesso externo) */
#telefone-hint {
    color: var(--color-success);
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   BADGES DE SCORE
   ========================================================================== */

/* IA-COMMENT: Badge básico */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    text-align: center;
    line-height: 1;
}

/* IA-COMMENT: Badge de sucesso (score >= 6) */
.badge.bg-success {
    background-color: var(--color-success);
    color: var(--color-white);
}

/* IA-COMMENT: Badge de aviso (score 4-5) */
.badge.bg-warning {
    background-color: var(--color-warning);
    color: var(--color-white);
}

/* IA-COMMENT: Badge de perigo (score < 4) */
.badge.bg-danger {
    background-color: var(--color-danger);
    color: var(--color-white);
}

/* IA-COMMENT: Badge de informação */
.badge.bg-info {
    background-color: var(--color-info);
    color: var(--color-white);
}

/* IA-COMMENT: Badge secundário */
.badge.bg-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE - AUTOCOMPLETE
   ========================================================================== */

@media (max-width: 640px) {
    .autocomplete-dropdown {
        max-height: 250px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .autocomplete-item-header strong {
        font-size: 0.9375rem;
    }

    .autocomplete-item-details {
        font-size: 0.8125rem;
    }
}
/* ==========================================================================
   CATEGORIAS - SELETOR DE CORES
   ========================================================================== */

/* IA-COMMENT: Grid de cores para seleção em categorias (nova/editar) */
.cores-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
    max-width: 400px;
}

.cor-opcao {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.cor-opcao:hover {
    transform: scale(1.05);
    border-color: #000;
}

.cor-opcao.selected {
    border-color: #000;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

/* ==========================================================================
   DASHBOARD FINANCEIRO
   ========================================================================== */

/* Grid de cards estatísticos - responsivo */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Ícones dos cards de estatística */
.stat-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-card-icon.success {
    color: var(--color-success);
}

.stat-card-icon.danger {
    color: var(--color-danger);
}

.stat-card-icon.warning {
    color: var(--color-warning);
}

/* Valores dos cards */
.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: var(--color-primary);
}

/* Labels dos cards */
.stat-card-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
    font-weight: 500;
}

/* Cor dinâmica para lucro líquido (usa classes success/danger no elemento) */
.stat-card-value.success-color {
    color: var(--color-success);
}

.stat-card-value.danger-color {
    color: var(--color-danger);
}

/* Formulário de filtro do dashboard */
.page-dashboard-financeiro .filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.page-dashboard-financeiro .filter-form-field {
    flex: 1 1 200px;
}

.page-dashboard-financeiro .filter-form-button {
    flex: 0 0 auto;
    min-width: 120px;
    height: 42px;
}

/* Canvas dos gráficos */
.page-dashboard-financeiro .chart-canvas {
    max-height: 300px;
}


/* ==========================================================================
   EDITOR DE QR CODE - MODAL E CONTROLES
   ========================================================================== */

/* Modal do editor (fullscreen) */
#qrcode-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container principal do editor */
.qrcode-editor-container {
    display: flex;
    gap: 20px;
    max-width: 95%;
    max-height: 95%;
    width: 100%;
}

/* Área do canvas (centralizada) */
.qrcode-editor-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    overflow: auto; /* IA-COMMENT: Scroll automático quando canvas for maior que viewport */
}

#qrcode-canvas {
    border: 2px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* IA-COMMENT: Canvas sempre no tamanho real (1200x1200 ou 1200x1600) */
}

/* Painel lateral de controles */
.qrcode-editor-sidebar {
    width: 320px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.qrcode-editor-sidebar h3 {
    margin: 0 0 15px 0;
    font-size: 1.25rem;
    color: var(--color-primary);
}

/* Seção de adicionar elementos */
.add-elements-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.add-elements-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-add-element {
    padding: 10px;
    background-color: var(--color-success);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-element:hover {
    background-color: var(--color-success-dark);
    transform: translateY(-1px);
}

/* Painel de controles (exibido quando elemento é selecionado) */
#controls-panel {
    display: none;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.control-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

.control-apply-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: 5px;
}

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

/* Botões de estilo de texto */
.text-style-btn {
    flex: 1;
    padding: 8px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.text-style-btn:hover {
    background-color: #e0e0e0;
}

.text-style-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

#btn-italic {
    font-style: italic;
}

#btn-underline {
    text-decoration: underline;
}

/* Botão de excluir elemento */
.control-delete-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--color-danger);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.control-delete-btn:hover {
    background-color: var(--color-danger-dark);
}

/* Botões de ação do editor */
.qrcode-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.qrcode-editor-actions button {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qrcode-editor-actions .btn-generate {
    background-color: var(--color-success);
    color: white;
}

.qrcode-editor-actions .btn-generate:hover {
    background-color: #059669;
}

.qrcode-editor-actions .btn-cancel {
    background-color: var(--color-secondary);
    color: white;
}

.qrcode-editor-actions .btn-cancel:hover {
    background-color: #4b5563;
}

/* Loading overlay do editor */
#editor-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10000;
}

#editor-loading .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#editor-loading-text {
    margin-top: 20px;
    font-size: 1.125rem;
    color: #333;
    font-weight: 600;
}

/* Info do tipo de template */
.editor-info {
    padding: 12px;
    background-color: #f0f9ff;
    border-left: 4px solid var(--color-primary);
    border-radius: 4px;
    font-size: 0.875rem;
}

.editor-info strong {
    color: var(--color-primary);
}

/* Responsividade do editor */
@media (max-width: 1024px) {
    .qrcode-editor-container {
        flex-direction: column;
    }

    .qrcode-editor-sidebar {
        width: 100%;
        max-height: 300px;
    }

    /* IA-COMMENT: Removido max-width para canvas aparecer em tamanho real */
}

@media (max-width: 768px) {
    #qrcode-editor-modal {
        padding: 10px;
    }

    .qrcode-editor-sidebar {
        padding: 15px;
    }

    #qrcode-canvas {
        max-width: 100%;
        max-height: 50vh;
    }
}

