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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px 0;
}

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

header {
    background: white;
    padding: 24px 32px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e4e6eb;
}

h1 {
    color: #1c1e21;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h2 {
    color: #1c1e21;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

.btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #f0f2f5;
    color: #1c1e21;
    border: 1px solid #d0d5dd;
}

.btn-secondary:hover {
    background: #e4e6eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

#map {
    height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
}

.server-list {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e4e6eb;
}

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: #212529;
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

.status-up {
    color: #16a34a;
    font-weight: 600;
}

.status-down {
    color: #dc2626;
    font-weight: 600;
}

.status-unknown {
    color: #6b7280;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 8px;
    width: 650px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    animation: slideIn 0.3s;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s;
    background: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#modalMap {
    height: 350px;
    margin: 10px 0;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: crosshair;
}

.location-info {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 13px;
    color: #6b7280;
    display: none;
    border: 1px solid #e4e6eb;
}

.location-info.active {
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

#lastUpdate {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

.text-center {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Leaflet customizations */
.leaflet-popup-content {
    margin: 10px;
    line-height: 1.5;
}

.leaflet-popup-content strong {
    color: #333;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Table hover effect */
tbody tr {
    transition: background-color 0.15s;
}

tbody tr:hover {
    background: #f9fafb;
}

/* Layout dua kolom: tabel server + incident feed */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

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

.section-head h2 {
    margin-bottom: 0;
}

/* Incident feed */
.incident-feed {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e4e6eb;
}

.event-list {
    list-style: none;
    max-height: 460px;
    overflow-y: auto;
}

.event-empty {
    color: #6b7280;
    font-style: italic;
    font-size: 13px;
    padding: 8px 0;
}

.event-item {
    display: flex;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #f0f2f5;
    border-left: 3px solid transparent;
}

.event-item.event-down {
    border-left-color: #dc2626;
}

.event-item.event-up {
    border-left-color: #16a34a;
}

.event-icon {
    font-size: 12px;
    line-height: 1.6;
}

.event-body {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 13px;
    color: #1c1e21;
}

.event-dur {
    color: #6b7280;
    font-weight: 400;
}

.event-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Responsive design */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }

    #map {
        height: 400px;
    }

    .actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}