* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 10px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 28px;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="text"], input[type="password"], select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    color: #333;
}

select {
    cursor: pointer;
    min-width: 100px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

button, .btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.status-offline {
    background: #dc3545;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.metric-card h3 {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-card .value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.metric-card .unit {
    font-size: 14px;
    color: #999;
}

.metric-card.success .value {
    color: #28a745;
}

.metric-card.danger .value {
    color: #dc3545;
}

.metric-card.info .value {
    color: #17a2b8;
}

.metric-card.warning .value {
    color: #ffc107;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 20px;
}

.data-table {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.data-table h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.refresh-info {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
}

.uri-list {
    list-style: none;
}

.uri-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.uri-list li:last-child {
    border-bottom: none;
}

.uri-path {
    font-family: monospace;
    color: #667eea;
}

.uri-count {
    font-weight: bold;
    color: #333;
}

input[type="datetime-local"] {
    min-width: 200px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.error-detail-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
}

.error-detail-section h4 {
    margin-bottom: 10px;
    color: #333;
}

.error-detail-section pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
}

.error-detail-section .value {
    font-family: monospace;
    color: #667eea;
    word-break: break-all;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Alert styles for scheduler manager */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.alert.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
    display: block;
}

.alert.info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
    display: block;
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    .data-table {
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 14px;
    }

    .data-table h3 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Bigger tap targets for buttons in tables */
    .btn-small {
        padding: 7px 10px;
        font-size: 12px;
        min-height: 34px;
    }

    /* Input and select easier to tap */
    input[type="text"],
    input[type="password"],
    select {
        padding: 10px 12px;
        font-size: 15px; /* Prevent iOS zoom on focus */
    }

    button, .btn-primary, .btn-secondary {
        padding: 10px 16px;
        min-height: 40px;
    }

    /* Horizontal scroll hint for tables */
    .table-responsive-hint::after {
        content: ' ← swipe →';
        font-size: 11px;
        color: #aaa;
        font-style: italic;
    }
}

@media (max-width: 480px) {
    .data-table {
        padding: 12px;
        border-radius: 6px;
    }

    th, td {
        padding: 9px 7px;
        font-size: 12px;
    }
}

/* Status badges for scheduler */
.status-enabled {
    background: #c6f6d5;
    color: #22543d;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.status-disabled {
    background: #fed7d7;
    color: #742a2a;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

