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

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background: #1f2937;
    color: white;
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-backdrop {
    display: none;
}

.sidebar.collapsed {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    padding: 20px 10px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.toggle-sidebar {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toggle-sidebar:hover {
    background: #374151;
    color: white;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.collapsed .section-title {
    visibility: hidden; /* Hide text but preserve spacing */
}

.sidebar.collapsed .nav-text {
    display: none;
}

.logo {
    margin-bottom: 0;
}

.logo h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.logo p {
    font-size: 12px;
    color: #9ca3af;
}

.nav-menu {
    list-style: none;
}

.nav-section {
    margin-bottom: 20px;
    list-style: none;
}

.section-title {
    display: block;
    padding: 6px 14px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.section-items {
    list-style: none;
    padding-left: 0;
}

.section-items li {
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
    font-size: 13px;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.nav-item:hover {
    background: #374151;
    color: white;
    transform: translateX(4px);
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: #4f46e5;
    color: white;
}

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

/* Tooltip для свернутого sidebar */
.sidebar.collapsed .nav-item {
    position: relative;
    justify-content: center;
}

/* Убираем transform при collapsed чтобы не было эффекта открытия */
.sidebar.collapsed .nav-item:hover {
    transform: none;
}

.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px;
    background: #4f46e5;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease, visibility 0.1s ease;
    transition-delay: 0s;
    visibility: hidden;
    z-index: 99999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
    transition-delay: 0s !important;
}

/* Адаптация main-content при collapsed sidebar */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
    width: calc(100vw - 70px);
}

/* Main Content */
.main-content {
    margin-left: 220px;
    width: calc(100vw - 220px);
    min-height: 100vh;
    transition: all 0.3s ease;
    background: #1a1a1a;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0;
}

/* Dashboard grid - with padding */
.dashboard-grid {
    padding: 1.2rem;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* KPI and charts sections */
.kpi-section,
.charts-section {
    max-width: 100%;
    margin: 1rem 0;
}

.content-body {
    padding: 1.5rem;
}

/* Force all children to respect container width */
.main-content *,
.content-body *,
.dashboard-grid * {
    box-sizing: border-box;
}

.main-content > *,
.content-body > *,
.dashboard-grid > *,
.main-content .row > *,
.dashboard-grid .row > * {
    max-width: 100%;
}

/* Адаптивный контейнер */
.main-content .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 0;
    padding-right: 0;
}

.kpi-section,
.charts-section {
    max-width: 100%;
    overflow: hidden;
}

.chart-card,
.kpi-card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Restrict all rows to stay within container */
.main-content .row,
.content-body .row,
.dashboard-grid .row {
    max-width: 100%;
}

.main-content [class*="col-"],
.content-body [class*="col-"],
.dashboard-grid [class*="col-"] {
    min-width: 0;
}

/* Ensure Bootstrap container doesn't overflow */
.main-content .container,
.main-content .container-fluid {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Dashboard grid уже определен выше с padding */

/* Card должны оставаться внутри своих контейнеров */
.card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tables must be responsive */
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

/* Ensure tables don't cause horizontal overflow */
.main-content table,
.main-content .table {
    max-width: 100%;
    width: 100%;
    table-layout: auto;
}

/* Data table container */
#dataTableContainer,
#branchStatsTable {
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

/* Branch stats table with fixed header and scroll */
#branchStatsTable {
    height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}

#branchStatsTable table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#branchStatsTable thead th {
    position: sticky;
    top: 0;
    background: #2a2a2a;
    z-index: 10;
    border-bottom: 2px solid #404040;
}

.header {
    background: #2a2a2a;
    border-bottom: 1px solid #404040;
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.page-description {
    background: #2a2a2a;
    border-bottom: 1px solid #404040;
    padding: 0.75rem 1.5rem;
    margin-bottom: 0;
}

.page-description:empty {
    display: none;
    margin: 0;
    padding: 0;
}

/* AppBar - текст и фильтры в одну строку */
.page-description .d-flex {
    flex-wrap: nowrap;
    gap: 1.5rem !important;
    align-items: center;
    overflow-x: auto;
}

.page-description .d-flex > span {
    white-space: nowrap;
    flex-shrink: 0;
}

.page-description .d-flex > div:last-child {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: center;
}

.filter-item-appbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.filter-item-appbar label {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
    margin-bottom: 0;
}

.filter-item-appbar select {
    min-width: 150px;
    max-width: 200px;
}

/* Cards */
.card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-bottom: 16px;
    border: 1px solid #404040;
}

.card h2, .card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.card-header {
    background: #3a3a3a;
    color: #ffffff;
    border-bottom: 1px solid #404040;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.card-body {
    color: #e0e0e0;
    padding: 16px;
    font-size: 13px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    gap: 16px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.stat-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid #404040;
}

.stat-icon {
    font-size: 20px;
}

.stat-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin: 0 0 4px 0;
}

.stat-content p {
    color: #9ca3af;
    font-size: 11px;
    margin: 0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 11px;
    color: #9ca3af;
}

/* KPI Cards Section - Новый дизайн с яркими цветами */
.kpi-section {
    margin-bottom: 16px;
    max-width: 100%;
    overflow: hidden;
}

.kpi-card {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-height: 85px;
    max-width: 100%;
    box-sizing: border-box;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Цветные границы для разных KPI */
.kpi-card:nth-child(1) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.05) 100%);
}

.kpi-card:nth-child(2) {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.kpi-card:nth-child(3) {
    border-color: #06b6d4;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.kpi-card:nth-child(4) {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.kpi-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.kpi-card:nth-child(1) .kpi-icon {
    background: rgba(102, 126, 234, 0.2);
}

.kpi-card:nth-child(2) .kpi-icon {
    background: rgba(16, 185, 129, 0.2);
}

.kpi-card:nth-child(3) .kpi-icon {
    background: rgba(6, 182, 212, 0.2);
}

.kpi-card:nth-child(4) .kpi-icon {
    background: rgba(245, 158, 11, 0.2);
}

.kpi-content {
    flex: 1;
}

.kpi-content h6 {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 3px 0;
    line-height: 1.1;
}

.kpi-card:nth-child(1) .kpi-value {
    color: #667eea;
}

.kpi-card:nth-child(2) .kpi-value {
    color: #10b981;
}

.kpi-card:nth-child(3) .kpi-value {
    color: #06b6d4;
}

.kpi-card:nth-child(4) .kpi-value {
    color: #f59e0b;
}

.kpi-change {
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
}

.kpi-change.positive {
    color: #10b981;
}

.kpi-change.negative {
    color: #ef4444;
}

.kpi-change.neutral {
    color: #9ca3af;
}

/* Chart Cards - для дашбордов с графиками */
.chart-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #404040;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    height: 280px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Activity calendar - wider buttons to match chart height */
.activity-calendar-container {
    height: 240px;
    overflow-y: auto;
}

.activity-calendar-container .calendar-day {
    width: 48px !important;
    height: 40px !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.activity-calendar-container .calendar-header {
    font-size: 13px !important;
    margin-bottom: 8px !important;
}

/* Map container - match chart height */
#map {
    height: 240px !important;
    width: 100%;
}

/* Geography container - match chart height */
#geographyChart,
.geography-container {
    height: 240px !important;
    width: 100%;
}

/* Branch chart - ensure same height as map */
#branchChart {
    height: 240px !important;
}

.chart-card h6, .chart-card h5, .chart-card h4,
.card-header h6 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

/* Ensure canvas elements in charts don't overflow */
.chart-card canvas {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
}

/* Container elements for non-canvas charts */
.chart-card > div {
    max-width: 100%;
    box-sizing: border-box;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #404040;
}

.status-count {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

/* Status Badges */
.status-badge, .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
}

.status-sent, .badge.bg-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-replied, .badge.bg-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-promo_sent, .badge.bg-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.badge.bg-primary {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.badge.bg-secondary {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e0e0;
}

.table {
    color: #e0e0e0;
}

thead {
    background: #3a3a3a;
}

th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #9ca3af;
    border-bottom: 2px solid #404040;
}

td {
    padding: 12px;
    border-bottom: 1px solid #404040;
    font-size: 13px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

tbody tr {
    border-bottom: 1px solid #404040;
}

/* Buttons */
.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63428b 100%);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
    background: #6b7280;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #10b981;
}

/* Inputs */
.search-input, .filter-select {
    padding: 8px 14px;
    border: 1px solid #404040;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    max-width: 300px;
    background: #2a2a2a;
    color: #ffffff;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #667eea;
    background: #3a3a3a;
}

.form-control, .form-select {
    background: #2a2a2a;
    border: 1px solid #404040;
    color: #ffffff;
    font-size: 13px;
}

.form-control:focus, .form-select:focus {
    background: #3a3a3a;
    border-color: #667eea;
    color: #ffffff;
}

.page-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

/* Conversation */
.conversation-container {
    max-width: 1200px;
}

.client-info-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.client-details p {
    margin-bottom: 8px;
    color: #4b5563;
}

.client-actions {
    margin-top: 16px;
}

.messages-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message {
    margin-bottom: 20px;
    display: flex;
}

.message-outgoing {
    justify-content: flex-end;
}

.message-outgoing .message-content {
    background: #4f46e5;
    color: white;
}

.message-incoming .message-content {
    background: #f3f4f6;
    color: #1f2937;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
}

.message-type {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.message-text {
    margin-bottom: 6px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
}

.template-message {
    padding: 8px 0;
}

.template-message.promo {
    background: rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 8px;
}

.template-message code {
    background: rgba(0,0,0,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.button-message {
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

.no-messages {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    gap: 8px;
}

.pagination .btn, .pagination button {
    min-width: 35px;
    height: 35px;
    padding: 6px 10px;
    font-size: 12px;
}

.pagination .page-info {
    color: #9ca3af;
    font-size: 12px;
    padding: 0 12px;
}

/* Webhook Logs */
.log-item {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #404040;
}

.log-time {
    font-weight: 600;
    margin-bottom: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.log-payload {
    background: #1a1a1a;
    color: #4ade80;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

/* Override Bootstrap Grid with CSS Grid */
.dashboard-grid .row,
.main-content .row {
    display: grid;
    gap: 1rem;
    margin: 0 !important;
    padding: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Default: single column */
.dashboard-grid .row {
    grid-template-columns: 1fr;
}

/* KPI section: 4 columns */
.kpi-section .row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Charts: 2 columns */
.charts-section .row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Bootstrap columns should fill grid cells */
.dashboard-grid [class*="col-"],
.main-content [class*="col-"] {
    max-width: none !important;
    width: 100% !important;
    flex: 1 !important;
    margin: 0 !important;
}

/* Remove Bootstrap default row margins and padding */
.row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
}

/* Add padding to cards inside grid */
.dashboard-grid .kpi-card,
.dashboard-grid .chart-card {
    padding: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .kpi-section .row {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-section .row {
        grid-template-columns: 1fr;
    }
}

/* Full-width rows (single item) */
.dashboard-grid .row > .col-12,
.dashboard-grid .row > .col-md-12,
.dashboard-grid .row > .col-lg-12 {
    grid-column: 1 / -1;
}

.g-4 {
    --bs-gutter-x: 16px;
    --bs-gutter-y: 16px;
}

.mb-4 {
    margin-bottom: 16px !important;
}

/* Loading indicators */
.main-content-loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.3) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
}

.main-content-loading.hidden {
    display: none !important;
}

.dashboard-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dashboard-loading-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
}

.dashboard-loading-subtext {
    color: #9ca3af;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
    max-width: 500px;
    padding: 0 20px;
}

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 42, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.chart-loading.hidden {
    display: none !important;
}

.chart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.chart-loading-text {
    color: #ffffff;
    font-size: 13px;
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .main-content {
        margin-left: 180px;
        width: calc(100vw - 180px);
    }

    .content-body {
        padding: 16px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }

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

    .mobile-menu-toggle {
        display: inline-block;
    }

    .header h1 {
        font-size: 18px;
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
    }

    .content-body {
        padding: 12px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .message-content {
        max-width: 100%;
    }

    .card,
    .stat-card {
        padding: 14px;
    }

    /* KPI Cards responsive */
    .kpi-card {
        padding: 16px;
    }

    .kpi-icon {
        font-size: 28px;
        width: 50px;
        height: 50px;
    }

    .kpi-value {
        font-size: 24px;
    }

    .kpi-content h6 {
        font-size: 11px;
    }

    .kpi-change {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .kpi-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }

    .kpi-icon {
        font-size: 24px;
        width: 45px;
        height: 45px;
        margin: 0 auto;
    }

    .kpi-value {
        font-size: 20px;
    }

    .kpi-content h6 {
        font-size: 10px;
    }

    .kpi-change {
        font-size: 11px;
    }
}
