:root {
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #0f172a;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================
   NAVBAR - Optimizado para POS
========================================== */
.nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s;
}

.nav-brand:hover {
    color: #1e3a8a;
}

.nav-brand i {
    font-size: 22px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #1e40af;
}

.nav-link.active {
    color: #1e40af;
    background-color: #eff6ff;
}

/* Dropdown styles */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle .dropdown-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.nav-dropdown.active .dropdown-icon,
.dropdown-menu.show ~ .dropdown-toggle .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-width: 220px;
    margin-top: 8px;
    padding: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #1e40af;
}

.dropdown-item.active {
    background-color: #eff6ff;
    color: #1e40af;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 56px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: left;
        transition: left 0.3s;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 16px;
        gap: 4px;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    .nav-menu.show {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin-top: 4px;
        padding: 0;
        padding-left: 16px;
        display: none;
    }

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-toggle .dropdown-icon {
        margin-left: auto;
    }
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
    min-height: 48px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 40px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--light);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background-color: var(--light);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-icon {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 10px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
    }
}
