/* ============================================
   POS ADMIN PANEL - Estilos Principales
   ============================================ */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box .subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-box .logo i {
    font-size: 60px;
    color: var(--primary);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header .version {
    font-size: 11px;
    color: var(--secondary);
    margin-top: 5px;
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.menu-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--white);
    border-left-color: var(--primary);
}

.menu-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

.menu-label {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    background: var(--white);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

.topbar-left .breadcrumb {
    font-size: 13px;
    color: var(--secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--light);
    border-radius: var(--radius);
}

.user-info .avatar {
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.user-info .name {
    font-size: 14px;
    font-weight: 500;
}

.user-info .role {
    font-size: 11px;
    color: var(--secondary);
}

/* Page Content */
.page-content {
    padding: 25px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--dark);
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background: var(--light);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-text {
    padding: 10px 14px;
    background: var(--light);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
    color: var(--secondary);
}

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

.btn i {
    font-size: 16px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #16a34a;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

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

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

.btn-outline:hover {
    background: var(--light);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

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

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

.table th {
    background: var(--light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f8fafc;
}

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

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

.table .actions {
    white-space: nowrap;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

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

.modal-lg {
    max-width: 900px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

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

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

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

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

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--dark);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box .form-control {
    flex: 1;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-card .icon.green {
    background: #dcfce7;
    color: #22c55e;
}

.stat-card .icon.orange {
    background: #ffedd5;
    color: #f97316;
}

.stat-card .icon.red {
    background: #fee2e2;
    color: #ef4444;
}

.stat-card .info h4 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.stat-card .info p {
    font-size: 13px;
    color: var(--secondary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

/* ============================================
   PRODUCT CARD (Grid View)
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card .image {
    height: 150px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 48px;
}

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

.product-card .info {
    padding: 15px;
}

.product-card .category {
    font-size: 11px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card .name {
    font-size: 16px;
    font-weight: 600;
    margin: 5px 0;
    color: var(--dark);
}

.product-card .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.product-card .actions {
    padding: 10px 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

/* ============================================
   CREDITO EMPLEADO
   ============================================ */
.credito-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.credito-card .empleado {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.credito-card .avatar {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
}

.credito-card .empleado-info h4 {
    font-size: 16px;
    font-weight: 600;
}

.credito-card .empleado-info p {
    font-size: 13px;
    color: var(--secondary);
}

.credito-card .saldo {
    background: var(--light);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 15px;
}

.credito-card .saldo .monto {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
}

.credito-card .saldo .label {
    font-size: 12px;
    color: var(--secondary);
    text-transform: uppercase;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .modal {
        margin: 15px;
        max-height: 95vh;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .table th,
    .table td {
        padding: 10px;
        font-size: 13px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-secondary { color: var(--secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
