/**
 * ERP - Sistema de Gestão Empresarial
 * Design Futurista Moderno
 */

/* ===== VARIÁVEIS CSS ===== */
:root {
    /* Cores Primárias - Tema Escuro Futurista */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2332;
    --bg-card: #151d2e;
    --bg-card-hover: #1c2538;
    
    /* Cores de Destaque - Neon/Cyberpunk */
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-success: #00ff88;
    --accent-warning: #ffaa00;
    --accent-danger: #ff4757;
    --accent-info: #00d4ff;
    
    /* Cores de Texto */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Bordas e Sombras */
    --border-color: #2d3748;
    --border-glow: rgba(0, 212, 255, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    /* Tipografia */
    --font-primary: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Espaçamento */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== RESET E BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background com gradiente e padrão */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Grid de fundo sutil */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* ===== TIPOGRAFIA ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

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

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-logo i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.sidebar-logo span {
    background: linear-gradient(90deg, var(--accent-primary), #9b8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--spacing-xl);
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    opacity: 0.8;
    border-left: 2px solid var(--border-color);
    margin-left: var(--spacing-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid transparent;
    font-weight: 500;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
    border-radius: 0 2px 2px 0;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.12), transparent);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
    border-color: rgba(0, 212, 255, 0.2);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: inherit;
    transition: transform var(--transition-fast);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    background: rgba(10, 14, 23, 0.45);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-level {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-logout {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: #fff;
    border-color: rgba(255, 71, 87, 0.4);
    background: rgba(255, 71, 87, 0.12);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--spacing-xl);
    min-height: 100vh;
    width: calc(100% - 260px);
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border-color);
    gap: var(--spacing-xl);
    flex-wrap: wrap;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
}

.page-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding-left: var(--spacing-md);
}

.page-title h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #0099cc);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #00cc6a);
    color: var(--bg-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #cc3344);
    color: white;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-lg);
}

.form-row .form-group {
    margin-bottom: 0;
}

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

.form-label.required::after {
    content: ' *';
    color: var(--accent-danger);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

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

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-xl);
}

/* Input com ícone */
.input-group {
    position: relative;
}

.input-group-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.form-control.has-icon {
    padding-left: calc(var(--spacing-md) * 2 + 20px);
}

/* ===== TABELAS ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-danger {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.badge-info {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ===== ESTATÍSTICAS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-glow);
}

.stat-card.success::before {
    background: var(--accent-success);
}

.stat-card.warning::before {
    background: var(--accent-warning);
}

.stat-card.danger::before {
    background: var(--accent-danger);
}

.stat-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
}

.stat-card.success .stat-icon {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-success);
}

.stat-card.warning .stat-icon {
    background: rgba(255, 170, 0, 0.1);
    color: var(--accent-warning);
}

.stat-card.danger .stat-icon {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-danger);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: var(--font-primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ===== MODAIS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ===== TOASTS / NOTIFICAÇÕES ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 16px 24px;
    border-radius: 8px;
    background: #1c2538 !important;
    border: 1px solid #00d4ff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideIn 0.3s ease;
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto;
    color: #ffffff !important;
}

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

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast.success .toast-icon {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-success);
}

.toast.error .toast-icon {
    background: rgba(255, 71, 87, 0.2);
    color: var(--accent-danger);
}

.toast.warning .toast-icon {
    background: rgba(255, 170, 0, 0.2);
    color: var(--accent-warning);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* ===== BUSCA E FILTROS ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-md);
}

.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.table-controls .search-bar {
    flex: 1;
    min-width: min(100%, 320px);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: var(--spacing-sm);
}

.search-bar input:focus {
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.two-column-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-lg);
}

.stack-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.kpi-positive {
    color: var(--accent-success);
}

.kpi-negative {
    color: var(--accent-danger);
}

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

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

.w-100 {
    width: 100%;
}

.table-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.list-compact {
    display: grid;
    gap: var(--spacing-sm);
}

.list-compact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.01);
}

.table .font-mono,
.font-mono {
    font-family: var(--font-mono);
}

@media (max-width: 900px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

.filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* ===== AÇÕES DA TABELA ===== */
.action-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.action-btn.danger:hover {
    color: var(--accent-danger);
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-link.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-xl) + 0.5rem);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 212, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-glow);
}

.login-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: var(--spacing-lg);
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.sidebar-toggle,
.sidebar-toggle-mobile {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover,
.sidebar-toggle-mobile:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.d-none-desktop {
    display: none;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .d-none-desktop {
        display: inline-flex;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-lg);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions {
        width: 100%;
    }

    .table-actions .btn {
        width: 100%;
    }
    
    .modal {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: var(--spacing-md);
    }

    .login-container {
        padding: var(--spacing-md);
    }

    .login-card {
        padding: var(--spacing-lg);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .table th,
    .table td {
        padding: var(--spacing-sm);
    }
}

/* ===== UTILITÁRIOS ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-info { color: var(--accent-primary); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }

.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) * 2;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

/* ===== MÓDULO ESTOQUE ===== */

/* Tabs do Estoque */
.estoque-tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.estoque-tab {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.estoque-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.estoque-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.estoque-tab i {
    font-size: 1rem;
}

/* Filtros do Estoque */
.estoque-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.estoque-filtros select {
    flex: 1;
    min-width: 150px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.estoque-filtros select:hover,
.estoque-filtros select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* Cards de Estatísticas do Estoque */
.estoque-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.estoque-stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.estoque-stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.estoque-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.estoque-stat-icon.estoque {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
}

.estoque-stat-icon.entrada {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
}

.estoque-stat-icon.saida {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-danger);
}

.estoque-stat-icon.baixo {
    background: rgba(255, 170, 0, 0.15);
    color: var(--accent-warning);
}

.estoque-stat-info {
    flex: 1;
}

.estoque-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.estoque-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Alerta de Estoque Baixo */
.alerta-estoque-baixo {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.1) 0%, rgba(255, 71, 87, 0.1) 100%);
    border: 1px solid var(--accent-warning);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.alerta-estoque-baixo .icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 170, 0, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-warning);
    font-size: 1.5rem;
}

.alerta-estoque-baixo .content {
    flex: 1;
}

.alerta-estoque-baixo h4 {
    color: var(--accent-warning);
    margin-bottom: var(--spacing-xs);
}

.alerta-estoque-baixo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Tabela de Estoque */
.estoque-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.estoque-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.estoque-table-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.estoque-table-title i {
    margin-right: var(--spacing-sm);
    color: var(--accent-primary);
}

/* Badge de tipo de movimentação */
.tipo-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tipo-badge.entrada {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
}

.tipo-badge.saida {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-danger);
}

.tipo-badge.ajuste {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-secondary);
}

/* Indicador de estoque */
.estoque-indicador {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.estoque-indicador.negativo {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-danger);
}

.estoque-indicador.baixo {
    background: rgba(255, 170, 0, 0.15);
    color: var(--accent-warning);
}

.estoque-indicador.ok {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
}

/* Responsividade das abas */
@media (max-width: 768px) {
    .estoque-tabs {
        flex-wrap: wrap;
    }
    
    .estoque-tab {
        flex: 1 1 calc(50% - var(--spacing-xs));
        min-width: 120px;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.8rem;
    }
    
    .estoque-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .estoque-filtros {
        flex-direction: column;
    }
    
    .estoque-filtros select {
        width: 100%;
    }
}
