/* SLM Blaster v2.0 - Modern SaaS Theme */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --darker: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-active: #4f46e5;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #94a3b8;
    --radius: 0.75rem;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: none; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, var(--darker) 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--primary);
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-header p {
    color: rgba(255,255,255,0.7);
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    text-align: center;
    padding: 0 2rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.form-control {
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--text);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

.form-select {
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Input groups */
.input-group-text {
    border: 1.5px solid var(--border);
    background: var(--body-bg);
    color: var(--secondary);
    border-radius: 0.5rem 0 0 0.5rem;
    font-size: 0.85rem;
}

.input-group .form-control {
    border-left: 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.input-group .form-control:focus {
    border-color: var(--primary);
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary);
    color: var(--primary);
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    border-color: var(--primary);
}

.form-check-label {
    font-size: 0.85rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.2rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,0.35); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-outline-secondary {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--secondary);
}
.btn-outline-secondary:hover {
    background: var(--body-bg);
    border-color: var(--secondary);
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-main {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand span { color: var(--primary); }

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

.navbar-tenant {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--primary-light);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.navbar-user {
    position: relative;
}

.navbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
}

.navbar-user-btn:hover { background: var(--body-bg); }

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: var(--sidebar-bg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.sidebar-brand-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand-text small {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-section {
    padding: 1rem 1.5rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav .nav-item a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-item.active a {
    color: #fff;
    background: rgba(79, 70, 229, 0.2);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-item a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.sidebar-nav .nav-item.active a i { opacity: 1; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-wrapper {
    margin-left: 250px;
    padding-top: 60px;
    min-height: 100vh;
}

.main-content {
    padding: 1.75rem 2rem;
}

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

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 1.25rem; }
.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--body-bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

a.stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.stat-link:hover {
    color: inherit;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
a.stat-link h3 { color: var(--dark); }
a.stat-link p { color: var(--text-muted); }

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

.stat-icon.purple { background: #eef2ff; color: var(--primary); }
.stat-icon.green  { background: #ecfdf5; color: var(--success); }
.stat-icon.blue   { background: #eff6ff; color: var(--info); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.red    { background: #fef2f2; color: var(--danger); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
    line-height: 1;
}

.stat-info p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table thead th {
    background: var(--body-bg);
    padding: 0.65rem 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-success   { background: #ecfdf5; color: #059669; }
.badge-danger    { background: #fef2f2; color: #dc2626; }
.badge-warning   { background: #fffbeb; color: #d97706; }
.badge-info      { background: #eff6ff; color: #2563eb; }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }
.badge-dark      { background: var(--dark); color: #fff; }

/* Status specific */
.badge-draft    { background: #f1f5f9; color: var(--secondary); }
.badge-starting { background: #eff6ff; color: #2563eb; }
.badge-started  { background: #ecfdf5; color: #059669; }
.badge-pausing  { background: #fffbeb; color: #d97706; }
.badge-paused   { background: #fffbeb; color: #d97706; }
.badge-stopping { background: #fef2f2; color: #dc2626; }
.badge-stopped  { background: #fef2f2; color: #dc2626; }

.badge-online  { background: #ecfdf5; color: #059669; }
.badge-offline { background: #f1f5f9; color: var(--secondary); }
.badge-incall  { background: #fef2f2; color: #dc2626; }

/* ============================================================
   STATUS DOTS
   ============================================================ */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.status-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.offline { background: #cbd5e1; }
.status-dot.incall  { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.1); }
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
    height: 8px;
    background: var(--body-bg);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 1rem;
    background: var(--primary);
    transition: width 0.5s ease;
}

.progress-bar-success { background: var(--success); }
.progress-bar-info    { background: var(--info); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-danger  { background: var(--danger); }

.progress-lg { height: 12px; }
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    color: var(--secondary);
    font-weight: 600;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.25rem 1.5rem;
    border: none;
}

.modal-header .btn-close { filter: invert(1); }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-danger  { background: #fef2f2; color: #dc2626; }
.alert-success { background: #ecfdf5; color: #059669; }
.alert-warning { background: #fffbeb; color: #d97706; }
.alert-info    { background: #eff6ff; color: #2563eb; }

/* ============================================================
   TENANT SELECTOR
   ============================================================ */
.tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.tenant-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.tenant-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tenant-card h4 {
    margin: 0.5rem 0 0.25rem;
    font-weight: 700;
    color: var(--dark);
}

.tenant-card p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   NAV TABS (Reports)
   ============================================================ */
.nav-tabs-modern {
    display: flex;
    gap: 0.25rem;
    background: var(--body-bg);
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.nav-tabs-modern a {
    padding: 0.5rem 1.25rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-tabs-modern a:hover { color: var(--text); background: var(--card-bg); }
.nav-tabs-modern a.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-modern {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination-modern a,
.pagination-modern span {
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.pagination-modern a:hover { background: var(--body-bg); }
.pagination-modern .active {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* ============================================================
   AGENT CARDS GRID
   ============================================================ */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.agent-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.agent-card:hover { box-shadow: var(--shadow-md); }

.agent-card .agent-name { font-weight: 600; font-size: 0.85rem; color: var(--dark); }
.agent-card .agent-ext { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   DROPDOWN (BS5-compatible)
   ============================================================ */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    min-width: 180px;
}

.dropdown-item {
    border-radius: 0.35rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
}

.dropdown-item:hover { background: var(--body-bg); color: var(--primary); }
.dropdown-divider { margin: 0.3rem 0; border-color: var(--border); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.show { transform: translateX(0); }
    .navbar-main { left: 0; }
    .main-wrapper { margin-left: 0; }
}
