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

:root {
    --primary-color: #0066CC;
    --primary-dark: #004B9C;
    --primary-light: #3385DB;
    --secondary-color: #00A3E0;
    --accent-color: #FF6B35;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --error-color: #DC3545;
    --text-dark: #1A1A1A;
    --text-light: #4A4A4A;
    --text-muted: #888888;
    --bg-light: #F5F7FA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-container {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
}

.login-logo {
    height: 50px;
    display: block;
    margin: 0 auto 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    height: 32px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.admin-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-name {
    font-weight: 600;
    color: var(--text-dark);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.page-actions {
    display: flex;
    gap: 1rem;
}

.btn-refresh {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    transition: all 0.3s;
}

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

.metric-card.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.metric-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-value.large {
    font-size: 2.5rem;
}

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

.metric-card.highlight .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.metric-change {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.metric-subtext {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

/* Activity Card */
.activity-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.activity-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.activity-icon {
    font-size: 1.5rem;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-dark);
    font-weight: 500;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.activity-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Tables */
.table-container {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.table-loading {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.verified {
    background: #E8F5E9;
    color: var(--success-color);
}

.status-badge.unverified {
    background: #FFF3E0;
    color: var(--warning-color);
}

.status-badge.healthy {
    background: #E8F5E9;
    color: var(--success-color);
}

.status-badge.unhealthy {
    background: #FFEBEE;
    color: var(--error-color);
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.online-indicator.online {
    background: var(--success-color);
}

.online-indicator.offline {
    background: var(--text-muted);
}

/* Buttons */
.btn-view, .btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

.btn-view:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.btn-delete:hover {
    background: #C82333;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input, .search-input, .filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--bg-light);
}

.form-input:focus, .search-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.search-input {
    max-width: 300px;
}

.filter-select {
    max-width: 200px;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #FEE;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-success {
    background: #E8F5E9;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 1200px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* System Health */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.system-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.system-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.health-status, .stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.health-item, .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
}

/* Analytics */
.analytics-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

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

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-input, .filter-select {
        max-width: 100%;
    }
}
