/* ============================================================
   GLIVVO ERP - CSS PRINCIPAL
   Tema claro: sidebar teal escura + conteúdo cinza claro
   ============================================================ */

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

:root {
    /* CONTEÚDO: cinza claro */
    --bg-primary: #eef1f5;
    --bg-secondary: #e2e6ec;
    --bg-card: #ffffff;
    --bg-input: #f5f7fa;
    --bg-hover: #e8ebf0;

    /* SIDEBAR: teal escuro */
    --sidebar-bg: #00404F;
    --sidebar-border: #005566;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: #005566;

    /* TEXTO: escuro e legível */
    --text-primary: #1a1a2e;
    --text-secondary: #374151;
    --text-muted: #6b7280;

    /* CORES DE DESTAQUE */
    --accent: #007A99;
    --accent-hover: #006080;
    --green: #16a34a;
    --red: #dc2626;
    --yellow: #d97706;
    --orange: #FF6F00;
    --purple: #FF6F00;

    /* BORDAS */
    --border: #d1d5db;
    --border-light: #e5e7eb;

    /* LAYOUT */
    --sidebar-width: 220px;
    --header-height: 56px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv01', 'cv02', 'cv03', 'cv04', 'ss01', 'ss03', 'tnum';
    font-optical-sizing: auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================================
   SIDEBAR (mantém azul escuro)
   ============================================================ */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex; align-items: center; gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: white;
}

.sidebar-logo .logo-text {
    font-size: 15px; font-weight: 700; color: #e2e8f0;
    line-height: 1.2;
}

.sidebar-logo .logo-text small {
    font-size: 11px; font-weight: 400; color: #64748b;
    display: block;
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; margin: 2px 0;
    border-radius: 8px; color: #FFFFFF;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: #FFFFFF; }
.nav-item.active { background: var(--accent); color: white; }
.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }

@keyframes badgePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.85;transform:scale(1.1)} }
.badge-neon {
    background: #F97316; color: #FFFFFF;
    font-size: 12px; font-weight: 800;
    padding: 2px 8px; border-radius: 10px;
    margin-left: auto; line-height: 1.4;
    box-shadow: 0 0 8px rgba(249,115,22,0.5), 0 0 16px rgba(249,115,22,0.2);
    animation: badgePulse 2s infinite;
}

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

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

.user-info .avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
}

.user-info .name { font-size: 13px; font-weight: 500; color: #e2e8f0; }
.user-info .role { font-size: 11px; color: #64748b; }

/* ============================================================
   MAIN CONTENT (cinza claro)
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 24px 28px;
    background: var(--bg-primary);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 22px; font-weight: 700; color: var(--text-primary);
}

.page-header .actions { display: flex; gap: 10px; align-items: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    border: none; cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--yellow); color: white; }
.btn-outline {
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-hover); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-group { display: flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex; gap: 0; border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px; font-size: 13.5px; font-weight: 500;
    color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all 0.15s;
    position: relative;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

.tab .badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--red); color: white;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 5px;
    margin-left: 6px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.data-table thead th {
    padding: 13px 16px; text-align: left;
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: #374151;
    background: #e8ecf1;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap; cursor: pointer;
    user-select: none;
}

.data-table thead th:hover { color: var(--accent); background: #dce3ec; }

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.12s;
}

.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table tbody tr:nth-child(odd) { background: #ffffff; }
.data-table tbody tr:hover { background: #e0eaff !important; }

.data-table tbody td {
    padding: 11px 16px; font-size: 13.5px;
    color: #1e293b;
    vertical-align: middle;
    line-height: 1.4;
}

.data-table .col-action { width: 90px; text-align: center; }
.data-table .col-number { text-align: right; }
.data-table .col-center { text-align: center; }

.text-red { color: #dc2626 !important; font-weight: 700; }
.text-green { color: #16a34a !important; font-weight: 700; }
.text-yellow { color: #ca8a04 !important; font-weight: 600; }
.text-blue { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700 !important; }
.font-mono { font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace; letter-spacing: .3px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: 12px; border: 1px solid var(--border-light);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

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

.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.stat-card .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

/* ============================================================
   FORMS / INPUTS
   ============================================================ */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%; padding: 9px 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary);
    font-size: 13.5px; font-family: inherit;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

input::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.input-icon { position: relative; }
.input-icon input { padding-left: 36px; }
.input-icon .icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); font-size: 16px;
}

.search-bar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 16px;
}

.search-bar input { max-width: 400px; }

.checkbox-wrapper {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--accent);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none; justify-content: center; align-items: center;
    z-index: 1000;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 90%; max-width: 700px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}

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

.modal-header h2 { font-size: 17px; font-weight: 600; color: var(--text-primary); }

.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-hover); border-radius: 8px;
    cursor: pointer; color: var(--text-muted);
    border: none; font-size: 18px;
}

.modal-close:hover { background: var(--red); color: white; }

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

/* Modal de erro (expedição) */
.modal-error { background: var(--red); border: 3px solid #b91c1c; }
.modal-error .modal-header { border-bottom-color: rgba(255,255,255,0.2); }
.modal-error h2, .modal-error p { color: white; }
.modal-error .error-icon { font-size: 80px; text-align: center; color: white; margin-bottom: 16px; }
.modal-error .error-msg { font-size: 22px; font-weight: 700; text-align: center; color: white; margin-bottom: 24px; }

/* ============================================================
   PAYMENT MODAL
   ============================================================ */
.payment-row {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 10px;
    padding: 10px; background: var(--bg-input);
    border-radius: 8px; border: 1px solid var(--border-light);
}

.payment-row select { max-width: 200px; }
.payment-row input { max-width: 160px; }

.payment-total {
    font-size: 24px; font-weight: 700;
    text-align: right; padding: 16px 0;
    border-top: 2px solid var(--border);
    color: var(--text-primary);
}

/* ============================================================
   VENDA EDITOR
   ============================================================ */
.venda-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px; height: calc(100vh - 120px); overflow: hidden;
}

.venda-main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.venda-main > h2 { flex-shrink: 0; }
.pedido-scroll-area { flex: 1; overflow-y: auto; min-height: 0; }

.venda-sidebar {
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    padding: 20px; overflow-y: auto; min-height: 0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.venda-footer {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 0; flex-shrink: 0;
    border-top: 2px solid #e2e8f0; background: var(--bg-primary);
}
.venda-footer .venda-total { margin-left: auto; }

.venda-total { font-size: 28px; font-weight: 700; color: var(--text-primary); }

/* ── Search area (Novo Pedido) ── */
.pedido-search-area {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.pedido-search-area:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37,99,235,.08), 0 2px 8px rgba(0,0,0,.04);
}
.pedido-search-input {
    font-size: 16px !important;
    padding: 14px 18px !important;
    font-weight: 500 !important;
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #0f172a !important;
    letter-spacing: .2px;
}
.pedido-search-input:focus {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
.pedido-search-input::placeholder { color: #94a3b8 !important; font-weight: 400 !important; }
.pedido-search-filters { display: none; /* Oculto — cascata inteligente substitui os filtros manuais */ }
.pedido-search-filters select {
    font-size: 13px !important; padding: 8px 12px !important;
    border-radius: 8px !important; background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important; color: #475569 !important;
    font-weight: 500 !important;
}

/* ── Search results ── */
.search-result-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; margin-bottom: 4px;
    background: #ffffff; border-radius: 10px;
    border: 1px solid #e2e8f0;
    cursor: pointer; transition: all .15s;
    position: relative;
}
.search-result-item:hover {
    background: #eff6ff; border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37,99,235,.08);
    transform: translateY(-1px);
}
.search-result-item .sr-img {
    width: 44px; height: 44px; min-width: 44px;
    background: #f1f5f9; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.search-result-item .sr-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-item .sr-info { flex: 1; min-width: 0; }
.search-result-item .sr-name { font-size: 14px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .sr-meta { font-size: 12px; color: #64748b; margin-top: 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-result-item .sr-code { font-family: 'SF Mono', 'Consolas', monospace; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #475569; }
.search-result-item .sr-stock { font-weight: 700; }
.search-result-item .sr-stock.low { color: #dc2626; }
.search-result-item .sr-stock.ok { color: #16a34a; }
.search-result-item .sr-price { font-size: 15px; font-weight: 800; color: #1e293b; white-space: nowrap; min-width: 90px; text-align: right; }
.search-result-item .sr-add-badge { position: absolute; top: -6px; right: -6px; background: #22c55e; color: white; font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 700; display: none; }
.search-result-item.already-in-cart .sr-add-badge { display: block; }
.search-result-item.already-in-cart { border-color: #86efac; background: #f0fdf4; }

/* ── Cart section ── */
.cart-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; margin-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.cart-section-header h4 {
    margin: 0; font-size: 15px; font-weight: 700; color: #1e293b;
}
.cart-badge {
    background: var(--accent); color: white;
    padding: 3px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 700;
}
.cart-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; margin-bottom: 6px;
    background: #ffffff; border-radius: 10px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: background .1s;
}
.cart-item:hover { background: #f8fafc; }
.cart-item:nth-child(even) { background: #fafbfd; }
.cart-item:nth-child(even):hover { background: #f1f5f9; }

.cart-item .item-img {
    width: 48px; height: 48px; min-width: 48px;
    background: #f1f5f9; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.cart-item .item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item .item-info { flex: 1; min-width: 0; }
.cart-item .item-name { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.3; }
.cart-item .item-code { font-size: 12px; color: #64748b; margin-top: 2px; }
.cart-item .item-price { font-size: 15px; font-weight: 800; text-align: right; color: #1e293b; white-space: nowrap; }

.cart-item .item-remove {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: #ef4444; color: white;
    border-radius: 50%; border: none;
    font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
}

.cart-item:hover .item-remove { opacity: 1; }

/* ============================================================
   EXPEDIÇÃO
   ============================================================ */
.scanner-input {
    font-size: 28px !important;
    padding: 18px 24px !important;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 700;
    border: 3px solid var(--accent) !important;
    min-height: 60px;
}

.scanner-input:focus {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2);
}

.separar-list, .separado-list {
    border: 2px solid var(--border);
    border-radius: 10px; overflow: hidden;
    min-height: 30vh; max-height: 50vh; overflow-y: auto;
}

.separar-item, .separado-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px; font-size: 17px;
    border-bottom: 1px solid var(--border-light);
}
.separar-item .font-bold, .separado-item .font-bold {
    font-size: 17px; font-weight: 700;
}
.separar-item .sep-qtd, .separado-item .sep-qtd {
    font-size: 20px; font-weight: 700; white-space: nowrap;
}

.separar-item:last-child, .separado-item:last-child { border-bottom: none; }
.separado-item { background: rgba(22, 163, 74, 0.06); }

/* ============================================================
   TRANSFERÊNCIA
   ============================================================ */
.transfer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px; padding: 16px;
    margin-bottom: 12px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.transfer-card.delayed {
    border-color: var(--yellow);
    background: rgba(217, 119, 6, 0.04);
}

.transfer-timer { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.transfer-timer.expired { color: var(--red); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex; justify-content: center; gap: 6px;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 6px 12px; border-radius: 6px;
    font-size: 13px; border: 1px solid var(--border);
    color: var(--text-secondary); background: var(--bg-card);
}

.pagination a:hover { background: var(--bg-hover); }
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}

.toast {
    padding: 14px 20px; border-radius: 12px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    animation: slideIn 0.3s ease;
    max-width: 420px;
    display: flex; align-items: center; gap: 6px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

.toast-success { background: var(--green); color: white; }
.toast-error { background: var(--red); color: white; }
.toast-info { background: var(--accent); color: white; }
.toast-warning { background: var(--yellow); color: white; }

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

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash { padding: 12px 20px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #003D4D 0%, #00404F 50%, #002B38 100%);
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px; padding: 48px;
    width: 100%; max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.2);
}

.login-card .logo {
    text-align: center; margin-bottom: 32px;
}

.login-card .logo h1 {
    font-size: 24px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card .logo p {
    font-size: 13px; color: var(--text-muted); margin-top: 6px;
}

/* ============================================================
   DROPDOWN MENU (3 Pontinhos)
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-trigger {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); border-radius: 6px;
    font-size: 16px;
}

.dropdown-trigger:hover { background: var(--bg-hover); color: var(--text-primary); }

.dropdown-menu {
    position: absolute; right: 0; top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px; min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none; z-index: 200;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; white-space: nowrap;
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================================
   DROPDOWN ACOES (Tabela de Produtos)
   ============================================================ */
.dropdown-acoes { position: relative; display: inline-block; }
.dropdown-acoes .dropdown-toggle { cursor: pointer; font-size: 12px; }
.dropdown-acoes .dropdown-menu {
    position: absolute; right: 0; top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 6px; min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none; z-index: 300;
}
.dropdown-acoes.open .dropdown-menu { display: block; }
.dropdown-acoes .dropdown-menu a {
    display: block; padding: 8px 12px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; white-space: nowrap;
}
.dropdown-acoes .dropdown-menu a:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-acoes .dropdown-menu a.text-red { color: var(--red); }
.dropdown-acoes .dropdown-menu a.text-red:hover { background: rgba(220,38,38,0.06); }

/* ============================================================
   INPUT PREFIX / SUFFIX
   ============================================================ */
.input-prefix,
.input-suffix {
    display: flex; align-items: center;
    border: 1px solid var(--border); border-radius: 8px;
    overflow: hidden; background: var(--bg-card);
}
.input-prefix span,
.input-suffix span {
    padding: 8px 10px; font-size: 13px; font-weight: 600;
    color: var(--text-muted); background: var(--bg-input);
    white-space: nowrap; border: none;
}
.input-prefix input,
.input-suffix input {
    flex: 1; border: none !important; border-radius: 0 !important;
    background: transparent !important; padding: 8px 10px; min-width: 0;
}
.input-prefix input:focus,
.input-suffix input:focus { outline: none; box-shadow: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .venda-layout { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 120px); overflow: visible; }
    .pedido-scroll-area { overflow: visible; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.inp-sfx { display:flex;align-items:center;border:1px solid var(--border);border-radius:6px;overflow:hidden;background:var(--bg-card) }
.inp-sfx input { border:none;outline:none;padding:6px 8px;flex:1;font-size:12px;background:transparent;color:var(--text-primary);width:100%;min-width:0 }
.inp-sfx span { padding:6px 8px;font-size:11px;color:var(--text-muted);background:var(--bg-input);border-left:1px solid var(--border);white-space:nowrap }

/* ============================================================
   SISTEMA DE MENSAGENS PROFISSIONAL (padrão expedição)
   ============================================================ */
#sysMsgOverlay { z-index: 10001; }
#sysMsgModal {
    animation: msgPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 16px;
}
@keyframes msgPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* Botão principal — fundo branco, texto na cor do modal (igual expedição) */
.sysMsg-btn {
    background: white;
    color: var(--red); /* sobrescrito inline por JS com a cor do tema */
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    min-width: 130px;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sysMsg-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.sysMsg-btn:active { transform: scale(0.97); }
/* Botão ghost — para "Cancelar" no showConfirm */
.sysMsg-btn-ghost {
    background: rgba(255,255,255,0.15);
    color: white !important;
    box-shadow: none;
    border: 2px solid rgba(255,255,255,0.4);
}
.sysMsg-btn-ghost:hover {
    background: rgba(255,255,255,0.25);
    box-shadow: none;
}

/* ============================================================
   ADMIN FOOTER
   ============================================================ */
.admin-footer {
    background: linear-gradient(180deg, #f0f2f6 0%, #e2e6ec 100%);
    border-top: 2px solid #d1d5db;
    margin-top: 60px;
    padding: 40px 32px 32px;
    text-align: center;
}
.admin-footer-inner {
    max-width: 800px;
    margin: 0 auto;
}
.admin-footer-brand {
    font-size: 20px;
    font-weight: 800;
    color: #00404F;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}
.admin-footer-brand span {
    color: var(--accent, #007A99);
    margin: 0 4px;
}
.admin-footer-line {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.8;
}
.admin-footer-line strong {
    color: #374151;
    font-weight: 700;
}

/* ============================================================
   BUSCA INTELIGENTE EM CASCATA — Cards de subcategoria (Novo Pedido)
   Visual escuro igual ao site público
   ============================================================ */
.cascade-pedido {
    background: #0f172a;
    border-radius: 14px;
    padding: 28px 20px 20px;
    text-align: center;
}
.cascade-pedido-header {
    margin-bottom: 20px;
}
.cascade-pedido-header .cascade-pedido-icon {
    font-size: 40px;
    color: #3b82f6;
    opacity: .7;
    display: block;
    margin-bottom: 6px;
}
.cascade-pedido-header .cascade-pedido-title {
    font-size: 20px;
    font-weight: 800;
    color: #e8edf5;
    margin: 0 0 6px;
}
.cascade-pedido-header .cascade-pedido-subtitle {
    font-size: 13px;
    color: #7b8ba5;
    margin: 0 0 2px;
}
.cascade-pedido-header .cascade-pedido-subtitle strong {
    color: #3b82f6;
}
.cascade-pedido-header .cascade-pedido-info {
    font-size: 11px;
    color: #7b8ba5;
    opacity: .7;
}
.cascade-pedido-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    max-width: 640px;
    margin: 0 auto 16px;
}
.cascade-pedido-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px;
    background: #1a2237;
    border: 1px solid #243049;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.cascade-pedido-card:hover {
    border-color: #3b82f6;
    background: rgba(59,130,246,.08);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.cascade-pedido-card .material-icons-round {
    font-size: 28px;
    color: #3b82f6;
}
.cascade-pedido-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #e8edf5;
    line-height: 1.2;
}
.cascade-pedido-card-count {
    font-size: 11px;
    color: #7b8ba5;
    font-weight: 500;
}
.cascade-pedido-vertodos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid #243049;
    color: #7b8ba5;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;
}
.cascade-pedido-vertodos:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59,130,246,.06);
}

/* ============================================================
   GRID DE PRODUTOS — Visual escuro estilo site (Novo Pedido)
   ============================================================ */
.pedido-prod-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #0f172a;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #7b8ba5;
}
.pedido-prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    background: #0f172a;
    padding: 12px 14px 16px;
    border-radius: 0 0 14px 14px;
}
.pedido-prod-card {
    background: #1a2237;
    border: 1px solid #243049;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
.pedido-prod-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
.pedido-prod-card.in-cart {
    border-color: #22c55e;
}
.pedido-prod-card.out-of-stock {
    opacity: .5;
    cursor: default;
    border-color: #ef4444;
}
.pedido-prod-card.out-of-stock:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.pedido-prod-cart-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: #22c55e;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
    letter-spacing: .3px;
}
.pedido-prod-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #ffffff;
    display: block;
}
.pedido-prod-img-placeholder {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141b2d;
    color: #7b8ba5;
    font-size: 32px;
}
.pedido-prod-img-placeholder .material-icons-round {
    font-size: 36px;
}
.pedido-prod-info {
    padding: 10px 12px 12px;
}
.pedido-prod-code {
    font-size: 11px;
    color: #7b8ba5;
    font-weight: 500;
}
.pedido-prod-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8edf5;
    margin: 3px 0 6px;
    line-height: 1.3;
    word-break: break-word;
}
.pedido-prod-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245,158,11,.12);
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
}
.pedido-prod-stock {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
}
.pedido-prod-stock.ok { color: #22c55e; }
.pedido-prod-stock.low { color: #ef4444; }
.pedido-prod-price {
    font-size: 18px;
    font-weight: 800;
    color: #f59e0b;
    font-family: 'Outfit', sans-serif;
}
.pedido-prod-btn {
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: filter .2s;
}
.pedido-prod-btn:hover {
    filter: brightness(1.15);
}
.pedido-prod-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: #0f172a;
    border-radius: 14px;
    color: #7b8ba5;
    font-size: 14px;
    text-align: center;
}
