:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --secondary-dark: #059669;
    --accent: #8b5cf6;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --success: #22c55e;
    --error: #dc2626;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --border: #cbd5e1;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --sidebar-text: #f1f5f9;
    --sidebar-hover: rgba(51, 65, 85, 0.6);
    --topbar-bg: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    --topbar-text: #ffffff;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dark-mode {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --border: #334155;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #0a101f 100%);
    --sidebar-hover: rgba(51, 65, 85, 0.8);
    --topbar-bg: linear-gradient(90deg, #0f172a 0%, #0a101f 100%);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 15px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 25px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Candara', 'Montserrat', 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    overflow-x: hidden;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    animation: pulse 2s infinite;
}

.logo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    transition: opacity 0.3s;
    background: linear-gradient(to right, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar.collapsed .logo h2 {
    opacity: 0;
    width: 0;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    transition: transform 0.3s;
    background: rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .toggle-sidebar {
    transform: rotate(180deg);
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.menu-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 1px;
    transition: opacity 0.3s;
    margin-top: 10px;
}

.sidebar.collapsed .menu-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    color: var(--sidebar-text);
    text-decoration: none;
    margin: 0 10px;
    border-radius: 8px;
}

.menu-item:hover, .menu-item.active {
    background: var(--sidebar-hover);
    border-left: 3px solid var(--primary);
}

.menu-item i {
    font-size: 1.2rem;
    min-width: 24px;
    margin-right: 16px;
    transition: transform 0.3s;
}

.menu-item:hover i {
    transform: scale(1.1);
}

.menu-item span {
    font-weight: 500;
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    width: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
}

.content-wrapper {
    flex: 1;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--topbar-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 900;
    color: var(--topbar-text);
    height: 80px;
}

.topbar-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 26px;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 3px;
    backdrop-filter: blur(10px);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-light);
    transition: transform 0.3s ease, background 0.3s;
}

.dark-mode .theme-toggle::before {
    transform: translateX(24px);
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    animation: fadeIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.2;
}

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

.stat-card.appointments {
    border-left-color: var(--primary);
}

.stat-card.patients {
    border-left-color: var(--secondary);
}

.stat-card.revenue {
    border-left-color: var(--info);
}

.stat-card.queues {
    border-left-color: var(--warning);
}

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

.stat-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon.appointments {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-icon.patients {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stat-icon.revenue {
    background: rgba(14, 165, 233, 0.1);
    color: var(--info);
}

.stat-icon.queues {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    gap: 5px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 0 30px 30px;
}

.chart-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.5s ease-out;
    transition: var(--transition);
}

.chart-container:hover {
    box-shadow: var(--shadow-lg);
}

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

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-actions {
    display: flex;
    gap: 10px;
}

.chart-actions button {
    background: var(--bg-secondary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.chart-actions button:hover {
    background: var(--primary);
    color: white;
}

.chart-actions button.active {
    background: var(--primary);
    color: white;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Recent Activity */
.activity-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.5s ease-out 0.1s;
    animation-fill-mode: both;
    transition: var(--transition);
}

.activity-container:hover {
    box-shadow: var(--shadow-lg);
}

.activity-list {
    margin-top: 20px;
}

.activity-item {
    display: flex;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    border-radius: 8px;
    padding: 18px 10px;
}

.activity-item:hover {
    background: var(--bg-secondary);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.activity-item:hover .activity-icon {
    transform: scale(1.1);
}

.activity-icon.appointment {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.activity-icon.patient {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.activity-icon.payment {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 6px;
}

.activity-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    animation: fadeIn 0.5s;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

 /* Analytics Section */
.analytics-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s 0.1s;
    animation-fill-mode: both;
}

.analytics-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.analytics-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

.analytics-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.analytics-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.analytics-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.analytics-change {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 5px;
    color: var(--success);
}

/* Patients Table */
.patients-table-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.5s 0.2s;
    animation-fill-mode: both;
    transition: var(--transition);
    overflow: hidden;
}

.patients-table-container:hover {
    box-shadow: var(--shadow-lg);
}

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

.table-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.search-filter {
    display: flex;
    gap: 15px;
}

.search-input {
    padding: 10px 15px 10px 40px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.table-wrapper {
    overflow-x: auto;
}

.patients-table {
    width: 100%;
    border-collapse: collapse;
}

.patients-table th {
    text-align: left;
    padding: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.patients-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.patients-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.03);
}

.patient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn-table {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--success);
}

.view-btn:hover {
    background: var(--success);
    color: white;
    transform: scale(1.1);
}

.edit-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.edit-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.auth-forms {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-form.active {
    display: block;
}

.form-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    color: var(--dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-footer {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid var(--border);
}

/* System Status */
.system-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 30px 30px;
}

.status-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.6s ease-out 0.2s;
    animation-fill-mode: both;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.3s;
}

.status-card:hover .status-icon {
    transform: scale(1.1);
}

.status-icon.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-icon.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.status-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.status-stats {
    display: flex;
    gap: 25px;
}

.status-stat {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -1px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Messages */
.message {
    padding: 16px 50px 16px 20px;
    border-radius: 12px;
    margin: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s ease-out;
    box-shadow: var(--shadow-sm);
    max-width: calc(100% - 60px);
    position: relative;
    transition: var(--transition);
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid var(--success);
}

.message.error {
    background: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--error);
}

.message i {
    font-size: 1.4rem;
}

.message.success i {
    color: var(--success);
}

.message.error i {
    color: var(--error);
}

.message-content {
    font-weight: 500;
}

.close-message {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-message:hover {
    opacity: 1;
    color: var(--text-primary);
}

/* Messaging Module */
.messaging-module {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 500px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.messaging-module.active {
    transform: translateY(0);
}

.messaging-header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messaging-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.messaging-actions {
    display: flex;
    gap: 12px;
}

.messaging-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.messaging-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

.messaging-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.message-item:hover {
    background: var(--bg-secondary);
}

.message-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-sender {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-unread {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 5px;
}

.messaging-input {
    padding: 15px 20px;
    display: flex;
    gap: 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.messaging-input input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.messaging-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    background: var(--primary);
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Notification Tray */
.notification-tray {
    position: fixed;
    top: 90px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-tray.active {
    transform: translateY(0);
}

.notification-header {
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.notification-actions {
    display: flex;
    gap: 12px;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

.notification-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(59, 130, 246, 0.05);
    animation: fadeIn 0.4s;
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.1);
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title-text {
    font-weight: 600;
    margin-bottom: 6px;
}

.notification-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.notification-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-unread {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 5px;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary, #3498db);
    border-radius: 50%;
    width: 15px;
    height: 15px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Footer */
.footer {
    background: var(--bg-card);
    padding: 25px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    animation: fadeIn 0.6s;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.footer-logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar:not(.collapsed) {
        width: 260px;
        z-index: 1000;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .sidebar:not(.collapsed) ~ .main-content {
        margin-left: 260px;
    }

    .messaging-module,
    .notification-tray {
        width: 320px;
        height: 450px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .system-status {
        grid-template-columns: 1fr;
    }

    .topbar-left h1 {
        font-size: 1.5rem;
    }

    .search-box {
        width: 200px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .page-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        height: auto;
        padding: 15px;
    }
    
    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
    }

    .messaging-module,
    .notification-tray {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    .search-filter {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}