/* ============================================
   CALLTRACK PRO - Dashboard Styles
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --sidebar-bg: #1e1b4b;
    --sidebar-width: 250px;
    --topbar-height: 60px;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    margin: 0;
    color: var(--gray-800);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand i { font-size: 24px; color: var(--primary-light); }

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-nav .nav-link.active { background: var(--primary); color: white; }
.sidebar-nav .nav-link i { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info i { font-size: 28px; }
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; }

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

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-area { padding: 24px; }

/* ---- Stat Cards ---- */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s;
}

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

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-600);
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 8px;
}

.bg-primary-light { background: #eef2ff; color: var(--primary); }
.bg-success-light { background: #ecfdf5; color: var(--success); }
.bg-danger-light { background: #fef2f2; color: var(--danger); }
.bg-warning-light { background: #fffbeb; color: var(--warning); }
.bg-info-light { background: #eff6ff; color: var(--info); }

/* ---- Cards ---- */
.card-custom {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

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

.card-custom .card-header-custom h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
}

.card-custom .card-body-custom { padding: 20px; }

/* ---- Tables ---- */
.table-custom {
    width: 100%;
    font-size: 13px;
}

.table-custom th {
    background: var(--gray-50);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.table-custom td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table-custom tr:hover { background: var(--gray-50); }

/* ---- Call Type Badges ---- */
.badge-call-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-incoming { background: #dcfce7; color: #166534; }
.badge-outgoing { background: #dbeafe; color: #1e40af; }
.badge-missed { background: #fee2e2; color: #991b1b; }
.badge-rejected { background: #fef3c7; color: #92400e; }

/* ---- Device Status ---- */
.device-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.device-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-online { background: var(--success); }
.dot-offline { background: var(--gray-200); }
.dot-warning { background: var(--warning); }

/* ---- Filters Bar ---- */
.filters-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filters-bar .form-control,
.filters-bar .form-select {
    border-radius: 8px;
    font-size: 13px;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .brand i { font-size: 40px; color: var(--primary); }
.login-card .brand h2 { margin-top: 10px; font-weight: 700; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stat-card .stat-value { font-size: 22px; }
    .filters-bar { flex-direction: column; }
    .filters-bar > * { width: 100%; }
}

/* ---- Utility ---- */
.text-truncate-custom {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state i { font-size: 48px; opacity: 0.3; }
/* Hide sidebar scrollbar */
.sidebar {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}