/* JG SOFT - Centralizador Web CSS (Premium Dark/Light Glassmorphism) */
:root {
    --bg-primary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.85);
    --bg-card-hover: rgba(51, 65, 85, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.5);
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-main: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

/* LOGIN OVERLAY */
#login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-main);
    text-align: center;
}

.login-card img {
    max-width: 160px;
    height: auto;
    margin-bottom: 15px;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 5px;
}

.login-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

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

/* APP MAIN LAYOUT */
#app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: #1e293b; /* POS bg-sidebar */
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    transition: all 0.3s ease;
    z-index: 100;
    color: #f8fafc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand-header img {
    height: 38px;
    width: auto;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.brand-subtitle {
    font-size: 11px;
    color: #cbd5e1;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #334155;
    border-left-color: #2563eb;
}

.nav-item.active {
    background: #0f172a;
    border-left-color: #2563eb;
}

.nav-item i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
    color: #94a3b8;
}

/* MAIN CONTENT */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* TOP NAVBAR */
.navbar {
    height: 65px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title-badge h1 {
    font-size: 18px;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: var(--accent-red);
    color: white;
}

/* DASHBOARD CONTENT CONTAINERS */
.content-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

/* METRIC CARDS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
}

.metric-card:hover {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
}

.metric-info h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.metric-val {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.metric-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.metric-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* CHARTS & PANELS GRID */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* DATA TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.custom-table th {
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* MOBILE RESPONSIVE TOGGLE */
.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.btn-sidebar-close {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 95;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        box-shadow: var(--shadow-main);
        z-index: 100;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .btn-menu-toggle {
        display: block;
    }
    .btn-sidebar-close {
        display: flex;
    }
    .content-body {
        padding: 15px;
    }
}

/* CONSULTOR DE PRECIOS */
.consultor-item-row:hover {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-1px);
}
.consultor-item-row.selected {
    background: rgba(59, 130, 246, 0.22) !important;
    border: 2px solid var(--accent-blue) !important;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.35) !important;
}
