:root {
    --sidebar-width: 260px;
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --dark-bg: #1e293b;
    --dark-sidebar: #0f172a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    background: var(--dark-sidebar) !important;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 2px 8px;
    display: flex;
    align-items: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--primary);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

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

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

/* Tables */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

.table thead th {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 14px;
}

/* Badges */
.badge-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-priority {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Ticket View */
.ticket-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ticket-message {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}

.ticket-message.agent {
    border-right: 3px solid var(--primary);
}

.ticket-message.customer {
    border-right: 3px solid #22c55e;
}

.ticket-message.system {
    border-right: 3px solid #94a3b8;
    background: #f8fafc;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-card .card-body {
    padding: 40px;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 280px;
}

/* Filters bar */
.filters-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Sidebar toggle for mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* SLA breach colors */
.sla-ok { color: #22c55e; }
.sla-warning { color: #f59e0b; }
.sla-breached { color: #ef4444; }

/* Action buttons */
.btn-action {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

/* Kanban Board */
.kanban-board {
    min-height: 400px;
}

.kanban-column {
    min-width: 300px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deal-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Activity timeline */
.activity-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* RTL adjustments */
.dropdown-menu-end {
    left: 0;
    right: auto;
}
