/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-indicator {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

.status-indicator.connected {
    background-color: #27ae60;
    color: white;
}

.status-indicator.disconnected {
    background-color: #e74c3c;
    color: white;
}

.status-indicator.checking {
    background-color: #f39c12;
    color: white;
}

/* Navigation */
.nav {
    background: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
}

.nav-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-btn:hover {
    background-color: #f8f9fa;
}

.nav-btn.active {
    background-color: #3498db;
    color: white;
}

/* Main content */
.main-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section {
    display: none;
    padding: 30px;
}

.section.active {
    display: block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.metric-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.health-indicator {
    font-size: 24px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
}

.health-indicator.healthy {
    background-color: #27ae60;
    color: white;
}

.health-indicator.unhealthy {
    background-color: #e74c3c;
    color: white;
}

.health-indicator.error {
    background-color: #f39c12;
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.dimensions-table,
.dimensions-table th,
.dimensions-table td {
    font-family: inherit;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Buttons */
.action-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background-color: #5a6268;
}

.action-btn.primary {
    background-color: #3498db;
}

.action-btn.primary:hover {
    background-color: #2980b9;
}

.action-btn.danger {
    background-color: #e74c3c;
}

.action-btn.danger:hover {
    background-color: #c0392b;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.pagination-btn {
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    background: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #3498db;
    color: white;
}

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

/* Filters */
.filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

/* Loading states */
.loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

.error {
    text-align: center;
    color: #e74c3c;
    padding: 20px;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.no-data {
    text-align: center;
    color: #95a5a6;
    padding: 40px;
}

/* Dynamic section loading */
.section-container {
    min-height: 400px;
}

.loading-section {
    display: flex;
    justify-content: center;
            align-items: center;
    min-height: 200px;
    color: #6c757d;
    font-style: italic;
}

.error-section {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.error-section h3 {
    color: #dc3545;
    margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav {
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
    }
}

/* Import Monitoring Styles */
.import-status-card {
    min-height: 300px;
}

.import-status-content {
    padding: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.running {
    background-color: #3498db;
    color: white;
}

.status-badge.pending {
    background-color: #8e44ad;
    color: white;
}

.status-badge.queued {
    background-color: #6c5ce7;
    color: white;
}

.status-badge.starting {
    background-color: #2980b9;
    color: white;
}

.status-badge.cancelling {
    background-color: #d35400;
    color: white;
}

.status-badge.cancelled {
    background-color: #7f8c8d;
    color: white;
}

.status-badge.completed {
    background-color: #27ae60;
    color: white;
}

.status-badge.failed {
    background-color: #e74c3c;
    color: white;
}

.status-badge.interrupted {
    background-color: #c0392b;
    color: white;
}

.status-badge.paused {
    background-color: #f39c12;
    color: white;
}

.status-badge.success {
    background-color: #27ae60;
    color: white;
}

.status-badge.error {
    background-color: #e74c3c;
    color: white;
}

.status-badge.warning {
    background-color: #f39c12;
    color: white;
}

.status-badge.normal {
    background-color: #27ae60;
    color: white;
}

.status-badge.critical {
    background-color: #c0392b;
    color: white;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.metrics-row {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.metric-item {
    flex: 1;
    font-size: 14px;
}

.metric-item label {
    font-weight: bold;
    color: #666;
    margin-right: 5px;
}

.time-info {
    margin-top: 15px;
    font-size: 12px;
    color: #999;
}

.time-info div {
    margin-bottom: 5px;
}

.import-history-table,
.import-errors-table {
    width: 100%;
    margin-top: 20px;
}

.import-history-table th,
.import-errors-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
}

.import-history-table td,
.import-errors-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
}

.import-history-table tr:hover,
.import-errors-table tr:hover {
    background-color: #f8f9fa;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    max-width: 400px;
    word-wrap: break-word;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-label {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
}

.metric-value {
    color: #2c3e50;
    font-weight: 500;
}

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

/* ============================================
   IMPORT CONTROL SECTION STYLES
   ============================================ */

/* Section content container */
.section-content {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.config-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.config-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.config-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.config-label {
    color: #6c757d;
    font-size: 14px;
}

.config-value {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.config-value.status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
}

/* Import Actions Grid */
.import-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.import-action-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.import-action-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.action-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
}

.action-params {
    flex: 1;
    margin-bottom: 15px;
}

.action-params .form-group {
    margin-bottom: 12px;
}

.action-params .form-group label {
    font-size: 13px;
    margin-bottom: 4px;
}

.action-params .form-group input,
.action-params .form-group select {
    padding: 8px;
    font-size: 13px;
}

.action-btn.large {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
}

/* Active Jobs Section */
.active-jobs-section {
    margin-top: 30px;
}

.active-jobs-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

#active-jobs-container {
    display: grid;
    gap: 15px;
}

.job-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #6c757d;
}

.job-card.running {
    border-left-color: #3498db;
    background: #ebf5fb;
}

.job-card.success,
.job-card.completed {
    border-left-color: #27ae60;
    background: #e8f6ef;
}

.job-card.error,
.job-card.failed {
    border-left-color: #e74c3c;
    background: #fdf2f2;
}

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

.job-type {
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 14px;
}

.job-progress {
    margin: 10px 0;
}

.job-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #6c757d;
}

.job-error {
    margin-top: 10px;
    padding: 10px;
    background: #fde8e8;
    border-radius: 4px;
    color: #c53030;
    font-size: 13px;
}

.job-metrics {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.job-metrics .rate {
    color: #3498db;
    font-weight: 500;
}

.job-metrics .eta {
    color: #27ae60;
    font-weight: 500;
}

.job-metrics .current-item {
    color: #7f8c8d;
    font-style: italic;
}

.job-stats .error {
    color: #e74c3c;
    font-weight: 600;
}

/* Job Errors Section */
.job-errors-section {
    margin-top: 10px;
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
}

.errors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    color: #e74c3c;
    font-size: 13px;
    font-weight: 500;
}

.errors-header:hover {
    color: #c0392b;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.errors-list {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.error-item {
    display: grid;
    grid-template-columns: 80px 80px 80px 60px 1fr;
    gap: 8px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    border-left: 3px solid #e74c3c;
}

.error-time {
    color: #7f8c8d;
}

.error-type {
    color: #2c3e50;
    font-weight: 500;
}

.error-id {
    color: #3498db;
    font-family: monospace;
}

.error-op {
    color: #8e44ad;
}

.error-msg {
    color: #c0392b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-errors {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
}

.more-errors a {
    color: #3498db;
    text-decoration: none;
}

.more-errors a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.job-details-modal-content {
    width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

.job-details-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
}

.detail-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.detail-value.error {
    color: #e74c3c;
}

.job-error-main {
    padding: 15px;
    background: #fde8e8;
    border-radius: 8px;
    color: #c53030;
    margin-bottom: 20px;
}

.errors-section h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.errors-detail-table {
    width: 100%;
    font-size: 13px;
}

.errors-detail-table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
}

.error-message-cell {
    max-width: 400px;
    word-break: break-word;
    color: #c53030;
}

/* Job params, result, and log styles */
.job-params {
    margin: 8px 0 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #d9e2ec;
    border-radius: 8px;
}

.job-params-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.job-params-meta {
    margin: 6px 0;
    font-size: 13px;
    color: #52606d;
}

.job-params-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.job-params-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef4fb;
    color: #334e68;
    font-size: 13px;
    line-height: 1.4;
}

.job-params-pill-label {
    font-weight: 600;
}

.job-params-details {
    margin-top: 10px;
}

.job-params-details summary {
    cursor: pointer;
    color: #1f5f8b;
    font-size: 13px;
    font-weight: 500;
}

.job-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 14px;
    margin-top: 10px;
}

.job-param-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5edf5;
}

.job-param-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6c7b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.job-param-value {
    font-size: 14px;
    line-height: 1.45;
    color: #243b53;
    word-break: break-word;
}

.job-param-value-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.job-details-section {
    margin-bottom: 20px;
}

.job-details-section h4 {
    margin: 0 0 10px;
    color: #2c3e50;
}

.job-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
}

.detail-value-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.job-details-diagnostics {
    margin-bottom: 20px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fbff;
}

.job-details-diagnostics summary {
    cursor: pointer;
    padding: 12px 14px;
    color: #1f5f8b;
    font-size: 14px;
    font-weight: 600;
}

.job-details-diagnostics-body {
    padding: 0 14px 14px;
}

.job-result {
    padding: 10px;
    margin: 10px 0;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    color: #2e7d32;
    border-radius: 4px;
}

.job-card.error .job-result {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.job-card.warning .job-result {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #e65100;
}

.job-details-link {
    font-size: 12px;
    color: #3498db;
    margin-left: auto;
}

.job-log-section {
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
}

.log-header:hover {
    background: #eeeeee;
}

.log-list {
    padding: 8px;
    background: #fafafa;
    max-height: 320px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

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

.log-time {
    color: #666;
    min-width: 70px;
}

.job-log-section .log-msg {
    color: #1f2933;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

/* Snackbar */
.snackbar {
    visibility: hidden;
    min-width: 280px;
    max-width: 500px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 14px 24px;
    position: fixed;
    z-index: 2000;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.snackbar.show {
    visibility: visible;
    opacity: 1;
}

.snackbar.success {
    background-color: #2e7d32;
}

.snackbar.error {
    background-color: #c62828;
}

.snackbar.warning {
    background-color: #f57c00;
}

.snackbar.info {
    background-color: #1976d2;
}

/* Section header row */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-row h3 {
    margin: 0;
}

/* Button sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Job header actions */
.job-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.job-cancel-btn {
    font-weight: 500;
}

/* Import Tabs */
.import-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
}

.import-tabs .tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.import-tabs .tab-btn:hover {
    color: #3498db;
    background: #f8f9fa;
}

.import-tabs .tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.compact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compact-list .job-item {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(44, 62, 80, 0.05);
}

.compact-list .job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.job-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 16px;
    font-size: 13px;
    color: #566573;
}

.schedule-params-editor {
    padding: 12px;
    border: 1px solid #dfe6ee;
    border-radius: 8px;
    background: #f8fbff;
    margin-bottom: 16px;
}

#resource-snapshot-items .config-value.status-badge {
    justify-self: start;
}

#resource-governor-summary .config-card {
    min-height: 100%;
}

/* VEL Status Grid */
.vel-status-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .vel-status-grid {
        grid-template-columns: 1fr;
    }
}

.vel-status-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.vel-status-card.wide {
    overflow: hidden;
}

.vel-status-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.vel-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vel-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.stat-value.error {
    color: #e74c3c;
}

/* Recent Events Table */
.recent-events-container {
    max-height: 400px;
    overflow-y: auto;
}

.recent-events-table {
    font-size: 13px;
}

.recent-events-table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
}

.recent-events-table td {
    padding: 8px 12px;
}

.event-name {
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #1976d2;
}

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

.schedule-table code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Database Management Styles */
.database-stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.database-summary {
    display: flex;
    gap: 30px;
}

.stat-box {
    text-align: center;
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-box .stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-box .stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

.danger-zone {
    border: 2px solid #dc3545;
    border-radius: 8px;
    background: #fff5f5;
}

.danger-zone h3 {
    color: #dc3545;
}

.danger-warning {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body .warning-text {
    color: #856404;
    background: #fff3cd;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.modal-body .warning-text.danger {
    color: #721c24;
    background: #f8d7da;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 5px;
}

.modal-body code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Tooltip */
.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    font-size: 11px;
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .import-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .vel-status-grid {
        grid-template-columns: 1fr;
    }
    
    .database-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .database-stats-container {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Navigation Dropdown Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .dropdown-toggle {
    flex: none;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-dropdown .dropdown-toggle:hover {
    background-color: #f8f9fa;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 1000;
    padding: 8px 0;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-menu .nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    border-radius: 0;
    font-size: 14px;
}

.nav-dropdown .dropdown-menu .nav-btn:hover {
    background-color: #f0f0f0;
}

.nav-dropdown .dropdown-menu .nav-btn.active {
    background-color: #3498db;
    color: white;
}

/* Raw Logs section styles */
.logs-section {
    margin-top: 30px;
    border-top: 2px solid #dee2e6;
}

.logs-section h2 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 18px;
}

.raw-logs-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.auto-refresh-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-left: auto;
}

.auto-refresh-label input[type="checkbox"] {
    margin: 0;
}

.raw-logs-controls select,
.raw-logs-controls input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.raw-logs-controls input[type="number"] {
    width: 100px;
}

.raw-logs-content {
    background-color: #1e1e1e;
    color: #f8f8f2;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 8px;
    overflow: hidden;
    padding: 20px;
}

.raw-logs-content pre {
    padding: 0;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
}

.raw-logs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    gap: 20px;
}

.raw-logs-pagination .pagination-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.raw-logs-pagination .pagination-btn:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.raw-logs-pagination .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#raw-page-info-display {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.raw-logs-info {
    padding: 10px 15px;
    background-color: #2d3748;
    border-top: 1px solid #4a5568;
    font-size: 13px;
    color: #cbd5e0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.aggregation-layout {
    display: grid;
    gap: 20px;
}

.aggregation-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}

.aggregation-panel h3 {
    margin-top: 0;
}

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

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

.aggregation-hint {
    margin: 12px 0 0;
    color: #5f6c7b;
}

.aggregation-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.aggregation-meta-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
}

.aggregation-meta-label,
.aggregation-detail-label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aggregation-job-card {
    display: grid;
    gap: 16px;
}

.aggregation-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.aggregation-job-source {
    color: #475569;
    font-weight: 600;
}

.aggregation-progress {
    display: grid;
    gap: 8px;
}

.aggregation-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.aggregation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #10b981);
}

.aggregation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.aggregation-detail {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.aggregation-empty,
.aggregation-error,
.aggregation-no-data {
    padding: 16px;
    border-radius: 8px;
}

.aggregation-empty,
.aggregation-no-data {
    background: #f8fafc;
    color: #475569;
}

.aggregation-error {
    background: #fff1f2;
    color: #b91c1c;
}

@media (max-width: 768px) {
    .aggregation-panel-header,
    .aggregation-job-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   MATERIAL YOU ADMIN SHELL
   ============================================ */

:root {
    --md-background: #fffbfe;
    --md-surface: #f3edf7;
    --md-surface-low: #e7e0ec;
    --md-surface-soft: rgba(243, 237, 247, 0.88);
    --md-primary: #6750a4;
    --md-primary-soft: rgba(103, 80, 164, 0.12);
    --md-secondary-container: #e8def8;
    --md-tertiary: #7d5260;
    --md-outline: #79747e;
    --md-on-surface: #1c1b1f;
    --md-on-surface-variant: #49454f;
    --md-on-primary: #ffffff;
    --md-danger: #ba1a1a;
    --md-danger-soft: #ffdad6;
    --md-success: #2e7d32;
    --md-warning: #b26a00;
    --md-info: #355ca8;
    --md-shadow-1: 0 18px 40px rgba(30, 27, 37, 0.08);
    --md-shadow-2: 0 24px 60px rgba(30, 27, 37, 0.14);
    --md-shadow-3: 0 28px 90px rgba(30, 27, 37, 0.2);
    --md-radius-card: 24px;
    --md-radius-shell: 32px;
    --md-radius-hero: 40px;
    --md-easing: cubic-bezier(0.2, 0, 0, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--md-on-surface);
    background: var(--md-background);
    background-image:
        radial-gradient(circle at top right, rgba(232, 222, 248, 0.9) 0, rgba(232, 222, 248, 0) 42%),
        radial-gradient(circle at bottom left, rgba(125, 82, 96, 0.14) 0, rgba(125, 82, 96, 0) 35%);
    min-height: 100vh;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

body.admin-shell-page,
body.admin-login-page {
    overflow-x: hidden;
}

.ambient-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ambient-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(64px);
    opacity: 0.6;
}

.ambient-shape-primary {
    width: 24rem;
    height: 24rem;
    background: rgba(103, 80, 164, 0.26);
    top: -6rem;
    right: -5rem;
}

.ambient-shape-secondary {
    width: 18rem;
    height: 18rem;
    background: rgba(232, 222, 248, 0.85);
    left: -6rem;
    top: 20%;
}

.ambient-shape-tertiary {
    width: 22rem;
    height: 22rem;
    background: rgba(125, 82, 96, 0.16);
    bottom: -7rem;
    right: 14%;
}

.app-shell-root {
    position: relative;
    z-index: 1;
    padding: 24px;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(121, 116, 126, 0.16);
    border-radius: var(--md-radius-shell);
    background: rgba(255, 251, 254, 0.76);
    backdrop-filter: blur(18px);
    box-shadow: var(--md-shadow-1);
}

.app-topbar-start,
.app-topbar-end {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-badge,
.sidebar-chip,
.login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--md-secondary-container);
    color: #1d192b;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-eyebrow,
.sidebar-eyebrow {
    color: var(--md-on-surface-variant);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-title,
.sidebar-title {
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.icon-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 48px;
    height: 48px;
    padding: 0 12px;
    border: 1px solid rgba(121, 116, 126, 0.22);
    border-radius: 18px;
    background: rgba(232, 222, 248, 0.42);
    cursor: pointer;
}

.icon-button span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--md-on-surface);
}

.topbar-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.topbar-caption {
    color: var(--md-on-surface-variant);
    font-size: 0.75rem;
}

.app-body {
    display: grid;
    grid-template-columns: minmax(260px, 288px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
}

.sidebar-surface,
.hero-panel,
.main-surface,
.login-card {
    border: 1px solid rgba(121, 116, 126, 0.12);
    background: rgba(255, 251, 254, 0.76);
    backdrop-filter: blur(16px);
    box-shadow: var(--md-shadow-1);
}

.sidebar-surface {
    padding: 20px;
    border-radius: var(--md-radius-shell);
}

.sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-group {
    padding: 4px 0;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--md-on-surface-variant);
    cursor: pointer;
    font-weight: 500;
}

.sidebar-group-links {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px 8px 0;
}

.sidebar-group.expanded .sidebar-group-links {
    display: flex;
}

.sidebar-link,
.subnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--md-on-surface-variant);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--md-easing), box-shadow 0.3s var(--md-easing);
}

.sidebar-link:hover,
.subnav-link:hover,
.sidebar-group-toggle:hover {
    background: rgba(103, 80, 164, 0.1);
    color: var(--md-primary);
}

.sidebar-link.active,
.subnav-link.active {
    color: var(--md-on-primary);
    background: var(--md-primary);
    box-shadow: 0 14px 24px rgba(103, 80, 164, 0.24);
}

.sidebar-group-arrow {
    transition: transform 0.2s var(--md-easing);
}

.sidebar-group.expanded .sidebar-group-arrow {
    transform: rotate(180deg);
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

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

.nav-toggle {
    display: none;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    padding: 28px 32px;
    border-radius: var(--md-radius-hero);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-copy h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.section-kicker {
    color: var(--md-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--md-on-surface-variant);
    font-size: 0.875rem;
}

.breadcrumbs a {
    text-decoration: none;
}

.breadcrumb-separator {
    margin-left: 8px;
    color: rgba(73, 69, 79, 0.52);
}

.section-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-subnav.is-empty {
    display: none;
}

.main-surface {
    min-height: 60vh;
    border-radius: var(--md-radius-hero);
    padding: 28px;
    overflow: hidden;
}

.section-container {
    min-height: 400px;
}

.sidebar-backdrop {
    display: none;
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 440px);
    padding: 32px;
    border-radius: var(--md-radius-hero);
    display: grid;
    gap: 24px;
}

.login-copy {
    display: grid;
    gap: 12px;
}

.login-copy h1 {
    font-size: 2.2rem;
    line-height: 1.15;
    font-weight: 500;
}

.login-copy p {
    color: var(--md-on-surface-variant);
    font-size: 1rem;
    line-height: 1.6;
}

.login-form,
.md-field {
    display: grid;
    gap: 10px;
}

.md-field-label,
.form-group label,
.filter-group label {
    color: var(--md-on-surface-variant);
    font-size: 0.875rem;
    font-weight: 500;
}

.md-input,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea,
.filter-group input,
.filter-group select,
.raw-logs-controls select,
.raw-logs-controls input {
    width: 100%;
    min-height: 56px;
    padding: 18px 16px 12px;
    border: none;
    border-bottom: 2px solid var(--md-outline);
    border-radius: 12px 12px 0 0;
    background: var(--md-surface-low);
    color: var(--md-on-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.md-input:focus,
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus,
.filter-group input:focus,
.filter-group select:focus,
.raw-logs-controls select:focus,
.raw-logs-controls input:focus {
    outline: none;
    border-bottom-color: var(--md-primary);
    box-shadow: 0 0 0 4px rgba(103, 80, 164, 0.12);
}

.md-button,
.action-btn,
.btn,
.pagination-btn,
.logout-btn,
.login-btn,
.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s var(--md-easing),
        box-shadow 0.3s var(--md-easing);
}

.md-button:active,
.action-btn:active,
.btn:active,
.pagination-btn:active,
.logout-btn:active,
.login-btn:active {
    transform: scale(0.96);
}

.md-button-filled,
.action-btn.primary,
.btn.primary,
.login-btn {
    background: var(--md-primary);
    color: var(--md-on-primary);
    box-shadow: 0 16px 28px rgba(103, 80, 164, 0.22);
}

.md-button-filled:hover,
.action-btn.primary:hover,
.btn.primary:hover,
.login-btn:hover {
    background: rgba(103, 80, 164, 0.92);
}

.md-button-tonal,
.action-btn,
.btn.secondary,
.logout-btn,
.pagination-btn {
    background: var(--md-secondary-container);
    color: #1d192b;
}

.md-button-outlined,
.btn.warning,
.action-btn.warning,
.btn-danger,
.action-btn.danger,
.btn.danger {
    border-color: rgba(121, 116, 126, 0.28);
    background: rgba(255, 251, 254, 0.5);
    color: var(--md-primary);
}

.action-btn.warning,
.btn.warning {
    background: rgba(178, 106, 0, 0.12);
    color: var(--md-warning);
    border-color: rgba(178, 106, 0, 0.18);
}

.action-btn.danger,
.btn.danger,
.btn-danger {
    background: var(--md-danger-soft);
    color: var(--md-danger);
    border-color: rgba(186, 26, 26, 0.16);
}

.action-btn.success,
.btn.success {
    background: rgba(46, 125, 50, 0.14);
    color: var(--md-success);
}

.status-indicator,
.status-badge,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-indicator.connected,
.status-badge.completed,
.status-badge.success,
.status-badge.normal {
    background: rgba(46, 125, 50, 0.14);
    color: var(--md-success);
}

.status-indicator.disconnected,
.status-badge.failed,
.status-badge.error,
.status-badge.critical {
    background: rgba(186, 26, 26, 0.12);
    color: var(--md-danger);
}

.status-indicator.checking,
.status-badge.pending,
.status-badge.warning,
.status-badge.queued,
.status-badge.starting,
.status-badge.paused,
.status-badge.cancelling {
    background: rgba(178, 106, 0, 0.12);
    color: var(--md-warning);
}

.status-badge.running,
.status-badge.info {
    background: rgba(53, 92, 168, 0.14);
    color: var(--md-info);
}

.filters,
.section-content,
.metric-card,
.config-card,
.import-action-card,
.vel-status-card,
.job-card,
.compact-list .job-item,
.aggregation-panel,
.stat-box,
.danger-zone,
.scheduler-info-block,
.schedule-params-editor,
.raw-logs-content,
.raw-logs-pagination,
.raw-logs-info,
.modal-content {
    background: var(--md-surface);
    border: 1px solid rgba(121, 116, 126, 0.16);
    border-radius: var(--md-radius-card);
    box-shadow: var(--md-shadow-1);
}

.filters,
.section-content,
.metric-card,
.config-card,
.import-action-card,
.vel-status-card,
.job-card,
.aggregation-panel,
.schedule-params-editor {
    padding: 20px;
}

.metric-card:hover,
.section-content:hover,
.config-card:hover,
.import-action-card:hover,
.vel-status-card:hover,
.compact-list .job-item:hover,
.aggregation-panel:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--md-shadow-2);
}

.data-table {
    background: transparent;
}

.data-table th {
    background: rgba(232, 222, 248, 0.78);
    color: var(--md-on-surface);
    border-bottom: 1px solid rgba(121, 116, 126, 0.16);
}

.data-table td {
    border-bottom: 1px solid rgba(121, 116, 126, 0.12);
}

.data-table tbody tr:hover {
    background: rgba(103, 80, 164, 0.06);
}

.section.active {
    display: block;
    padding: 0;
}

.section > h2 {
    margin-bottom: 12px;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.section-description {
    color: var(--md-on-surface-variant);
    margin-bottom: 18px;
}

.section-header,
.section-header-row,
.job-header,
.modal-header,
.modal-footer,
.raw-logs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.table-container,
.recent-events-container,
.schedule-container {
    border-radius: 24px;
}

.import-tabs .tab-btn,
.tab-btn {
    min-height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--md-on-surface-variant);
}

.import-tabs .tab-btn.active,
.tab-btn.active {
    color: var(--md-on-primary);
    background: var(--md-primary);
}

.error,
.error-section,
.danger-warning,
.job-error,
.job-error-main {
    background: rgba(186, 26, 26, 0.08);
    color: var(--md-danger);
    border: 1px solid rgba(186, 26, 26, 0.12);
    border-radius: 20px;
}

.loading,
.loading-section,
.no-data {
    color: var(--md-on-surface-variant);
}

.snackbar {
    border-radius: 20px;
    box-shadow: var(--md-shadow-3);
}

.raw-logs-content {
    background: #201d27;
    color: #f7f2fa;
    border-color: rgba(255, 255, 255, 0.04);
}

.raw-logs-content pre {
    color: #f7f2fa;
}

.raw-logs-info {
    background: #2a2534;
    color: rgba(247, 242, 250, 0.78);
}

*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.22);
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: inline-flex;
    }

    .app-shell-root {
        padding: 16px;
    }

    .app-body {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        inset: 16px auto 16px 16px;
        width: min(88vw, 320px);
        z-index: 25;
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.3s var(--md-easing);
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: block;
        border: none;
        background: rgba(28, 27, 31, 0.18);
        backdrop-filter: blur(6px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .hero-panel {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 28px;
        padding: 24px;
    }

    .main-surface,
    .login-card {
        border-radius: 28px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-topbar,
    .app-topbar-end {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-status {
        align-items: flex-start;
    }

    .hero-copy h1,
    .section > h2,
    .login-copy h1 {
        font-size: 1.75rem;
    }

    .main-surface {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
