/* BrewMS - Sistema de Gestão para Cervejaria */
/* Estilo moderno com tema escuro */

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

:root {
    /* Cores principais */
    --primary: #d4a439;
    --primary-dark: #b8922e;
    --primary-light: #e8c166;
    
    /* Cores de fundo */
    --bg-dark: #0f1419;
    --bg-card: #1a1f26;
    --bg-sidebar: #151a20;
    --bg-input: #242b35;
    
    /* Cores de texto */
    --text-primary: #e7e9ea;
    --text-secondary: #8b98a5;
    --text-muted: #6e7681;
    
    /* Cores de status */
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --info: #58a6ff;
    
    /* Bordas e sombras */
    --border: #30363d;
    --shadow: rgba(0, 0, 0, 0.3);
    
    /* Dimensões */
    --sidebar-width: 240px;
    --header-height: 60px;
    --border-radius: 8px;
}

/* Reset básico */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(212, 164, 57, 0.08) 0%, transparent 100%);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #e8c166, #d4a439);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav li {
    margin: 2px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: all 0.18s ease;
    font-size: 0.9rem;
    font-weight: 450;
    min-height: 44px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: rgba(212, 164, 57, 0.35);
    transform: translateX(2px);
}

.nav-link.active {
    background: rgba(212, 164, 57, 0.12);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: overlayIn 0.2s ease;
}

.sidebar-overlay.active {
    display: block;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== MOBILE MENU ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 101;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px 0;
    transition: 0.25s ease;
    border-radius: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card__header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.card__body {
    padding: 20px;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Dashboard Metrics */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.metric-card {
    border-top: 3px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.metric-card .card__body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.metric-icon {
    width: 52px;
    height: 52px;
    background: rgba(212, 164, 57, 0.1);
    border: 1px solid rgba(212, 164, 57, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.metric-info {
    min-width: 0;
}

.metric-info h3 {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

/* ===== TABELAS ===== */
.table-controls {
    margin-bottom: 16px;
}

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

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

.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

.data-table .loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: var(--bg-dark);
    font-weight: 600;
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 16px rgba(212, 164, 57, 0.35);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
}

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

.btn--secondary:hover {
    background: var(--border);
}

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

.btn--danger:hover {
    opacity: 0.9;
}

.btn--info {
    background: #17a2b8;
    color: white;
}

.btn--info:hover {
    background: #138496;
}

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

.btn--google {
    background: white;
    color: #333;
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
}

.btn--google:hover {
    background: #f5f5f5;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 164, 57, 0.12);
}

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

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Input Group (CEP, etc) */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    white-space: nowrap;
}

.form-section {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.form-section-header h4 {
    font-weight: 500;
}

.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filters-row .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

/* ===== MODAIS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalOverlayIn 0.2s ease;
}

.modal.active {
    display: flex;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content--small {
    max-width: 400px;
}

.modal-content--large {
    max-width: 700px;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.modal-footer--wrap {
    flex-wrap: wrap;
    justify-content: center;
}

.modal-footer--wrap .btn {
    margin: 4px;
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: 0 4px 12px var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast--success {
    border-left: 4px solid var(--success);
}

.toast--error {
    border-left: 4px solid var(--danger);
}

.toast--warning {
    border-left: 4px solid var(--warning);
}

.toast--info {
    border-left: 4px solid var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge--pendente {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.status-badge--pago {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.status-badge--cancelado {
    background: rgba(248, 81, 73, 0.2);
    color: var(--danger);
}

.status-badge--ativo {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.status-badge--inativo {
    background: rgba(110, 118, 129, 0.2);
    color: var(--text-muted);
}

.status-badge--orcamento {
    background: rgba(88, 166, 255, 0.2);
    color: var(--info);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #080c10;
    overflow: hidden;
    position: relative;
}

/* Background com orbs animados */
.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 12s ease-in-out infinite alternate;
}

.login-bg__orb--1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 164, 57, 0.18) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    animation-duration: 14s;
}

.login-bg__orb--2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(63, 185, 80, 0.10) 0%, transparent 70%);
    bottom: -100px;
    right: -80px;
    animation-duration: 10s;
    animation-delay: -4s;
}

.login-bg__orb--3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 164, 57, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 60%;
    animation-duration: 18s;
    animation-delay: -8s;
}

@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 40px) scale(1.08); }
}

/* Bolhas flutuantes */
.login-bg__bubbles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -10%;
    animation: bubbleRise linear infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes bubbleRise {
    0%   { transform: translateY(0) rotate(0deg); opacity: var(--op, 0.1); }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* Container e card */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(26, 31, 38, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 164, 57, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    animation: cardAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header do card */
.login-header {
    text-align: center;
    padding: 44px 32px 28px;
    background: linear-gradient(180deg, rgba(212, 164, 57, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(212, 164, 57, 0.2), rgba(212, 164, 57, 0.05));
    border: 1px solid rgba(212, 164, 57, 0.35);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(212, 164, 57, 0.15);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(212, 164, 57, 0.15); }
    50%       { box-shadow: 0 4px 32px rgba(212, 164, 57, 0.30); }
}

.login-logo__icon {
    font-size: 2rem;
    line-height: 1;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #e8c166, #d4a439);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

/* Corpo */
.login-body {
    padding: 28px 32px 24px;
}

/* Botão Google */
.btn--google {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
    letter-spacing: 0.1px;
}

.btn--google:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn--google:active {
    transform: translateY(0);
}

/* Divisor */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 20px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* Labels do formulário */
.login-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Input com ícone */
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.login-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
}

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

.login-input:focus {
    background: rgba(212, 164, 57, 0.05);
    border-color: rgba(212, 164, 57, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 164, 57, 0.1);
}

.login-input:focus + .login-input-icon,
.login-input-wrap:focus-within .login-input-icon {
    color: var(--primary);
}

/* Botão mostrar/ocultar senha */
.login-toggle-pw {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.login-toggle-pw:hover {
    color: var(--text-primary);
}

/* Botão de submit */
.btn--login {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #e8c166, #c8952a);
    color: #0f1419;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.btn--login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn--login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 164, 57, 0.4);
}

.btn--login:hover::before {
    opacity: 1;
}

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

/* Loading state */
.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 20, 25, 0.3);
    border-top-color: #0f1419;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.btn--login.loading .btn-text {
    opacity: 0.6;
}

.btn--login.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Erro */
.error-message {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.4);
    color: #ff7b74;
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Rodapé */
.login-footer {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}


/* ===== VENDA ITENS ===== */
.venda-item {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr auto;
    gap: 8px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    align-items: center;
}

.venda-item select,
.venda-item input {
    padding: 8px;
    font-size: 0.875rem;
}

.venda-item .btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

.venda-totais {
    text-align: right;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    margin-top: 12px;
}

.venda-totais-row {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin: 4px 0;
}

.venda-totais-row.total {
    font-size: 1.1rem;
    color: var(--primary);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 8px;
}

/* ===== VISUALIZAÇÃO DE PEDIDO ===== */
.pedido-view {
    padding: 20px;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.pedido-empresa h2 {
    margin: 0;
    color: var(--primary);
}

.pedido-empresa p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.pedido-info h3 {
    margin: 0;
    color: var(--text-primary);
}

.pedido-info p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pedido-dados {
    margin-bottom: 20px;
}

.pedido-dados-row {
    margin: 6px 0;
    color: var(--text-primary);
}

.pedido-dados-row strong {
    color: var(--text-secondary);
}

.pedido-itens-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

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

.pedido-itens-table th {
    background: var(--bg-input);
    font-weight: 500;
    color: var(--text-secondary);
}

.pedido-itens-table td {
    color: var(--text-primary);
}

.pedido-totais {
    text-align: right;
    margin-top: 20px;
}

.pedido-totais-row {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin: 6px 0;
    color: var(--text-primary);
}

.pedido-totais-row.total {
    font-size: 1.2rem;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    padding-top: 12px;
    margin-top: 12px;
}

.pedido-observacoes {
    margin-top: 20px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
}

.pedido-observacoes strong {
    color: var(--text-secondary);
}

.pedido-observacoes p {
    margin: 8px 0 0;
    color: var(--text-primary);
}

/* ===== PRODUCT IMAGE ===== */
.product-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: var(--bg-input);
}

/* ===== FORM SECTIONS ===== */
.form-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.form-section-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

/* ===== FILTERS ROW ===== */
.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters-row .form-group {
    min-width: 150px;
}

/* ===== DASHBOARD ACTIONS ===== */
.dashboard-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ===== REPORT TOGGLE ===== */
.report-toggle {
    display: flex;
    gap: 8px;
}

/* ===== REPORT GRID ===== */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 992px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== IMAGE UPLOAD ===== */
.image-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: var(--bg-input);
    transition: border-color 0.2s ease;
}

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

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 8px;
}

.image-upload-actions {
    display: flex;
    gap: 8px;
}

.image-upload .uploading {
    position: relative;
}

.image-upload .uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== UTILITIES ===== */
.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

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

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

/* ===== RESPONSIVE ===== */

/* Tablet: sidebar fica oculta mas não some completamente */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-content {
        padding: 20px;
    }
}

/* Previne vazamento de tela horizontal e auto-zoom */
html, body, .app-layout {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* ===== TOPBAR MOBILE ===== */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    z-index: 95;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.user-role-badge {
    background: rgba(212, 164, 57, 0.15);
    color: var(--primary);
    border: 1px solid rgba(212, 164, 57, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    /* CRÍTICO: Previne auto-zoom no iOS Safari e Android Chrome */
    input, select, textarea, .form-control, .login-input {
        font-size: 16px !important;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 200;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 72px 14px 28px !important;
        max-width: 100vw;
        width: 100%;
        overflow-x: hidden;
    }

    /* Tabelas e cards */
    .card {
        max-width: 100%;
        overflow: hidden;
    }

    .card__body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
    }

    .data-table {
        font-size: 0.85rem;
        min-width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 18px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header-actions, .dashboard-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .page-header-actions .btn, .dashboard-actions .btn {
        width: 100%;
        min-height: 44px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Redesenho de Itens de Venda no Mobile */
    .venda-item {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 14px !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        position: relative !important;
        margin-bottom: 12px !important;
    }

    .venda-item select.item-produto,
    .venda-item select.item-embalagem {
        grid-column: span 2 !important;
        min-height: 44px !important;
    }

    .venda-item input.item-quantidade,
    .venda-item input.item-preco {
        min-height: 44px !important;
    }

    .venda-item input.item-subtotal {
        grid-column: span 2 !important;
        font-weight: 700 !important;
        color: var(--primary) !important;
        background: rgba(212, 164, 57, 0.08) !important;
        min-height: 44px !important;
    }

    .venda-item .btn-remove {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(248, 81, 73, 0.15) !important;
        border-radius: 8px !important;
        color: var(--danger) !important;
        font-size: 1.2rem !important;
    }

    /* Redesenho de Modais para Bottom Sheet / Full Drawer */
    .modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .modal-content, .modal-content--large, .modal-content--fullscreen {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        z-index: 10;
        padding: 12px 16px;
        flex-wrap: nowrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-height: 46px;
    }
    
    /* Touch targets */
    .btn {
        min-height: 44px;
    }

    .btn--sm {
        min-height: 40px;
        min-width: 40px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .action-buttons {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filters-row .form-group {
        width: 100%;
        min-width: 100%;
    }

    .nav-link {
        min-height: 48px;
        font-size: 0.95rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
}

/* ===== LOTES - DETALHES ===== */
.lote-detalhes {
    padding: 10px;
}

.lote-detalhes h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.lote-detalhes h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detalhes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 1rem;
}

.detalhe-item {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.detalhe-item strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detalhe-item.highlight {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.detalhe-item.highlight strong {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== FORM SECTIONS ===== */
.form-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.form-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===== BTN INFO ===== */
.btn--info {
    background-color: #17a2b8;
    color: white;
}

.btn--info:hover {
    background-color: #138496;
}

/* ===== ESTOQUE - OBSERVAÇÕES ===== */
.obs-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obs-cell:hover {
    white-space: normal;
    overflow: visible;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 0.9rem;
}

.alert--info {
    background: rgba(23, 162, 184, 0.15);
    border: 1px solid var(--info, #17a2b8);
    color: var(--info, #17a2b8);
}

.alert--warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert--success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert--danger {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ===== REPORT CHARTS GRID ===== */
.report-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

@media (max-width: 900px) {
    .report-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CONFIGURAÇÕES ===== */
.nav-divider {
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.image-preview--logo {
    width: 150px;
    height: 150px;
    border-radius: var(--border-radius);
}

.image-preview--logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Preview do Pedido */
.pedido-preview {
    background: #fff;
    color: #333;
    padding: 24px;
    border-radius: var(--border-radius);
    border: 2px dashed var(--border);
}

.pedido-header-preview {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pedido-header-preview .logo-preview {
    flex: 0 0 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #f5f5f5;
    border-radius: 8px;
}

.pedido-header-preview .logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.pedido-header-preview .info-preview {
    flex: 1;
}

.pedido-header-preview .info-preview h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.pedido-header-preview .info-preview p {
    color: #666;
    font-size: 0.9rem;
    margin: 2px 0;
}

/* Botão grande */
.btn--lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

/* Logo da empresa no pedido */
.pedido-empresa {
    display: flex;
    align-items: center;
    gap: 16px;
}

.empresa-logo {
    flex: 0 0 60px;
}

.empresa-logo img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.empresa-info h2 {
    color: var(--primary);
    margin: 0 0 4px 0;
}

.empresa-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 2px 0;
}

/* ===== PAGE HEADER ACTIONS ===== */
.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== MODAL FULLSCREEN ===== */
.modal-content--fullscreen {
    max-width: 95vw;
    width: 1200px;
    max-height: 95vh;
}

.modal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== CATÁLOGO ===== */
.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 8px;
}

.catalogo-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.catalogo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.catalogo-foto {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-input);
}

.catalogo-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.catalogo-card:hover .catalogo-foto img {
    transform: scale(1.05);
}

.catalogo-info {
    padding: 16px;
}

.catalogo-nome {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.catalogo-estilo {
    display: inline-block;
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.catalogo-descricao {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.catalogo-embalagens {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.catalogo-embalagem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.catalogo-embalagem:last-child {
    border-bottom: none;
}

.embalagem-icon {
    font-size: 1.5rem;
}

.embalagem-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.embalagem-info strong {
    color: var(--text-primary);
    font-weight: 500;
}

.embalagem-estoque {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.embalagem-preco {
    font-weight: 600;
    color: var(--success);
    font-size: 1.1rem;
}

/* Catálogo vazio */
.catalogo-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.catalogo-empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.catalogo-empty h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

/* Responsivo catálogo */
@media (max-width: 768px) {
    .catalogo-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content--fullscreen {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .page-header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .page-header-actions .btn {
        width: 100%;
    }

    /* ===== TABELAS RESPONSIVAS EM FORMATO CARD (MOBILE) ===== */
    .card__body {
        padding: 12px;
        overflow-x: visible !important;
    }

    .data-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
    }

    .data-table thead {
        display: none !important; /* Esconde cabeçalho de tabela clássico */
    }

    .data-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .data-table tbody tr {
        display: flex !important;
        flex-direction: column !important;
        background: #181d24 !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        padding: 14px 16px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
        gap: 8px !important;
        transition: border-color 0.2s ease;
    }

    .data-table tbody tr:hover {
        border-color: var(--primary) !important;
    }

    .data-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        font-size: 0.92rem !important;
        text-align: right !important;
        word-break: break-word;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        margin-right: 12px;
        flex-shrink: 0;
    }

    /* Primeira linha: Destaque do nome ou foto */
    .data-table td:first-child {
        padding-top: 0 !important;
    }

    .data-table td:first-child strong {
        font-size: 1.05rem;
        color: var(--primary-light);
    }

    /* Linha de ações no card */
    .data-table td:last-child {
        border-bottom: none !important;
        padding-top: 10px !important;
        padding-bottom: 0 !important;
        justify-content: flex-end !important;
    }

    .data-table td:last-child::before {
        display: none !important;
    }

    .data-table td:last-child .action-buttons {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .data-table td:last-child .action-buttons .btn {
        flex: 1;
        padding: 10px 14px;
        font-size: 0.88rem;
        text-align: center;
        justify-content: center;
    }

    .data-table .product-img {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        object-fit: cover;
    }

    /* Caso especial: tabela vazia */
    .data-table td[colspan] {
        justify-content: center !important;
        text-align: center !important;
        padding: 30px 0 !important;
        border: none !important;
    }

    .data-table td[colspan]::before {
        display: none !important;
    }
}

