/* ===== PulseGuard - Global Styles ===== */

:root {
    --pg-primary: #4f46e5;
    --pg-primary-dark: #4338ca;
    --pg-primary-light: #eef2ff;
    --pg-success: #10b981;
    --pg-success-light: #ecfdf5;
    --pg-warning: #f59e0b;
    --pg-warning-light: #fffbeb;
    --pg-danger: #ef4444;
    --pg-danger-light: #fef2f2;
    --pg-dark: #1e293b;
    --pg-gray-50: #f8fafc;
    --pg-gray-100: #f1f5f9;
    --pg-gray-200: #e2e8f0;
    --pg-gray-300: #cbd5e1;
    --pg-gray-400: #94a3b8;
    --pg-gray-500: #64748b;
    --pg-gray-600: #475569;
    --pg-gray-700: #334155;
    --pg-gray-800: #1e293b;
    --pg-gray-900: #0f172a;
    --pg-radius: 10px;
    --pg-radius-lg: 14px;
    --pg-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --pg-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --pg-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
}

/* Smooth scrolling */
html {
    font-size: 15px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--pg-gray-800);
    background: var(--pg-gray-50);
    -webkit-font-smoothing: antialiased;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--pg-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-to-main:focus {
    top: 0;
}

/* Focus styles for better keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--pg-primary);
    outline-offset: 2px;
}

/* Override Bootstrap primary */
.btn-primary {
    background-color: var(--pg-primary);
    border-color: var(--pg-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--pg-primary-dark);
    border-color: var(--pg-primary-dark);
}
.btn-primary:active {
    background-color: #3730a3;
    border-color: #3730a3;
}

.btn-outline-primary {
    color: var(--pg-primary);
    border-color: var(--pg-primary);
}
.btn-outline-primary:hover {
    background-color: var(--pg-primary);
    border-color: var(--pg-primary);
}

.btn-outline-light {
    color: var(--pg-gray-700);
    border-color: var(--pg-gray-300);
    background: white;
}
.btn-outline-light:hover {
    background-color: var(--pg-gray-100);
    border-color: var(--pg-gray-400);
    color: var(--pg-gray-900);
}

.text-primary {
    color: var(--pg-primary) !important;
}
.bg-primary {
    background-color: var(--pg-primary) !important;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
}
.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--pg-gray-200);
    padding: 0.6rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--pg-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-control-lg {
    padding: 0.75rem 1rem;
    border-radius: 10px;
}
.form-label {
    font-weight: 500;
    color: var(--pg-gray-700);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.card {
    border: 1px solid var(--pg-gray-200);
    border-radius: var(--pg-radius-lg);
    box-shadow: var(--pg-shadow);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--pg-gray-200);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.table {
    margin-bottom: 0;
}
.table th {
    font-weight: 600;
    color: var(--pg-gray-500);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}
.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    color: var(--pg-gray-700);
}
.table tbody tr:hover {
    background-color: var(--pg-gray-50);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-badge::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-up {
    background: var(--pg-success-light);
    color: #065f46;
}
.status-up::before {
    background: var(--pg-success);
}
.status-down {
    background: var(--pg-danger-light);
    color: #991b1b;
}
.status-down::before {
    background: var(--pg-danger);
}
.status-degraded {
    background: var(--pg-warning-light);
    color: #92400e;
}
.status-degraded::before {
    background: var(--pg-warning);
}
.status-unknown, .status-paused, .status-maintenance {
    background: var(--pg-gray-100);
    color: var(--pg-gray-600);
}
.status-unknown::before, .status-paused::before, .status-maintenance::before {
    background: var(--pg-gray-400);
}

/* Auth pages */
.auth-body {
    background: var(--pg-gray-50, #f8f9fa);
}
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff;
    border-radius: var(--pg-radius-lg);
    box-shadow: var(--pg-shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pg-primary);
    margin-bottom: 0.5rem;
}
.auth-subtitle {
    color: var(--pg-gray-500);
    margin-bottom: 0;
}
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--pg-gray-400);
    font-size: 0.875rem;
}
.passcode-input {
    font-size: 1.75rem;
    letter-spacing: 0.5em;
    font-weight: 600;
}

/* Page headers */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--pg-gray-400);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
.empty-state h3 {
    color: var(--pg-gray-600);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.empty-state p {
    margin-bottom: 1.5rem;
}

/* Alert overrides */
.alert {
    border-radius: var(--pg-radius);
    border: none;
    font-size: 0.9rem;
}

/* Miscellaneous */
a {
    color: var(--pg-primary);
    text-decoration: none;
}
a:hover {
    color: var(--pg-primary-dark);
    text-decoration: underline;
}
