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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Login Page Styles */
body:has(.login-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    animation: slideIn 0.3s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.login-header h1 {
    color: #fd7e14;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #fd7e14;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.3s;
    z-index: 1;
}

.password-toggle:hover {
    color: #fd7e14;
}

.password-toggle:focus {
    outline: 2px solid #fd7e14;
    outline-offset: 2px;
    border-radius: 4px;
}

.eye-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid #fcc;
}

.submit-button {
    background-color: #fd7e14;
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 0.5rem;
}

.submit-button:hover:not(:disabled) {
    background-color: #e66d00;
    transform: translateY(-2px);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background-color: #f5f7fa;
    display: flex;
    position: relative;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    color: #333;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    border-right: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 1rem;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #fd7e14;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background-color: #fff5e6;
}

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

.sidebar-logo {
    height: 50px;
    width: auto;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    text-align: left;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

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

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.menu-item:hover {
    background-color: #fff5e6;
    color: #fd7e14;
}

.menu-item.active {
    background-color: #fff5e6;
    color: #fd7e14;
    border-left-color: #fd7e14;
    font-weight: 600;
}

.menu-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-size: 0.95rem;
}

/* Sidebar Menu Separator */
.sidebar-menu-separator {
    height: 1px;
    background-color: #e0e6ed;
    margin: 0.5rem 1.5rem;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu-separator {
    margin: 0.5rem;
}

/* Bottom Menu (Settings) */
.sidebar-menu-bottom {
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu-bottom .menu-text {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e6ed;
    background: #fff;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.sidebar.collapsed .user-profile {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fd7e14, #1a5490);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.sidebar.collapsed .user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings Page Styles */
.settings-content {
    max-width: 800px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e6ed;
}

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

.settings-item-label {
    flex: 1;
    margin-right: 1rem;
}

.settings-item-label label {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
}

.settings-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.settings-item-control {
    flex-shrink: 0;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 280px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: #fd7e14;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

/* Page Content */
.page-content {
    display: block;
}

.page-content.hidden {
    display: none;
}

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e6ed;
}

.page-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.page-header p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.filter-controls, .sort-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-input, .sort-select, .date-range-select {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Combobox Styles */
.combobox-container {
    position: relative;
    display: inline-block;
}

.combobox-input {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.combobox-input:focus {
    outline: none;
    border-color: #fd7e14;
}

.combobox-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    margin-top: -2px;
}

.combobox-dropdown.show {
    display: block;
}

.combobox-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.combobox-option:last-child {
    border-bottom: none;
}

.combobox-option:hover {
    background-color: #fff5e6;
}

.combobox-option.selected {
    background-color: #fff5e6;
    color: #fd7e14;
    font-weight: 600;
}

.combobox-option.no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
    cursor: default;
}

.combobox-option.no-results:hover {
    background-color: white;
}

.filter-button {
    padding: 0.5rem 1rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.filter-button:hover {
    background-color: #e66d00;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    min-width: 120px;
}

.connection-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffa500;
    animation: pulse 2s infinite;
}

.connection-indicator.connected {
    background-color: #4caf50;
    animation: none;
}

.connection-indicator.disconnected {
    background-color: #f44336;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.connection-text {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
}

.dashboard-header {
    background-color: #ffffff;
    color: #1e293b;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #e0e6ed;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e293b;
    margin: 0;
}

.dashboard-header .logo {
    height: 40px;
    width: auto;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.refresh-button, .logout-button {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #64748b;
}

.refresh-button {
    color: #fd7e14;
    border-color: #fd7e14;
}

.refresh-button:hover {
    background-color: #fff5e6;
    transform: translateY(-1px);
}

.logout-button {
    color: #ef4444;
    border-color: #ef4444;
}

.logout-button:hover {
    background-color: #fef2f2;
}

.dashboard-content {
    width: 100%;
    padding: 1.5rem 2rem;
    max-width: 100%;
}

/* Dashboard Filters */
.dashboard-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.date-range-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.date-range-select:focus {
    outline: none;
    border-color: #fd7e14;
}

.custom-date-range-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-date-range-filter.hidden {
    display: none;
}

.dashboard-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.export-dashboard-btn {
    padding: 0.5rem 1rem;
    background: #fd7e14;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-dashboard-btn:hover {
    background: #e66a00;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e6ed;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:focus {
    outline: 3px solid rgba(33, 150, 243, 0.35);
    outline-offset: 2px;
}

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

.stat-card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 1rem;
}

.stat-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a5490;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.users-analytics-section {
    margin-top: 2rem;
}

.users-analytics-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a5490;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e6ed;
}

.study-stats-details {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
}

.study-stats-details h3 {
    color: #fd7e14;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e6ed;
    padding-bottom: 0.5rem;
}

.study-stats-details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.study-stats-details table th {
    background-color: #f5f7fa;
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: 600;
    color: #333;
}

.study-stats-details table td {
    padding: 10px;
    border: 1px solid #ddd;
    color: #555;
}

.study-stats-details table tr:nth-child(even) {
    background-color: #f9fafb;
}

.study-stats-details table tr:hover {
    background-color: #f0f4f8;
}

.study-overview-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
}

.cell-leader-detail-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e6ed;
    transition: box-shadow 0.3s;
}

.cell-leader-detail-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cell-leader-detail-section .expandable-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e6ed;
    margin-bottom: 1rem;
    user-select: none;
}

.cell-leader-detail-section .expandable-header:hover {
    background-color: #f9fafb;
    border-radius: 4px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.cell-leader-detail-section .expandable-body {
    display: none;
    overflow: visible !important;
    max-height: none !important;
    white-space: normal !important;
    padding: 1rem 0 !important;
    margin-top: 0 !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    transition: none !important;
    color: #1e293b !important;
}

.cell-leader-detail-section .expandable-body.expanded {
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
}

.stat-card h2 {
    color: #fd7e14;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-label {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.stat-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e6ed;
}

.stat-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.stat-detail-label {
    color: #666;
}

.stat-detail-value {
    color: #333;
    font-weight: 600;
}

.stat-detail-value.positive {
    color: #4caf50;
}

.stat-detail-value.negative {
    color: #f44336;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error-state {
    background-color: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #fcc;
}

/* File Access Section */
.files-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.files-section h3 {
    color: #fd7e14;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.file-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-item .file-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.file-button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.file-button.view {
    background-color: #fd7e14;
    color: white;
}

.file-button.download {
    background-color: #333;
    color: white;
}

.file-button:hover {
    opacity: 0.8;
}

/* Cell Leader Selector */
.cell-leader-selector {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    border: 1px solid #e0e6ed;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.cell-leader-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.branch-section {
    margin-bottom: 2rem;
}

.branch-header {
    color: #fd7e14;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e6ed;
}

.branch-leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.cell-leader-card {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.cell-leader-card:hover {
    border-color: #fd7e14;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cell-leader-card.selected {
    border-color: #fd7e14;
    background-color: #fff5e6;
}

.cell-leader-card.has-attendance {
    background-color: #e8f5e9;
    border-color: #81c784;
}

.cell-leader-card.has-attendance:hover {
    border-color: #66bb6a;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.cell-leader-card.no-attendance {
    background-color: #ffebee;
    border-color: #ef9a9a;
}

.cell-leader-card.no-attendance:hover {
    border-color: #e57373;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.cell-leader-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.cell-leader-email {
    color: #666;
    font-size: 0.7rem;
    margin-bottom: 0;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.selected-leader-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.cell-leader-attendance-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-top: 2rem;
    border: 1px solid #e0e6ed;
}

.cell-leader-attendance-section.hidden {
    display: none;
}

.leader-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.leader-stat-item {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.leader-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #fd7e14;
}

.leader-stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Attendance List */
.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.attendance-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e6ed;
}

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

.attendance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.attendance-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attendance-date {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.attendance-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fd7e14;
}

.bulk-checkbox {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.attendance-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.attendance-detail-item {
    display: flex;
    flex-direction: column;
}

.attendance-detail-label {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.attendance-detail-value {
    color: #333;
    font-weight: 500;
}

.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.member-tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.member-tag-present {
    background-color: #c8e6c9;
    color: #2e7d32;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.member-tag-absent {
    background-color: #ffcdd2;
    color: #c62828;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.member-tag-other {
    background-color: #bbdefb;
    color: #1565c0;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.expandable-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.expandable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.expandable-header:hover {
    background-color: #f5f5f5;
}

.expandable-title {
    font-weight: 600;
    color: #333;
}

.expandable-toggle {
    color: #fd7e14;
    font-size: 1.2rem;
}

.expandable-body {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    color: #666;
    white-space: pre-wrap;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-body.expanded {
    max-height: 500px;
}

.media-section {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.media-item {
    flex: 1;
    min-width: 200px;
}

.photo-thumbnail {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
}

.audio-player {
    width: 100%;
    margin-top: 0.5rem;
}

.audio-player audio {
    width: 100%;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.media-button {
    padding: 0.5rem 1rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.media-button:hover {
    background-color: #e66d00;
}

/* Photo Lightbox */
.photo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.photo-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-actions {
    margin-top: 1rem;
    text-align: center;
}

.lightbox-button {
    padding: 0.75rem 1.5rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

/* Bulk Operations */
.bulk-action-toolbar {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bulk-action-toolbar.hidden {
    display: none;
}

.selection-counter {
    font-weight: 600;
    color: #333;
    margin-right: auto;
}

.bulk-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.bulk-button:hover {
    opacity: 0.8;
}

.export-button {
    background-color: #4caf50;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.export-button:hover:not(:disabled) {
    opacity: 0.8;
}

.export-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.download-button {
    background-color: #2196f3;
    color: white;
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0;
    top: 100%;
    left: 0;
}

.export-dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

.export-dropdown-content a:hover {
    background-color: #f5f5f5;
}

/* Keep dropdown visible when hovering over button OR dropdown content */
.export-dropdown:hover .export-dropdown-content,
.export-dropdown-content:hover {
    display: block;
}

/* Analytics */
.analytics-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.custom-date-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.custom-date-range.hidden {
    display: none;
}

.analytics-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analytics-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.5rem;
    color: #1a5490;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0e6ed;
    position: relative;
}

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

.chart-card h3 {
    color: #fd7e14;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    flex: 1;
}

.help-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.help-icon:hover {
    background: #1a5490;
    color: white;
    border-color: #1a5490;
}

.chart-card canvas {
    max-height: 300px;
}

.chart-card #attendanceMap {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e8f4f8;
}

.chart-card #attendanceMap .error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    padding: 2rem;
    text-align: center;
}

/* Custom marker styles */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Chart Help Modal */
.chart-help-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.chart-help-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chart-help-modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chart-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.chart-help-header h3 {
    margin: 0;
    color: #1a5490;
    font-size: 1.3rem;
}

.chart-help-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.chart-help-close:hover {
    background: #f0f0f0;
    color: #333;
}

.chart-help-body {
    padding: 1.5rem;
}

.chart-help-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #333;
}

.chart-help-body strong {
    color: #1a5490;
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chart-export-button {
    padding: 0.5rem 1rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Real-time Notification */
.realtime-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    display: none;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.realtime-notification.show {
    display: block;
}

.realtime-notification.error {
    background-color: #f44336;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    margin: 0.5rem 0;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* View All Attendance Button */
.view-all-attendance-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.view-all-attendance-btn:hover {
    background-color: #e66d00;
}

/* All Attendance Modal */
.all-attendance-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
}

.all-attendance-modal.active {
    display: block;
}

.all-attendance-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1400px;
    margin: 2rem auto;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.all-attendance-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.all-attendance-modal-header h2 {
    color: #fd7e14;
    margin: 0;
    font-size: 1.5rem;
}

.all-attendance-modal-body {
    padding: 1.5rem;
}

/* Latest Study Card */
.latest-study-card {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border: 2px solid #fd7e14;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.latest-study-card h3 {
    color: #fd7e14;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.study-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.study-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.study-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.study-category {
    background-color: #fd7e14;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.study-dates {
    color: #666;
}

/* Attendance List in Modal */
.attendance-list-modal {
    margin-top: 1.5rem;
}

.attendance-list-title {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

.attendance-card-modal {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0e6ed;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.attendance-card-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.attendance-date-modal {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.attendance-cell-leader {
    font-size: 0.85rem;
    color: #666;
}

.attendance-percentage-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fd7e14;
}

.attendance-details-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.attendance-detail-item-modal {
    display: flex;
    flex-direction: column;
}

.attendance-detail-label-modal {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.attendance-detail-value-modal {
    color: #333;
    font-weight: 500;
}

.members-list-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.expandable-content-modal {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.expandable-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.expandable-header-modal:hover {
    background-color: #f5f5f5;
}

.expandable-title-modal {
    font-weight: 600;
    color: #333;
}

.expandable-toggle-modal {
    color: #fd7e14;
    font-size: 1.2rem;
}

.expandable-body-modal {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    color: #666;
    white-space: pre-wrap;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-body-modal.expanded {
    max-height: 500px;
}

.media-section-modal {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.media-item-modal {
    flex: 1;
    min-width: 200px;
}

.photo-thumbnail-modal {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

.photo-thumbnail-modal:hover {
    transform: scale(1.05);
}

.audio-player-modal {
    width: 100%;
    margin-top: 0.5rem;
}

.audio-player-modal audio {
    width: 100%;
}

.media-actions-modal {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.media-button-modal {
    padding: 0.5rem 1rem;
    background-color: #fd7e14;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.media-button-modal:hover {
    background-color: #e66d00;
}

.no-attendance {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 80px;
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.collapsed ~ .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
    
    .cell-leader-list {
        grid-template-columns: 1fr;
    }
    
    .analytics-dashboard {
        gap: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .attendance-details {
        grid-template-columns: 1fr;
    }
    
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls, .sort-controls {
        width: 100%;
        flex-direction: column;
    }
    
    .filter-controls input, .sort-controls select {
        width: 100%;
    }
    
    .all-attendance-modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 95vh;
    }
    
    .attendance-details-modal {
        grid-template-columns: 1fr;
    }
    
    .latest-study-card {
        padding: 1rem;
    }
    
    .study-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* User Activity Analytics Styles */
.activity-summary {
    padding: 1rem 0;
}

.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.activity-stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.activity-stat-card.online {
    border-left: 4px solid #4caf50;
}

.activity-stat-card.active {
    border-left: 4px solid #2196f3;
}

.activity-stat-card.inactive {
    border-left: 4px solid #ff9800;
}

.activity-stat-card.very-inactive {
    border-left: 4px solid #f44336;
}

.activity-stat-card.never-logged {
    border-left: 4px solid #9e9e9e;
}

.activity-stat-card.total {
    border-left: 4px solid #1a5490;
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a5490;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.stat-percentage {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.125rem;
}

.user-list-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.user-list-header {
    padding: 0.75rem 1rem;
    background: #f5f7fa;
    border-radius: 8px 8px 0 0;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    border-bottom: 1px solid #e0e6ed;
}

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

.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.user-list-item:hover {
    background-color: #f9f9f9;
}

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

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    color: #1a5490;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    font-size: 0.8125rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status {
    margin-left: 1rem;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge.online {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge.active {
    background-color: #e3f2fd;
    color: #1565c0;
}

.badge.inactive {
    background-color: #fff3e0;
    color: #e65100;
}

.badge.never-logged {
    background-color: #f5f5f5;
    color: #616161;
}

.empty-state,
.error-state {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.9375rem;
}

.error-state {
    color: #f44336;
}

/* Test Users Toggle Styles */
.test-users-toggle-container {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.test-users-toggle-container.hidden {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: #666;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-slider {
    background-color: #1a5490;
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 500;
}

@media (max-width: 768px) {
    .activity-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .user-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .user-status {
        margin-left: 0;
    }
    
    .test-users-toggle-container {
        margin-right: 0.5rem;
    }
    
    .toggle-text {
        display: none;
    }
}

/* Engagement Summary Styles */
.engagement-summary {
    padding: 1rem 0;
}

.engagement-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.engagement-stat-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #1a5490;
}

.engagement-stat-card.login {
    border-left-color: #2196f3;
}

.engagement-stat-card.email {
    border-left-color: #4caf50;
}

.engagement-stat-card.study {
    border-left-color: #ff9800;
}

.engagement-stat-card.attendance {
    border-left-color: #9c27b0;
}

.engagement-stat-card.cell {
    border-left-color: #f44336;
}

.engagement-stat-header {
    margin-bottom: 0.75rem;
}

.engagement-stat-header h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a5490;
}

.engagement-stat-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.engagement-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.engagement-stat-item .stat-label {
    font-size: 0.875rem;
    color: #666;
}

.engagement-stat-item .stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a5490;
}

/* AI Settings Page Styles */
.ai-settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.status-indicator.healthy {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.unhealthy {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-icon {
    font-size: 1.2rem;
}

.ai-details {
    flex: 1;
}

.detail-item {
    margin-bottom: 0.5rem;
}

.detail-item strong {
    color: #1a5490;
    font-weight: 600;
}

.ai-url-config {
    max-width: 600px;
}

.url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.url-input:focus {
    outline: none;
    border-color: #1a5490;
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.ai-url-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.test-url-btn {
    background-color: #17a2b8;
    color: white;
}

.test-url-btn:hover:not(:disabled) {
    background-color: #138496;
}

.set-url-btn {
    background-color: #28a745;
    color: white;
}

.set-url-btn:hover:not(:disabled) {
    background-color: #218838;
}

.reset-url-btn {
    background-color: #ffc107;
    color: #212529;
}

.reset-url-btn:hover:not(:disabled) {
    background-color: #e0a800;
}

.button-icon {
    font-size: 1rem;
}

.button-text {
    font-size: 0.875rem;
}

.url-status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    display: none;
}

.url-status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.url-status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.url-status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.config-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.info-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-tips {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.config-tips h4 {
    margin: 0 0 1rem 0;
    color: #1a5490;
    font-size: 1rem;
}

/* ============================================
   AI Stats Enhanced Styling
   ============================================ */

/* Enhanced Stat Cards */
.stat-card-primary {
    border-left: 4px solid #2196F3;
}

.stat-card-info {
    border-left: 4px solid #00BCD4;
}

.stat-card-success {
    border-left: 4px solid #4CAF50;
}

.stat-card-warning {
    border-left: 4px solid #FF9800;
}

.stat-card-secondary {
    border-left: 4px solid #9C27B0;
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a5490;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.75rem;
    color: #999;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a5490;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e6ed;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Feedback Overview Grid */
.feedback-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.feedback-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.feedback-helpful {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8f4 100%);
}

.feedback-not-helpful {
    border-color: #FF9800;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f1 100%);
}

.feedback-inappropriate {
    border-color: #f44336;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.feedback-incorrect {
    border-color: #9C27B0;
    background: linear-gradient(135deg, #ffffff 0%, #f9f5fc 100%);
}

.feedback-stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.feedback-stat-content {
    flex: 1;
}

.feedback-stat-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a5490;
    margin-bottom: 0.25rem;
}

.feedback-stat-percentage {
    font-size: 0.75rem;
    color: #999;
}

/* Conversations Container */
.conversations-container {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.conversation-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e6ed;
    transition: all 0.3s ease;
}

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

.conversation-helpful {
    border-left: 4px solid #4CAF50;
}

.conversation-not-helpful {
    border-left: 4px solid #FF9800;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e6ed;
}

.conversation-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

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

.user-name {
    font-weight: 600;
    color: #1a5490;
    font-size: 0.95rem;
}

.conversation-date {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

.conversation-rating {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.helpful-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.not-helpful-badge {
    background: #fff3e0;
    color: #e65100;
}

.conversation-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-block {
    padding: 1rem;
    border-radius: 8px;
    background: #f5f7fa;
}

.user-message {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.ai-message {
    background: #f1f8e9;
    border-left: 3px solid #8BC34A;
}

.message-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.message-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.feedback-text {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #fff9c4;
    border-left: 3px solid #fbc02d;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #5d4037;
}

.feedback-important {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

/* Detailed Stats Grid */
.detailed-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Peak Usage Times */
.peak-hour-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.peak-hour-label {
    font-weight: 600;
    color: #666;
}

.peak-hour-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a5490;
}

.hourly-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hourly-bar-item {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 1rem;
    align-items: center;
}

.hourly-bar-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.hourly-bar {
    height: 24px;
    background: #e0e6ed;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.hourly-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3 0%, #21CBF3 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.hourly-bar-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a5490;
    text-align: right;
}

/* Function Calls */
.function-calls-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.function-call-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f5f7fa;
    border-radius: 8px;
    border-left: 3px solid #2196F3;
    transition: all 0.2s ease;
}

.function-call-item:hover {
    background: #e8f0f8;
    transform: translateX(4px);
}

.function-name {
    font-weight: 600;
    color: #1a5490;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.function-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.function-count {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
}

.function-percentage {
    font-size: 0.875rem;
    color: #666;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* No Data State */
.no-data {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #f5f7fa;
    border-radius: 8px;
    border: 2px dashed #e0e6ed;
}

/* Loading State */
.loading {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .feedback-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .conversation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .detailed-stats-grid,
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .hourly-bar-item {
        grid-template-columns: 60px 1fr 50px;
        gap: 0.5rem;
    }
    
    .function-call-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================
   AI Stats: Latest Activity (messages/day)
   ============================================ */

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.control-label {
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
}

.control-select {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
    background: #f9fafb;
    color: #333;
    font-weight: 600;
}

.refresh-button.compact {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.table-scroll {
    overflow: auto;
    max-height: 520px;
    border-radius: 10px;
    border: 1px solid #e0e6ed;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.activity-table thead th {
    position: sticky;
    top: 0;
    background: #f5f7fa;
    color: #1a5490;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e0e6ed;
    z-index: 1;
}

.activity-table tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #eef2f6;
    vertical-align: top;
    color: #333;
    font-size: 0.9rem;
}

.activity-table tbody tr:hover td {
    background: #fbfcfe;
}

.muted {
    color: #7a8796;
}

.small {
    font-size: 0.85rem;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.status-error {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.status-timeout {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffe0b2;
}

.status-pending,
.status-streaming,
.status-unknown {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}

.day-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.day-panel,
.session-panel {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    overflow: hidden;
}

.day-panel > summary,
.session-panel > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e0e6ed;
}

.day-panel > summary::-webkit-details-marker,
.session-panel > summary::-webkit-details-marker {
    display: none;
}

.day-title {
    font-weight: 800;
    color: #1a5490;
}

.day-meta,
.session-meta {
    color: #7a8796;
    font-size: 0.85rem;
    font-weight: 600;
}

.day-body,
.session-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-title {
    font-weight: 800;
    color: #333;
}

.activity-message {
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 0.85rem;
    background: #ffffff;
}

.activity-message-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.activity-message-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.activity-bubble {
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    border-left: 3px solid transparent;
}

.user-bubble {
    background: #e3f2fd;
    border-left-color: #2196F3;
}

.ai-bubble {
    background: #f1f8e9;
    border-left-color: #8BC34A;
}

.bubble-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.35rem;
}

.bubble-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.55;
    color: #1f2937;
}

.ai-stats-toolbar {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 14px;
    padding: 0.9rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
}

.toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.toolbar-row-secondary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef2f6;
    align-items: center;
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}

.toolbar-group.grow {
    min-width: 220px;
    flex: 1;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.control-input {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    background: #f9fafb;
    color: #333;
    font-weight: 600;
}

.refresh-button.secondary {
    background: #1a5490;
}

.refresh-button.secondary:hover {
    background: #164674;
}

.refresh-button.danger {
    background: #c62828;
}

.refresh-button.danger:hover {
    background: #a61f1f;
}

.toolbar-hint {
    color: #7a8796;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-list {
    display: grid;
    gap: 0.75rem;
}

.alert-item {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #fb923c;
    padding: 0.9rem 1rem;
    border-radius: 12px;
}

.alert-item.high {
    background: #fff1f2;
    border-color: #fecdd3;
    border-left-color: #e11d48;
}

.alert-title {
    font-weight: 800;
    color: #7c2d12;
    margin-bottom: 0.25rem;
}

.alert-item.high .alert-title {
    color: #9f1239;
}

.alert-message {
    color: #334155;
    line-height: 1.5;
}

.mini-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.mini-kpi {
    background: #f9fafb;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 0.85rem;
}

.mini-kpi .kpi-label {
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

.mini-kpi .kpi-value {
    font-size: 1.25rem;
    font-weight: 900;
    color: #1a5490;
}

.mini-kpi .kpi-sub {
    color: #7a8796;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

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

.simple-table th {
    text-align: left;
    color: #1a5490;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e0e6ed;
    background: #f5f7fa;
}

.simple-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #eef2f6;
    color: #334155;
    vertical-align: top;
}

.simple-table tr:hover td {
    background: #fbfcfe;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 9999;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: min(960px, 96vw);
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e0e6ed;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f9fafb;
}

.modal-title {
    font-weight: 900;
    color: #1a5490;
    font-size: 1.05rem;
}

.modal-close {
    border: 1px solid #e0e6ed;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-weight: 900;
    color: #334155;
}

.modal-close:hover {
    background: #f5f7fa;
}

.modal-body {
    padding: 1rem;
    overflow: auto;
}

.modal-pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    background: #0b1220;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 0.9rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: #f0f7ff !important;
}

@media (max-width: 1000px) {
    .activity-grid {
        grid-template-columns: 1fr;
    }
}

.config-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.config-tips li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.config-tips li:last-child {
    margin-bottom: 0;
}
