/**
 * Chopp On Tap - Estilos Principais
 * Layout Clean e Responsivo
 */

/* ========================================
   Reset e Configurações Globais
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066CC;
    --primary-dark: #0052A3;
    --secondary-color: #FF9900;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
}

/* ========================================
   Página de Login
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 280px;
    height: auto;
}

.login-form {
    width: 100%;
}

/* ========================================
   Formulários
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ========================================
   Botões
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

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

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

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

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

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

.btn-danger:hover {
    background-color: #c82333;
}

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

.btn-secondary {
    background-color: var(--gray-600);
    color: var(--white);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========================================
   Alertas
   ======================================== */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ========================================
   Layout Admin
   ======================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--dark-color);
    color: var(--white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.sidebar-header img {
    max-width: 150px;
    height: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-color);
}

.sidebar-menu .icon {
    margin-right: 10px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
}

.topbar {
    background-color: var(--white);
    padding: 15px 30px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 20px;
    color: var(--gray-800);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.content-area {
    padding: 30px;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-200);
    background-color: var(--gray-100);
}

/* Cards de Estatísticas */
.stats-card {
    background: var(--primary-color);
    color: var(--white);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
}

.stats-card h3 {
    margin: 10px 0 0 0;
    font-size: 28px;
    font-weight: bold;
}

.stats-card p {
    margin: 0 0 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

.stats-card.white {
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--gray-200);
}

/* ========================================
   Grid System
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
    padding: 0 10px;
    margin-bottom: 20px;
}

.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-md-12 { width: 100%; }

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

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: var(--gray-100);
}

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

table th {
    font-weight: 600;
    color: var(--gray-800);
}

table tbody tr:hover {
    background-color: var(--gray-100);
}

/* ========================================
   TAP Cards
   ======================================== */
.tap-card {
    border-radius: 16px;
    padding: 20px;
    color: var(--white);
    height: 100%;
}

.tap-card.success {
    background-color: #17a2b8;
}

.tap-card.warning {
    background-color: #ffc107;
    color: var(--dark-color);
}

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

.tap-card.secondary {
    background-color: var(--gray-600);
}

.tap-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.tap-card .tap-info {
    font-size: 13px;
    line-height: 1.8;
}

.tap-card .volume-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
    font-weight: bold;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

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

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

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

.badge-secondary {
    background-color: var(--gray-600);
    color: var(--white);
}

/* ========================================
   Utilitários
   ======================================== */
.mt-3 { margin-top: 30px; }
.mb-3 { margin-bottom: 30px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-white { color: var(--white); }
.text-primary { color: var(--primary-color); }

.d-flex {
    display: flex;
}

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

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

.gap-10 {
    gap: 10px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--white);
    padding: 15px 30px;
    border-top: 1px solid var(--gray-200);
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-600);
}

/* ========================================
 /* TAP Cards */
.tap-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.tap-card.warning {
    border-left-color: var(--warning-color);
}

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

.tap-card h3 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 20px;
}

.tap-info {
    font-size: 13px;
    line-height: 1.8;
    color: var(--gray-700);
}

.volume-badge {
    background: var(--gray-100);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Image Thumbnail */
.img-thumbnail {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Responsividade */======================================== */
@media (max-width: 992px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        width: 50%;
    }
}

@media (max-width: 768px) {
    /* Sidebar: usa transform (sobreposto) — veja media query em RESPONSIVIDADE GLOBAL */
    .main-content {
        margin-left: 0;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        width: 100%;
    }
    
    .topbar {
        padding: 15px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .row {
        margin: 0;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        padding: 0;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: right;
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* ========================================
   Imagens
   ======================================== */
.img-thumbnail {
    max-width: 100px;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-300);
}

.img-preview {
    max-width: 200px;
    height: auto;
    border-radius: var(--border-radius);
}

/* ========================================
   Select e Input File
   ======================================== */
select.form-control {
    cursor: pointer;
    background-color: var(--white);
}

input[type="file"] {
    padding: 8px;
}

/* ========================================
   Action Buttons
   ======================================== */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--gray-800);
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* ========================================
   Chart Container
   ======================================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ========================================
   Scrollbar Customization
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-800);
}

/* ========================================
   Submenu Financeiro
   ======================================== */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-item-has-children .arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.menu-item-has-children.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.submenu.show {
    display: block;
}

.submenu li {
    margin: 0;
}

.submenu li a {
    padding: 10px 15px 10px 45px;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.submenu li a.active {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.submenu li a .icon {
    margin-right: 10px;
    font-size: 16px;
}

/* Script para toggle do submenu */


/* ========================================
   Melhorias para Ícones Font Awesome
   ======================================== */
.sidebar-menu a i.fas,
.sidebar-menu a i.fab {
    width: 20px;
    font-size: 18px;
    text-align: center;
    margin-right: 12px;
}

.topbar .menu-toggle i {
    font-size: 20px;
}

.user-avatar i {
    font-size: 18px;
}

/* Ajustes para compatibilidade */
.sidebar-menu a .icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 12px;
}

/* Melhorias visuais adicionais */
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.topbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-600);
}

.logout-link {
}

.logout-link:hover {
}


/* ========================================
   Melhorias para Ícones Font Awesome
   ======================================== */
.sidebar-menu a i.fas,
.sidebar-menu a i.fab {
    width: 20px;
    font-size: 18px;
    text-align: center;
    margin-right: 12px;
}

.topbar .menu-toggle i {
    font-size: 20px;
}

.user-avatar i {
    font-size: 18px;
}

/* Ajustes para compatibilidade */
.sidebar-menu a .icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 12px;
}

/* Melhorias visuais adicionais */
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.topbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-600);
}

.logout-link {
    color: #ff6b6b;
}

.logout-link:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Melhorias para submenu */
.menu-item-has-children > a .arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

/* Garantir que ícones Font Awesome apareçam corretamente */
.fas, .fab {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.fab {
    font-family: "Font Awesome 6 Brands";
    font-weight: 400;
}


/* ========================================
   COMPONENTES UNIFICADOS - ChoppON v3.x
   ======================================== */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.content-header h1, .content-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.content-header .header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--white); flex-shrink: 0;
}
.stat-icon.bg-primary   { background-color: var(--primary-color); }
.stat-icon.bg-success   { background-color: var(--success-color); }
.stat-icon.bg-warning   { background-color: var(--warning-color); color: var(--dark-color); }
.stat-icon.bg-danger    { background-color: var(--danger-color); }
.stat-icon.bg-info      { background-color: var(--info-color); }
.stat-icon.bg-secondary { background-color: var(--gray-600); }
.stat-icon.bg-purple    { background-color: #6f42c1; }
.stat-icon.bg-orange    { background-color: #fd7e14; }
.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--gray-800); margin: 0 0 2px 0; line-height: 1.2; }
.stat-info p  { font-size: 13px; color: var(--gray-600); margin: 0; }
/* stat-number e stat-label: usados em módulos com 5+ cards */
.stat-number { font-size: 22px; font-weight: 700; line-height: 1; color: var(--gray-800); margin: 0 0 2px 0; }
.stat-label  { font-size: 12px; color: var(--gray-600); margin: 0; }
/* stat-value: alias de stat-number (inventário e outros módulos) */
.stat-value  { font-size: 22px; font-weight: 700; line-height: 1; color: var(--gray-800); margin: 0 0 2px 0; }
/* stat-cards: container flex para cards de estatísticas (inventário) */
.stat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.stat-cards .stat-card {
    flex: 1;
    min-width: 160px;
}
@media (max-width: 768px) {
    .stat-cards .stat-card { min-width: calc(50% - 8px); flex: 0 0 calc(50% - 8px); }
}

.btn-outline-primary { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline-primary:hover { background: var(--primary-color); color: var(--white); }
.btn-outline-secondary { background: transparent; border: 2px solid var(--gray-600); color: var(--gray-600); }
.btn-outline-secondary:hover { background: var(--gray-600); color: var(--white); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-icon i { font-size: 13px; }
.btn-info { background-color: var(--info-color); color: var(--white); }
.btn-info:hover { background-color: #138496; }
.btn-purple { background-color: #6f42c1; color: var(--white); }
.btn-purple:hover { background-color: #5a32a3; }

.btn-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px; border: none; cursor: pointer;
    font-size: 13px; transition: var(--transition); text-decoration: none;
}
.btn-action.view    { background: #e8f4fd; color: #0066CC; }
.btn-action.edit    { background: #fff3cd; color: #856404; }
.btn-action.delete  { background: #f8d7da; color: #721c24; }
.btn-action.success { background: #d4edda; color: #155724; }
.btn-action.info    { background: #d1ecf1; color: #0c5460; }
.btn-action.purple  { background: #e8d5f5; color: #6f42c1; }
.btn-action:hover   { filter: brightness(0.9); transform: scale(1.05); }

.table-card { background: var(--white); border-radius: 12px; box-shadow: var(--box-shadow); overflow: hidden; margin-bottom: 24px; }
.table-card .table-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-card .table-header h3 { font-size: 16px; font-weight: 600; margin: 0; color: var(--gray-800); }
.table-card table { margin: 0; }
.table-card table th { background: var(--gray-100); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-600); font-weight: 600; padding: 12px 16px; border-bottom: 2px solid var(--gray-200); }
.table-card table td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--gray-200); font-size: 14px; }
.table-card table tbody tr:last-child td { border-bottom: none; }
.table-card table tbody tr:hover { background: #f8fbff; }

.filter-bar { background: var(--white); border-radius: 12px; padding: 16px 20px; box-shadow: var(--box-shadow); margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }
.filter-bar .form-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray-600); margin-bottom: 6px; }
.filter-bar .btn { align-self: flex-end; white-space: nowrap; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 0; }
.form-section { background: var(--gray-100); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.form-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-600); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-300); }

.card-border-primary { border-left: 4px solid var(--primary-color); }
.card-border-success  { border-left: 4px solid var(--success-color); }
.card-border-warning  { border-left: 4px solid var(--warning-color); }
.card-border-danger   { border-left: 4px solid var(--danger-color); }
.card-border-info     { border-left: 4px solid var(--info-color); }

.badge-pill { border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.badge-light   { background: var(--gray-200); color: var(--gray-800); }
.badge-primary { background: var(--primary-color); color: var(--white); }

.text-muted   { color: var(--gray-600) !important; }
.text-small   { font-size: 12px; }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-4 { margin-top: 32px !important; }
.p-0  { padding: 0 !important; }
.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-grid  { display: grid !important; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.w-100 { width: 100%; }

.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 16px 0; flex-wrap: wrap; }
.pagination .page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--gray-300); border-radius: 6px; background: var(--white); color: var(--gray-800); font-size: 13px; cursor: pointer; transition: var(--transition); text-decoration: none; }
.pagination .page-btn:hover, .pagination .page-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: var(--white); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.empty-state-full { text-align: center; padding: 60px 20px; color: var(--gray-600); }
.empty-state-full .empty-icon { font-size: 48px; color: var(--gray-300); margin-bottom: 16px; }
.empty-state-full h4 { font-size: 18px; color: var(--gray-800); margin-bottom: 8px; }
.empty-state-full p { font-size: 14px; margin-bottom: 20px; }

.sidebar-menu a i, .sidebar-menu a .fas, .sidebar-menu a .fab { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; }
.sidebar-menu .submenu a { padding-left: 48px; font-size: 13px; }
.sidebar-menu .submenu a i { font-size: 13px; }

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .content-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-group { min-width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .table-card table th, .table-card table td { padding: 8px 10px; font-size: 12px; }
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

/* ── Modal Overlay (global) ─────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active,
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-box {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
.modal-box-header {
    padding: 18px 24px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
.modal-box-header h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--gray-800); }
.modal-box-body { padding: 24px; flex: 1; }
.modal-box-footer {
    padding: 16px 24px;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-300);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0 4px;
    transition: color 0.2s;
}
.btn-close-modal:hover { color: var(--danger-color); }

/* ── Tabs de Navegação de Módulo (global) ───────────────────────────────── */
.module-tabs-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    padding: 6px 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    border: 1px solid var(--gray-200);
}
.tabs-navigation {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    padding: 6px 12px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
}
.tab-link.active {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}
.tab-link.active:hover {
    background: #0056b3;
    color: var(--white);
}


/* ========================================
   Utilitários adicionais (Bootstrap-like)
   ======================================== */
/* form-select: alias de form-control para selects */
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    background-color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    appearance: auto;
}
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
/* form-label */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-600);
    white-space: nowrap;
}
/* Flex utilitários */
.align-items-end   { align-items: flex-end; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-end     { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
/* Gap utilitários */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
/* g-3: gap para row grids */
.g-3 { gap: 12px; }
/* Margin utilitários */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 24px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
/* Padding utilitários */
.p-0 { padding: 0 !important; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
/* Texto utilitários */
.text-muted    { color: var(--gray-600); }
.text-success  { color: var(--success-color); }
.text-danger   { color: var(--danger-color); }
.text-warning  { color: var(--warning-color); }
.text-info     { color: var(--info-color); }
.text-dark     { color: var(--dark-color); }
.fs-6          { font-size: 13px; }
.fw-bold       { font-weight: 700; }
.small, small  { font-size: 12px; }
/* Badge utilitários */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.bg-primary   { background-color: var(--primary-color) !important; color: #fff !important; }
.bg-success   { background-color: var(--success-color) !important; color: #fff !important; }
.bg-warning   { background-color: var(--warning-color) !important; color: #333 !important; }
.bg-danger    { background-color: var(--danger-color)  !important; color: #fff !important; }
.bg-info      { background-color: var(--info-color)    !important; color: #fff !important; }
.bg-secondary { background-color: var(--gray-600)      !important; color: #fff !important; }
.bg-light     { background-color: var(--gray-100)      !important; color: var(--gray-800) !important; }
/* Table utilitários */
.table-danger  { background-color: #f8d7da !important; }
.table-warning { background-color: #fff3cd !important; }
.table-success { background-color: #d1e7dd !important; }
/* Btn outline utilitários */
.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline-primary:hover, .btn-outline-primary.active {
    background: var(--primary-color);
    color: #fff;
}
.btn-outline-warning {
    background: transparent;
    border: 2px solid var(--warning-color);
    color: #856404;
}
.btn-outline-warning:hover, .btn-outline-warning.active {
    background: var(--warning-color);
    color: #333;
}
.btn-outline-info {
    background: transparent;
    border: 2px solid var(--info-color);
    color: var(--info-color);
}
.btn-outline-info:hover, .btn-outline-info.active {
    background: var(--info-color);
    color: #fff;
}
.btn-outline-success {
    background: transparent;
    border: 2px solid var(--success-color);
    color: var(--success-color);
}
.btn-outline-success:hover, .btn-outline-success.active {
    background: var(--success-color);
    color: #fff;
}
.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--gray-400, #ced4da);
    color: var(--gray-600);
}
.btn-outline-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}
.btn-group {
    display: inline-flex;
    gap: 0;
}
.btn-group .btn {
    border-radius: 0;
}
.btn-group .btn:first-child { border-radius: var(--border-radius) 0 0 var(--border-radius); }
.btn-group .btn:last-child  { border-radius: 0 var(--border-radius) var(--border-radius) 0; }
.btn-group-sm .btn { padding: 5px 10px; font-size: 12px; }
/* ========================================
   Filter-grid global (padrão do sistema)
   ======================================== */
.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    flex: 1;
}
.filter-item-wide {
    flex: 2;
    min-width: 220px;
}
.filter-item-btn {
    flex: 0 0 auto;
    min-width: auto;
}
.filter-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-600);
    margin-bottom: 6px;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .filter-grid { flex-direction: column; }
    .filter-item, .filter-item-wide { min-width: 100%; flex: unset; }
}


/* ============================================================
   MOBILE RESPONSIVE — ChoppON ERP v3.x
   Bloco unico e definitivo. Nao duplicar.
   ============================================================ */

/* ── 0. VIEWPORT / OVERFLOW GLOBAL ──────────────────────────── */
html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}
body {
    overflow-x: hidden;
    max-width: 100vw;
}
.admin-wrapper {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}
.main-content {
    min-width: 0;
    max-width: 100%;
}
.content-area {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── 1. SIDEBAR MOBILE (overlay com transform) ───────────────── */
/* Backdrop: sempre no DOM, controlado por opacity */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1024px) {
    /* Mostrar backdrop em mobile */
    .sidebar-backdrop {
        display: block;
    }
    /* Sidebar: oculta fora da tela, desliza ao abrir */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        z-index: 1050 !important;
        transform: translateX(-260px) !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sidebar.active {
        transform: translateX(0) !important;
    }
    /* Main content: ocupa 100% sem margem da sidebar */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    /* Botao toggle: sempre visivel */
    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        font-size: 22px;
        color: var(--gray-800);
        background: none;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
        padding: 0;
    }
    /* Touch targets maiores no menu */
    .sidebar-menu a {
        padding: 14px 20px;
        min-height: 48px;
    }
    .submenu li a {
        min-height: 44px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
}
@media (min-width: 1025px) {
    .sidebar-backdrop {
        display: none !important;
    }
    .sidebar {
        transform: none !important;
        position: fixed !important;
    }
}

/* ── 2. TOPBAR MOBILE ────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
}
@media (max-width: 768px) {
    .topbar {
        padding: 10px 12px;
        gap: 6px;
        flex-wrap: nowrap;
        min-height: 56px;
    }
    .topbar-left {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    .topbar-left h2 {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 200px);
        margin: 0;
    }
    .topbar-right {
        flex-shrink: 0;
        gap: 6px;
    }
    .user-details {
        display: none !important;
    }
    .profile-caret {
        display: none !important;
    }
    .session-timer span {
        display: none;
    }
    .session-timer {
        padding: 6px 8px;
        min-width: 36px;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .topbar-left h2 {
        max-width: calc(100vw - 140px);
        font-size: 14px;
    }
    .session-timer {
        display: none !important;
    }
    .menu-toggle {
        margin-right: 8px;
    }
}

/* ── 3. CONTENT AREA PADDING ─────────────────────────────────── */
@media (max-width: 768px) {
    .content-area {
        padding: 14px 10px;
    }
}
@media (max-width: 480px) {
    .content-area {
        padding: 10px 8px;
    }
}

/* ── 4. TABELAS RESPONSIVAS ──────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    display: block;
}
.card {
    overflow: hidden;
    max-width: 100%;
}
.card .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
    table th,
    table td {
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 12px;
    }
    /* Tabelas sem wrapper: scroll no proprio elemento */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    /* thead/tbody precisam ser table para manter o layout */
    table thead,
    table tbody,
    table tfoot {
        display: table;
        width: 100%;
    }
}
@media (max-width: 480px) {
    table th,
    table td {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* ── 5. GRID DE COLUNAS ──────────────────────────────────────── */
@media (max-width: 992px) {
    .col-md-3, .col-md-4 { width: 50%; }
}
@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8,
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8,
    .col-xl-3, .col-xl-4, .col-xl-6, .col-xl-8,
    .col-6, .col-sm-6 {
        width: 100% !important;
        padding-left: 0;
        padding-right: 0;
    }
    .row { margin: 0; }
}

/* ── 6. STATS GRID ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
    [style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; gap: 10px; }
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── 7. STAT CARDS ───────────────────────────────────────────── */
@media (max-width: 576px) {
    .stat-card { padding: 14px 12px; gap: 10px; }
    .stat-icon { width: 42px; height: 42px; font-size: 18px; }
    .stat-info h3, .stat-number, .stat-value { font-size: 20px; }
    .stat-cards .stat-card {
        min-width: calc(50% - 8px);
        flex: 0 0 calc(50% - 8px);
    }
}
@media (max-width: 360px) {
    .stat-cards .stat-card { min-width: 100%; flex: 0 0 100%; }
}

/* ── 8. PAGE HEADER ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-header h1 { font-size: 18px; line-height: 1.3; }
    .page-header > * { width: 100%; }
    .page-header .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ── 9. MODAIS ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92vh;
        overflow-y: auto;
        margin: 0 auto;
        border-radius: 10px;
    }
    .modal-box {
        width: 96vw !important;
        max-width: 96vw !important;
        border-radius: 10px;
    }
    .modal-body, .modal-box-body { padding: 14px; }
    .modal-header, .modal-box-header { padding: 14px; }
    .modal-footer, .modal-box-footer {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-footer .btn, .modal-box-footer .btn {
        flex: 1;
        min-width: 120px;
    }
    .qrp-box {
        width: 96vw !important;
        max-width: 96vw !important;
        border-radius: 10px;
    }
}

/* ── 10. FORMULARIOS ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .form-control,
    .form-select,
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    textarea { min-height: 80px; }
    .btn { min-height: 44px; font-size: 14px; }
    .btn-sm { min-height: 36px; font-size: 12px; }
    .form-row { grid-template-columns: 1fr !important; }
    .filter-bar { flex-direction: column; gap: 10px; }
    .filter-bar .form-group { min-width: 100%; }
    .filter-bar .btn { width: 100%; }
    .filter-grid { flex-direction: column; }
    .filter-item, .filter-item-wide { min-width: 100%; flex: unset; }
    .filter-item-btn { width: 100%; }
    .filter-item-btn .btn { width: 100%; }
}

/* ── 11. FOOTER ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .footer {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        padding: 12px 10px;
        font-size: 11px;
    }
}

/* ── 12. DROPDOWN DO PERFIL ──────────────────────────────────── */
@media (max-width: 480px) {
    .profile-dropdown {
        right: -10px;
        min-width: 220px;
        max-width: calc(100vw - 20px);
    }
}

/* ── 13. TABS DE NAVEGACAO ───────────────────────────────────── */
@media (max-width: 640px) {
    .tabs-navigation,
    .module-tabs-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding: 4px 8px;
        gap: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .tabs-navigation::-webkit-scrollbar,
    .module-tabs-card::-webkit-scrollbar { display: none; }
    .tab-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* ── 14. BOTOES DE ACAO ──────────────────────────────────────── */
@media (max-width: 576px) {
    .action-buttons { flex-wrap: wrap; gap: 4px; }
    .btn-action { width: 30px; height: 30px; font-size: 11px; }
    .d-flex.gap-2 { flex-wrap: wrap; }
}

/* ── 15. PAGINACAO ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .pagination { flex-wrap: wrap; gap: 3px; }
    .pagination .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
}

/* ── 16. GRAFICOS ────────────────────────────────────────────── */
@media (max-width: 768px) { .chart-container { height: 220px !important; } }
@media (max-width: 480px) { .chart-container { height: 180px !important; } }

/* ── 17. CHAT / SUPORTE ──────────────────────────────────────── */
@media (max-width: 768px) {
    .chat-layout,
    [class*="chat-"] > div[style*="grid-template-columns"],
    .container-fluid > div[style*="grid-template-columns"],
    main > div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    .chat-bubble, [class*="bubble"] { max-width: 90% !important; }
}

/* ── 18. CONTENT HEADER ──────────────────────────────────────── */
@media (max-width: 640px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .content-header h1, .content-header h2 { font-size: 18px; }
    .content-header .header-actions { width: 100%; flex-wrap: wrap; }
    .content-header .header-actions .btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
        justify-content: center;
    }
}

/* ── 19. AUDIT CARDS ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .audit-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .audit-cards { grid-template-columns: repeat(2, 1fr); }
    .audit-filters form { flex-direction: column; }
    .audit-filters .fg { min-width: 100%; }
    .audit-filters .btn-filtrar,
    .audit-filters .btn-limpar { width: 100%; }
}

/* ── 20. SIDEBAR SCROLLBAR ───────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* ── 21. IMAGENS ─────────────────────────────────────────────── */
img { max-width: 100%; height: auto; }
.sidebar-header img { max-width: 140px; }

/* ── 22. TEXTOS LONGOS ───────────────────────────────────────── */
@media (max-width: 768px) {
    .text-break { word-break: break-all; overflow-wrap: break-word; }
    input[type="url"], input[type="email"], input[type="text"] {
        text-overflow: ellipsis;
    }
    pre, code {
        overflow-x: auto;
        white-space: pre-wrap;
        word-break: break-word;
    }
}

/* ── 23. GARANTIA FINAL ──────────────────────────────────────── */
@media (max-width: 768px) {
    * { box-sizing: border-box; }
}

/* =========================================================
   Login moderno — Chopp ON Smart Compact
   Escopo isolado para não alterar as telas administrativas.
   ========================================================= */
.login-page {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    color: #172033;
    background:
        radial-gradient(circle at 14% 12%, rgba(239, 139, 47, .12), transparent 28%),
        linear-gradient(135deg, #f7f9fc 0%, #eef3f8 100%);
}

.login-container {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(380px, .86fr) minmax(0, 1.14fr);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.login-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(36px, 6vw, 96px) clamp(28px, 6vw, 104px);
    background: #fff;
}

.login-brand-mark {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 11px 17px;
    border: 1px solid #edf0f4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 32, 51, .06);
}

.login-logo {
    display: block;
    width: 132px;
    height: 54px;
    object-fit: contain;
}

.login-heading {
    margin: 38px 0 28px;
}

.login-heading .eyebrow,
.visual-kicker {
    display: block;
    margin-bottom: 10px;
    color: #e67817;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.login-heading h1 {
    margin: 0;
    color: #142238;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 760;
    letter-spacing: -.045em;
    line-height: 1.06;
}

.login-heading p {
    max-width: 360px;
    margin: 13px 0 0;
    color: #7b8798;
    font-size: 14px;
    line-height: 1.65;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid #f7c5c2;
    border-radius: 12px;
    color: #9b211b;
    background: #fff3f2;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.login-alert-icon {
    display: inline-flex;
    flex: 0 0 19px;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    color: #fff;
    background: #d92d20;
    font-size: 12px;
    font-weight: 800;
}

.login-form {
    width: 100%;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    color: #27364b;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .01em;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    width: 18px;
    color: #9aa6b7;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input {
    display: block;
    width: 100%;
    height: 53px;
    padding: 0 17px 0 48px;
    border: 1px solid #dfe5ed;
    border-radius: 13px;
    outline: none;
    color: #172033;
    background: #fbfcfe;
    font: inherit;
    font-size: 14px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.login-input::placeholder {
    color: #a9b3c1;
}

.login-input:hover {
    border-color: #bdc9d9;
    background: #fff;
}

.login-input:focus {
    border-color: #ed811d;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(237, 129, 29, .13);
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 26px;
    color: #7d8999;
    font-size: 12px;
}

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.login-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #eb7d18;
}

.login-link {
    color: #d96e14;
    font-weight: 700;
    text-decoration: none;
}

.login-link:hover,
.login-link:focus-visible {
    color: #ae4e08;
    text-decoration: underline;
}

.login-help-text {
    color: #9aa6b7;
    font-size: 11px;
    text-align: right;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 54px;
    padding: 0 20px 0 22px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(100deg, #e76f16 0%, #f29127 100%);
    box-shadow: 0 12px 22px rgba(231, 111, 22, .24);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-submit span:last-child {
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
}

.login-submit:hover,
.login-submit:focus-visible {
    filter: saturate(1.08);
    box-shadow: 0 15px 28px rgba(231, 111, 22, .32);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-regions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 31px;
    padding-top: 21px;
    border-top: 1px solid #edf0f4;
}

.login-regions-label {
    width: 100%;
    margin-bottom: 2px;
    color: #99a4b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.region-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e9edf2;
    border-radius: 999px;
    color: #526174;
    background: #fbfcfe;
    font-size: 11px;
    font-weight: 700;
}

.flag {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 14px;
    overflow: hidden;
    border: 1px solid rgba(23, 32, 51, .1);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(23, 32, 51, .08);
}

.flag-br {
    background: #169b62;
}

.flag-br::before {
    position: absolute;
    top: 2px;
    left: 4px;
    width: 12px;
    height: 9px;
    background: #ffdf00;
    content: '';
    transform: rotate(45deg);
}

.flag-br::after {
    position: absolute;
    top: 5px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #002776;
    content: '';
}

.flag-py {
    background: linear-gradient(to bottom, #d52b3f 0 33%, #fff 33% 66%, #0038a8 66% 100%);
}

.flag-py::after {
    position: absolute;
    top: 4px;
    left: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #e4a72c;
    content: '';
}

.login-security-note {
    margin: 18px 0 0;
    color: #a3adba;
    font-size: 11px;
    text-align: center;
}

.login-recovery-link {
    margin: 10px 0 0;
    text-align: right;
    font-size: 0.82rem;
}

.login-recovery-link a {
    color: #0f6fc5;
    font-weight: 600;
    text-decoration: none;
}

.login-recovery-link a:hover,
.login-recovery-link a:focus-visible {
    color: #e67a17;
    text-decoration: underline;
}

.login-security-note span {
    margin-right: 5px;
    color: #e67a17;
    font-size: 16px;
    vertical-align: -1px;
}

.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding: clamp(32px, 5vw, 64px);
    color: #fff;
    background:
        radial-gradient(circle at 74% 18%, rgba(244, 154, 62, .25), transparent 22%),
        radial-gradient(circle at 24% 85%, rgba(61, 133, 214, .26), transparent 27%),
        linear-gradient(145deg, #122943 0%, #0e1d35 55%, #091323 100%);
}

.login-visual::before {
    position: absolute;
    right: -22%;
    bottom: -30%;
    width: 75%;
    height: 70%;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: '';
    transform: rotate(-20deg);
}

.login-visual > *:not(.visual-glow) {
    position: relative;
    z-index: 1;
}

.visual-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
}

.visual-glow-one {
    top: 14%;
    right: 12%;
    width: 190px;
    height: 190px;
    background: rgba(245, 143, 41, .12);
}

.visual-glow-two {
    bottom: 8%;
    left: -12%;
    width: 230px;
    height: 230px;
    background: rgba(50, 127, 211, .13);
}

.visual-topline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, .66);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #65d6a0;
    box-shadow: 0 0 0 5px rgba(101, 214, 160, .12);
}

.smart-art {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    margin: 20px 0 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 22px;
    aspect-ratio: auto;
    background: #101923 url('../images/chopp_smart_app_mockup.webp') center / cover no-repeat;
    box-shadow: 0 22px 42px rgba(0, 0, 0, .28);
}

.smart-art::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(4, 12, 20, .02) 42%, rgba(4, 12, 20, .48) 100%);
    content: '';
    pointer-events: none;
}

.visual-copy {
    max-width: 390px;
}

.visual-copy h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 3.8vw, 48px);
    font-weight: 420;
    letter-spacing: -.055em;
    line-height: 1.04;
}

.visual-copy h2 strong {
    color: #f5a14b;
    font-weight: 760;
}

.visual-copy p {
    max-width: 300px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, .63);
    font-size: 13px;
    line-height: 1.7;
}

.visual-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: rgba(255, 255, 255, .42);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

@media (max-width: 960px) {
    .login-page {
        align-items: flex-start;
        padding: 0;
    }

    .login-container {
        width: 100%;
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 0;
    }

    .login-visual {
        min-height: clamp(360px, 52svh, 560px);
        order: -1;
        padding: clamp(28px, 5vw, 56px);
    }

    .smart-art {
        flex: 0 0 auto;
        margin: 12px 0 0;
        aspect-ratio: 16 / 9;
    }

    .login-box {
        padding: 48px clamp(24px, 8vw, 88px) 56px;
    }
}

@media (max-width: 520px) {
    .login-page {
        align-items: flex-start;
        padding: 0;
    }

    .login-container {
        width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-visual {
        min-height: clamp(330px, 48svh, 460px);
        padding: 25px 24px 30px;
    }

    .visual-copy h2 {
        font-size: 32px;
    }

    .smart-art {
        margin-top: 8px;
        border-radius: 16px;
        aspect-ratio: 16 / 10;
    }

    .login-box {
        padding: 32px 22px 34px;
    }

    .login-heading {
        margin-top: 28px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}


/* ============================================================
   Pagamentos — navegação e separação visual dos gateways
   ============================================================ */
.eyebrow-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-header-subtitle {
    margin: 6px 0 0;
    color: var(--gray-600);
    font-size: 13px;
}

.gateway-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.gateway-switcher-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 14px 16px;
    color: var(--gray-800);
    text-decoration: none;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(31, 45, 61, .06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.gateway-switcher-link:hover,
.gateway-switcher-link:focus-visible {
    color: var(--gray-800);
    border-color: var(--primary-color);
    box-shadow: 0 7px 18px rgba(0, 102, 204, .12);
    transform: translateY(-1px);
}

.gateway-switcher-link.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, .12), 0 7px 18px rgba(0, 102, 204, .12);
}

.gateway-switcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    color: var(--white);
    font-size: 18px;
}

.gateway-switcher-icon--sumup { background: linear-gradient(135deg, #f58220, #e95d0f); }
.gateway-switcher-icon--mercadopago { background: linear-gradient(135deg, #009ee3, #0077b6); }

.gateway-switcher-link strong,
.gateway-switcher-link small {
    display: block;
}

.gateway-switcher-link strong { font-size: 14px; }
.gateway-switcher-link small { margin-top: 4px; color: var(--gray-600); font-size: 12px; }
.gateway-switcher-arrow { margin-left: auto; color: var(--gray-400); font-size: 12px; }
.gateway-switcher-link.active .gateway-switcher-arrow { color: var(--primary-color); }

.gateway-config-card .card-header {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom-color: #d8e9f8;
}

.gateway-config-card .card-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.gateway-form-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -4px 0 20px;
    padding: 13px 15px;
    color: #075985;
    background: #eff9ff;
    border: 1px solid #bae6fd;
    border-radius: 9px;
}

.gateway-form-intro > i { font-size: 21px; }
.gateway-form-intro strong,
.gateway-form-intro small { display: block; }
.gateway-form-intro small { margin-top: 3px; color: #4b7188; font-size: 12px; }

.gateway-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-200);
}

.gateway-info-card .card-header h4,
.gateway-status-card .card-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.gateway-code-block {
    display: block;
    padding: 9px 10px;
    color: var(--gray-800);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.gateway-help-text {
    margin: 10px 0 14px;
    color: var(--gray-600);
    font-size: 12px;
    line-height: 1.55;
}

.gateway-info-note,
.gateway-info-highlight {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 14px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.gateway-info-note { color: #24516f; background: #eff8ff; border: 1px solid #cfe8f8; }
.gateway-info-note--warning { color: #73520a; background: #fff8df; border-color: #f5d77a; }
.gateway-info-note i,
.gateway-info-highlight > i { margin-top: 2px; }
.gateway-info-highlight { color: #075985; background: #eff9ff; border: 1px solid #bae6fd; }
.gateway-info-highlight strong,
.gateway-info-highlight span { display: block; }
.gateway-info-highlight span { margin-top: 3px; color: #4b7188; }
.gateway-status-card { margin-top: 16px; }
.gateway-status-action { border-top: 1px solid #eee; padding-top: 10px; }

.gateway-environment-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.gateway-environment-badge.is-production { color: #166534; background: #dcfce7; }
.gateway-environment-badge.is-sandbox { color: #92400e; background: #fef3c7; }

@media (max-width: 768px) {
    .gateway-switcher { grid-template-columns: 1fr; gap: 10px; }
    .gateway-switcher-link { min-height: 68px; }
    .gateway-submit-row { justify-content: stretch; }
    .gateway-submit-row .btn { width: 100%; }
}

@media (max-width: 480px) {
    .gateway-switcher-link { padding: 12px; }
    .gateway-switcher-icon { width: 38px; height: 38px; flex-basis: 38px; }
}
