/* =====================================================
   ISP InterSat - Estilos principales
   ===================================================== */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed: 60px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f1f5f9;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light);
    color: #334155;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #e2e8f0;
    transition: width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 64px;
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.sidebar-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border-left-color: var(--primary);
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #475569;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Top Navbar */
.top-navbar {
    background: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 64px;
}

.sidebar-toggle {
    color: #475569 !important;
    text-decoration: none;
    padding: 0.25rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Page Content */
.page-content {
    padding: 1.5rem;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--secondary);
    margin-top: 0.125rem;
}

/* Data Cards */
.data-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.data-card .card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-card .card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.data-card .card-body {
    padding: 1.25rem;
}

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

.table {
    font-size: 0.875rem;
}

.table th {
    font-weight: 600;
    color: #475569;
    border-bottom-width: 2px;
    white-space: nowrap;
    background: #f8fafc;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f1f5f9;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-action {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}

/* Badge */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-color: #d1d5db;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--dark);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary);
    font-size: 0.85rem;
}

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

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h3 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 700;
}

.login-card .subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    .sidebar .sidebar-brand,
    .sidebar .sidebar-link span,
    .sidebar .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
}

/* Select2 Override */
.select2-container--default .select2-selection--single {
    border-color: #d1d5db;
    height: 38px;
    padding: 4px 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

/* Client Detail */
.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-label {
    width: 160px;
    font-weight: 500;
    color: #64748b;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: #1e293b;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
