* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 13px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Navbar */
.navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: #f0f0f0;
    color: #667eea;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: #333;
    font-size: 28px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-success .stat-value {
    color: #28a745;
}

.stat-danger .stat-value {
    color: #dc3545;
}

.stat-warning .stat-value {
    color: #ffc107;
}

/* Servers Table */
.servers-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.servers-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.customer-group-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.customer-group-header td {
    padding: 12px 15px;
    font-weight: bold;
    font-size: 14px;
}

.customer-group-header .customer-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-count {
    font-size: 12px;
    opacity: 0.9;
    font-weight: normal;
}

.test-customer-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
}

.test-customer-btn:hover {
    background: rgba(255,255,255,0.3);
}

.servers-table thead th {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.servers-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.servers-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.servers-table tbody tr:hover {
    background-color: #e9ecef;
}

.servers-table tbody td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    vertical-align: middle;
}

.server-name-cell {
    font-weight: 500;
    color: #333;
}

.server-url-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.server-url-cell a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.server-url-cell a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.server-url-cell:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
}

.status-cell {
    text-align: center;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online {
    background-color: #28a745;
}

.status-dot.offline {
    background-color: #dc3545;
}

.status-dot.warning {
    background-color: #ffc107;
}

.status-text {
    font-weight: 500;
}

.status-text.online {
    color: #28a745;
}

.status-text.offline {
    color: #dc3545;
}

.status-text.warning {
    color: #856404;
}

.response-time-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.ssl-cell {
    text-align: center;
}

.ssl-yes {
    color: #28a745;
    font-weight: 500;
}

.ssl-no {
    color: #dc3545;
    font-weight: 500;
}

.date-cell {
    font-size: 12px;
    white-space: nowrap;
}

.action-cell {
    text-align: center;
}

.btn-test-small {
    padding: 4px 10px;
    font-size: 11px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-test-small:hover {
    background: #5568d3;
}

.btn-test-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.server-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.server-card.status-online {
    border-left: 4px solid #28a745;
}

.server-card.status-offline {
    border-left: 4px solid #dc3545;
}

.server-card.status-warning {
    border-left: 4px solid #ffc107;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.server-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.server-url {
    font-size: 12px;
    color: #999;
    word-break: break-all;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.server-info {
    margin: 15px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 600;
}

.server-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Alerts Page */
.alerts-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.alert-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.alert-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.alert-time {
    font-size: 13px;
    color: #999;
}

.alert-body {
    margin: 10px 0;
    color: #666;
}

.alert-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Config Page */
.config-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.config-section h2 {
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Sortable Table Headers */
.servers-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.servers-table thead th.sortable:hover {
    background-color: #e9ecef;
}

.servers-table thead th.sortable:active {
    background-color: #dee2e6;
}

.ssl-days-header {
    background-color: #fff3cd !important;
}

/* SSL Issuer Column */
.ssl-issuer-cell {
    font-size: 11px;
    color: #666;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssl-issuer-cell:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

/* SSL Days Remaining Status Colors */
.ssl-expired {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: bold;
}

.ssl-critical {
    background-color: #f5c6cb !important;
    color: #721c24 !important;
    font-weight: 600;
}

.ssl-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    font-weight: 500;
}

.ssl-medium {
    background-color: #ffeeba !important;
    color: #856404 !important;
}

.ssl-good {
    background-color: #d4edda !important;
    color: #155724 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .servers-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
