:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    
    --bg-main: #0a0e17;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-surface-hover: #26354a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-strong: rgba(255, 255, 255, 0.15);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.15);
    
    --purple: #8b5cf6;
    --purple-light: rgba(139, 92, 246, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.45);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-surface-hover: #edf2f7;
    --border-color: #e2e8f0;
    --border-color-strong: #cbd5e1;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-subtle: #94a3b8;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.08);
}


*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 0.925rem;
}


.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}


.sidebar {
    width: 270px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.brand-text h2 {
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.badge-alert {
    margin-left: auto;
    background-color: var(--danger);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-qr-mobile {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-qr-mobile:hover {
    background: var(--primary);
    color: #ffffff;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-subtle);
    justify-content: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}


.main-content {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
}


.topbar {
    height: 72px;
    padding: 0 2rem;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

.page-title-container h1 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.page-title-container p {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-theme-toggle {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-theme-toggle:hover {
    background-color: var(--bg-surface-hover);
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-strong);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color-strong);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-text:hover {
    text-decoration: underline;
}


.content-body {
    flex: 1;
    padding: 1.75rem 2rem 3rem 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}


.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-strong);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-card.danger .kpi-icon { background-color: var(--danger-light); color: var(--danger); }
.kpi-card.warning .kpi-icon { background-color: var(--warning-light); color: var(--warning); }
.kpi-card.success .kpi-icon { background-color: var(--success-light); color: var(--success); }
.kpi-card.info .kpi-icon { background-color: var(--info-light); color: var(--info); }
.kpi-card.accent .kpi-icon { background-color: var(--purple-light); color: var(--purple); }

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 1.5rem;
    color: var(--text-main);
    margin: 0.2rem 0;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-subtle);
}


.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card-span-2 {
    grid-column: span 2;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.card-title h3 {
    font-size: 1.05rem;
    color: var(--text-main);
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.chart-wrapper {
    height: 260px;
    position: relative;
}

.chart-wrapper-h350 {
    height: 350px;
    position: relative;
    margin-top: 1rem;
}

.chart-wrapper-h250 {
    height: 250px;
    position: relative;
}


.urgent-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
}

.urgent-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--danger);
    transition: var(--transition);
}

.urgent-item-row.warning {
    border-left-color: var(--warning);
}

.urgent-item-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
}

.urgent-item-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.urgent-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.85rem 1rem;
    background-color: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.data-table tr:hover td {
    background-color: var(--bg-surface-hover);
}


.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
}

.badge.critico, .badge.danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.atencao, .badge.warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.ok, .badge.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.info {
    background: var(--info-light);
    color: var(--info);
}


.view-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.search-box {
    position: relative;
    min-width: 280px;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    width: 18px;
    height: 18px;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 2.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.select-input {
    padding: 0.65rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.select-input:focus {
    border-color: var(--primary);
}

.select-large {
    min-width: 250px;
}

.view-mode-toggle {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon.active, .btn-icon:hover {
    background-color: var(--bg-surface-elevated);
    color: var(--text-main);
}


.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-strong);
}

.product-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.product-category-tag {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.product-card-title {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: block;
}


.stock-meter-container {
    margin: 0.75rem 0;
    background: var(--bg-surface-elevated);
    padding: 0.85rem;
    border-radius: var(--radius-md);
}

.stock-meter-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
    margin-bottom: 0.4rem;
}

.stock-meter-header strong {
    font-size: 1rem;
}

.meter-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.meter-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.meter-bar-fill.danger { background: var(--danger); }
.meter-bar-fill.warning { background: var(--warning); }
.meter-bar-fill.success { background: var(--success); }

.stock-meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-top: 0.35rem;
}


.price-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.p-mini-box {
    font-size: 0.75rem;
}

.p-mini-box span {
    color: var(--text-subtle);
    display: block;
}

.p-mini-box strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.quick-stock-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-stock-step {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-strong);
    color: var(--text-main);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-stock-step:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}


.shopping-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.shopping-estimates {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.estimate-item {
    display: flex;
    flex-direction: column;
}

.est-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.est-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.shopping-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.shopping-category-block {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.shopping-category-header {
    padding: 1rem 1.5rem;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.shopping-category-header h3 {
    font-size: 1.05rem;
}

.shopping-item-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition);
}

.shopping-item-row:last-child {
    border-bottom: none;
}

.shopping-item-row:hover {
    background-color: var(--bg-surface-hover);
}

.shopping-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shopping-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-dialog {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 800px; }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}


.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-main);
}

.readonly-badge {
    background: var(--bg-surface-hover);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.installment-box {
    background: var(--bg-surface-elevated);
    border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
}

.installment-calc-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: var(--info);
    font-size: 0.85rem;
    font-weight: 500;
}

.input-with-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-step {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-strong);
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn-step:hover {
    background: var(--primary);
    color: #ffffff;
}

.ajuste-current-badge {
    background: var(--bg-surface-elevated);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}


.sub-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sub-tabs {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3px;
}

.sub-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.sub-tab-btn.active {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

.installment-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-month {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-installment-status {
    display: flex;
    gap: 0.35rem;
}

.btn-chip {
    padding: 0.35rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}


.price-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.metric-card {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
}

.m-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.m-val {
    font-size: 1.5rem;
    margin: 0.25rem 0;
}

.m-sub {
    font-size: 0.75rem;
    color: var(--text-subtle);
}


.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.info-cell {
    background: var(--bg-surface-elevated);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
}

.c-label {
    font-size: 0.725rem;
    color: var(--text-subtle);
    display: block;
}

.price-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.pb-col {
    display: flex;
    flex-direction: column;
}

.pb-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.pb-val {
    font-size: 1.15rem;
    margin: 0.15rem 0;
}

.detail-subtabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.detail-tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
}

.detail-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}


.qr-code-wrapper {
    background: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 1rem 0;
}

.qr-code-wrapper img {
    width: 200px;
    height: 200px;
    display: block;
}


.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color-strong);
    border-left: 4px solid var(--primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toastSlideIn 0.25s ease-out;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}


.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
}

.mobile-nav-btn i {
    width: 20px;
    height: 20px;
}

.mobile-nav-btn.active {
    color: var(--primary);
}


.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }


@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card-span-2 {
        grid-column: span 1;
    }
    
    .form-row, .form-row-3, .detail-info-grid, .price-banner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 1rem;
    }
    
    .topbar-actions span {
        display: none;
    }
    
    .content-body {
        padding: 1rem 1rem 5rem 1rem;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
    
    .shopping-hero-card {
        padding: 1.25rem;
    }
    
    .shopping-actions {
        width: 100%;
    }
    
    .shopping-actions button {
        flex: 1;
    }
}


@media print {
    .sidebar, .topbar, .mobile-bottom-nav, .shopping-actions, .search-filters, .view-mode-toggle, .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .shopping-hero-card, .shopping-category-block {
        border: 1px solid #ccc !important;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}

.badge.prazo {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.chart-wrapper-h300 {
    height: 300px;
    position: relative;
    width: 100%;
}

.select-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.card-duration-chart {
    grid-column: span 1;
}

@media (min-width: 1200px) {
    .card-duration-chart {
        grid-column: span 1;
    }
}

.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.color-swatches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.color-swatch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.color-swatch-btn:hover {
    transform: scale(1.18);
}

.color-swatch-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary);
    transform: scale(1.1);
}

.color-wheel-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    border: 2px solid var(--border-color-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.color-wheel-wrapper:hover {
    transform: scale(1.18);
}

.color-wheel-wrapper input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.icon-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.icon-selector-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary);
}

.icon-preview-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.icon-preview-box i {
    width: 20px;
    height: 20px;
}

.icon-selector-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 0.15rem;
}

.icons-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem;
}

.icon-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.25rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.7rem;
    text-align: center;
}

.icon-option-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.icon-option-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.icon-option-btn i {
    width: 22px;
    height: 22px;
}

.icon-option-btn span {
    display: block;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.input-with-addon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-addon .form-control {
    padding-right: 4.2rem;
}

.input-addon-badge {
    position: absolute;
    right: 0.6rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-strong);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-wrapper-h400 {
    height: 420px;
    position: relative;
    width: 100%;
}
